Fit to page when continuous presentation is on

Product: PDFNetDotNet4

Product Version: 9.4.28.734

Please give a brief summary of your issue:
Fit to page when continuous presentation is on

Please describe your issue and provide steps to reproduce it:
We have a WPF app that allows users to view PDF documents, using either the single page or continuous page flow. When continuous page flow is on, and the user tries to either “fit width” or “fit page” while viewing certain documents, neither page view mode works. We’re finding this happening specifically on documents with a lot of pages.

Please provide a link to a minimal sample where the issue is reproducible:
I can replicate this using the included PDFViewWPFSimpleTest sample code. I have a couple of PDF documents I can submit if needed, though they are pretty large in file size.

If the issue is file specific, can you please provide an example PDF?

neither page view mode works.

And what do you mean exactly by this? Please provide screenshots clearly showing what you get, and what you expected to get.

Note that if a PDF file contains pages of very different widths, then in Continuous mode fit width will match the widest page in the entire PDF file, which might make other, narrower pages, very small.

appraisals - Copy.pdf (3.0 MB)

I’ve attached one of the documents. If you load it in the PDFViewWPFSimpleTest sample, ensure the continuous page flow is on, then click either the “fit width” or “fit page” buttons while focused on page 1 of this document, you’ll see that neither button has any effect on the zoom. Is it because some of the pages within the document are landscape, and some portrait? If so, is there a workaround for this? Ideally we would like the flow and view of the document to similar to how Adobe Acrobat can handle this, where it can be both continuous flow but also fit width, or fit to page.

Is it because some of the pages within the document are landscape, and some portrait?

Correct, the Fit to Width is matching the widest page of the document since you are in continuous scroll mode.

If so, is there a workaround for this?

Yes, since all of the UI/UX code is provided you could make this change.

Note, that after a brief look at Adobe Reader behaviour, it appears to be delay loading the page dimensions. In particular I observer the following.

  1. Open the PDF and select continuous page mode
  2. Go to Fit Width.
  3. Page 1 takes up entire width.
  4. Scroll down to page 8.
  5. As soon as page 8 comes into view the zoom changes and page 7 no longer is full width, instead page 8 is full width.
  6. Scroll back up to page 1.
  7. Select Fit Page and then select Fit Width
  8. Page 1 no longer takes up the whole width. Adobe is now accounting for Page 8.

So from my observation, once the reader scrolls to page 8 or higher in Adobe Reader the behaviour is identical to PDFViewWPF viewer logic.