MBS DynaPDF: PDF ViewerWith Links examples Not working

The PDF displays fine but where their are links one can see red text in a small font slight slightly below the text with the link details, and vertical red lines streaking down the page… (I’m using an old Xojo Documentation PDF to test that has links in it) A

Besides that clicking on them does nothing (but as one is clicking on picture, I’m not sure how that was supposed to work with this code!) so I am not sure what the point of that demo is.

BTW In both PDFViewer examples the thumbnails for each page are drawn as strips in separate listbox rows (I think 5 rows for each page!). What is the reason for that?

It introduces some anomalies (like being able to drag select individual rows inside the thumbnail on the mac and on windows showing a focus ring around an individual row)

I changed the code to use only one row for thumbnails it is SEEMS to work OK, but I wonder if your example did it that way to work around another issue I have not come across it yet.

-Karen

I can check the example in the next days. We made it long ago and it used to work back then.

The multiple rows per preview in the listbox is to better handle different PDF page heights with a kind of variable row height. You can skip that feature.

On links example, if it matters I’m using Xojo 2019R1.1 0 on Mac 10.14.6

I know all about doing that…and I thought that might have been why it was done that way but I wanted to be sure.

While the implementation is different, that is the idea behind my MergableCell Listbox class. Thee I worked out some of the visual issues of doing that you demo does not address. (selecting any row in a merged area making all those merged cells Display as selected etc)

For his case I’m displaying portrait documents with occasional landscape pages so using the same row height and width for all thumbnails is not a big issue.

The speed in showing the thumbnails looks to be at least an order of magnitude shower than with Preview on the mac so I’m thinking that I should not show thumbnails unless the PDF is maybe less than 30ish pages.

It would be nice to be able to do navigation within a Displayed PDFs through Table Of contents or internal links (Index), but that does not look viable with this approach of displaying the PDFs as pictures…

Ideally the way to do this would not be via DynaPDF, but being able to modify browse type code (open source implementations exist such as PDF.js that can run in the HTMLViewer) to control if the ability to Print or Save the PDF is available, that ay features like TOCs, clickable links (internal and external), thumbnails etc… would just be there.

THAT would have been the perfect solution for my needs…

But as I do not know JavaScript or HTML, that was not a realistic option for me… For small documents this solution sort of “works” but is far from optimal.

-Karen

One other question about the Demo. In the RenderPage method:

dim w as integer = mr.Width
dim h as integer = abs(mr.Bottom-mr.top)

w = W * 2
h = h * 2

pic = pdf.RenderPagePicture(n, w, h, pdf.kpsFitBest)

I suspect that is an old demo from before the Xojo Hi-DPI support…

So why multiply by 2? Should that be multiply by Scalefactor*2?

Or am I totally off base on teh reason?

I think on Non retina Displays when NOT multiplying by 2 the results looks a little washed out… On retina maybe a little too, though less, if one only multiplies by Scalefactor and not Scalefactor*2… But the resizing slows down too much (this is on an i9 Mac… I worry about windows!)

-Karen

The 2x is here probably to zoom in a bit and also helps with retina.
But if you render always with 4x, you quadruple the size of the picture.

Doing this quick is a challenge and so I look forward for Jens to do this with a control implementation.

PS: On macOS you could use PDFViewControlMBS for this.