Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
Questions about Android development and PDF
  • Page:
  • 1

TOPIC:

PDF display goes blank while pinch-zooming 8 months 2 weeks ago #15813

  • arlomedia
  • arlomedia's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 56
  • Thank you received: 1
When I pinch-zoom a PDF document to resize it, the display goes blank as soon as the pinch gesture is recognized, and it doesn't reappear until I remove my fingers from the screen. When the document reappears, it has resized correctly, but it's difficult to pinch to the desired size while the document is hidden, and this makes my app look clunky and not polished.

I tried the PDFSample app that comes with the SDK download, and it resizes smoothly with no problems. But I can't figure out what is different in my setup.

I have updated to the latest SDK version 3.65.27. I've tested my app on Android 5, 8 and 12 and the behavior is the same on all three. I am not using the PDFViewAct class like the sample app does because I'm placing the PDF viewer directly into my view hierarchy. Here is my basic code:
    this.pdfView = PDFLayoutView(this.fragment.activity, null)
    val pdfDocument = Document()
    val path = this.directory + this.name + " - " + this.id + "." + this.format
    val error = pdfDocument.Open(path, null)
    if (error == 0) {
        Global.g_view_mode = 0
        this.pdfView.PDFOpen(pdfDocument, this)
    }
    this.contentView.addView(this.pdfView)

Has anyone seen this behavior and know what to do about it?

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Powered by Kunena Forum