PDFView display problems with scanned PDFs

I’m using the MacOSLib PDFView control to display PDFs. There is an issue that seems to occur only when large scanned PDFs are displayed – as one scrolls, the upper and/or lower margin contracts and is replaced by white space. I’ve had dozens of users report this issue, and it occurs on both Mavericks and Yosemite. No such problems occur with other apps that use PDF Kit (e.g. Preview). Is there some configuration option I’m missing, or is this a bug in using PDF Kit with Xojo?

This problem can also be seen in HTMLViewers. Bug report filed and updated.


[quote=177050:@Jonathan Ashwell]This problem can also be seen in HTMLViewers. Bug report filed and updated.


You might want to ask them to make the feedback report public since it affects released versions. Right now you need to be a beta tester to see it.

  • Karen

I did ask them to make it unrestricted (you’d see that if you could read it :slight_smile: ). Hopefully they will now. There is a simple project and PDF with which to reproduce the problem.

Have to say that opening the PDFs in all the examples in an HTML Viewer doesn’t show any issue here when using 2015r1 on 10.9.5

I’m at page 71 of the second german pdf and they look the same to me

I saw this previously in 10.9.x, but I’m on 10.10.2 now. This is what I see with 2015R1. Note the white bar at the bottom – that changes as you scroll, and if you enlarge the window can flip from being below the image to above the image. For some pdfs I’ve had sent to me it’s much worse and makes the pdf unusable.

Here’s another image

AFAICT, this happens with PDFs that have been scanned.

Ah, the reason you’re not seeing this is that for whatever reason the HTMLViewer’s height is greater than the window height in the example (I must have inadvertently dragged it before saving and uploading!). Please make the HTMLViewer the same height as the window and you’ll see the cut off image. I’ll upload the fixed project to the bug report.

Actually I’m trying to see if it has anything to do with different browser plugins that can handle PDF’s
That’s the only thing I can think of that might also be in play

If it’s helpful, I’d point out that I see this PDF rendering problems with direct calls to PDFView using MacOSLib, too (and when I investigated originally, with MBS plugins).

Hmm created a new VM running 10.8
No acrobat plugins
No issue

On to trying a new 10.9 VM

Since I can’t reproduce it using the really simple example all I can suspect is that your calls or MacOSLib are doing something incorrect

Normal, did you adjust the HTMLViewer height as I wrote above? Or download the new example I just uploaded?

Adjusted the HTMLViewer to fill the window and locked it to all 4 sides
On a perfectly clean 10.8 I do not see the issue
I’m installing a clean 10.9
Will check 10.10.2 and 10.10.3 en the 10.9 install is done

My current system I believe is not a good test bed for this as I do have acrobat reader installed & it IS handling PDF’s in the HTMLViewer

Yes, if Adobe PDFs for you then I imagine that you won’t see the rendering problem. The Adobe pdf plugin because plays havoc with a number of advanced PDF manipulation features in our shipping app, so I never have it installed.

My 10.8 VM does not have it installed and I do not see an issue there
Once my clean 10.9 is up I’ll see what happens there
And I do have 10.10.2 and 10.10.3 bootable drives without it installed

So I do see this on a clean 10.9
Almost looks like the the view is being moved as its scrolled
I doubt we do much beyond embedding the web view so I’m not sure what else might be causing this

I can only guess, but this seems to be a problem when using a PDFView to display large scanned PDFs (whether in an HTMLViewer or when made with MBS plugins or MacOSLib declares) in a Xojo window.

The fact that its consistent across 3 disparate implementations is suspect

I’ve discovered two new aspects to this problem (but no solution):

  1. Scanning is irrelevant, it’s the size of the PDF that matters.
  2. The drawing artifacts do NOT occur when the PDF is set to display with Actual Size. It’s when autoscale is enabled, or you zoom in or out, that the problem occurs.

Does #2 ring any bells for anyone? Any suggestions appreciated.

I had a look at the project accompanying <https://xojo.com/issue/32354>.

In Window1.Open, you use PageLoad. That may explain the issue.

As very specifically explained here Page Not Found — Xojo documentation this is to load HTML SOURCE in the viewer, which certainly a PDF file is not (it is a PostScript source, possibly encrypted). Besides, you forgot the RelativeTo as FolderItem parameter.

When I modify that as below it loads perfectly the pdf placed next to the project :

dim f as FolderItem = GetFolderItem("").child("Smith1 2010.pdf") HTMLViewer1.loadURL(f.URLPath)