Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need single page mode #495

Closed
nbaua opened this issue Oct 7, 2020 · 7 comments
Closed

Need single page mode #495

nbaua opened this issue Oct 7, 2020 · 7 comments
Assignees
Labels
enhancement New feature or request Solved

Comments

@nbaua
Copy link

nbaua commented Oct 7, 2020

Problem Area:

We want to implement a page by page view mode for PDF files which is essential for us for reviewing blueprints of construction projects on browser.
We tried with Horizontal scroll mode which still does not fit the requirement exactly.

Why: Because the blueprint documents are not A4 or consistent standard sizes and we prefer the classic click page navigation buttons. Also we prefer scrolling within the page, when zoomed at higher values and read tech-details on those PDF pages.

In nutshell we want a single page loaded in viewport and be able to navigate through the standard prev-next buttons.

Seen the docs, [scrollMode]="1" can not be applied via HTML markup.
The scrollModeOnLoad also can not be applied via any atrributes.

Feature Request:
[PageViewMode]="Single" ---> Single | Multiple

We believe. This will be helpful in other scenarios too.

Regards,
N Baua

@stephanrauh
Copy link
Owner

Seems to be the same request as #476.

@stephanrauh stephanrauh self-assigned this Oct 7, 2020
stephanrauh added a commit that referenced this issue Oct 7, 2020
stephanrauh added a commit to stephanrauh/extended-pdf-viewer-showcase that referenced this issue Oct 7, 2020
@stephanrauh
Copy link
Owner

OK, you also seem to need to hide every page except the active page. Let's generalize it to three options:

[PageViewMode]= "Single | DoublePage | Multiple" `

@stephanrauh
Copy link
Owner

Plus, you need to suppress page-changes when the user scrolls. That's slightly similar to #492. So that'd be two new attributes:

[pageChangeOnScrolling]="true | false"
[showScrollbar]="true | false"

@stephanrauh stephanrauh added the enhancement New feature or request label Oct 7, 2020
@stephanrauh
Copy link
Owner

I've started to implement the single-page mode. The current results don't look bad, but it still requires some work. It's not easy to implement such a change to pdf.js.

@stephanrauh stephanrauh added the Working on it I've started to work on this ticket. More often than not, that means the feature is delivered soon. label Oct 14, 2020
stephanrauh added a commit to stephanrauh/pdf.js that referenced this issue Oct 15, 2020
stephanrauh added a commit to stephanrauh/pdf.js that referenced this issue Oct 15, 2020
stephanrauh added a commit to stephanrauh/pdf.js that referenced this issue Oct 16, 2020
stephanrauh added a commit to stephanrauh/extended-pdf-viewer-showcase that referenced this issue Oct 16, 2020
stephanrauh added a commit that referenced this issue Oct 16, 2020
stephanrauh added a commit that referenced this issue Oct 16, 2020
stephanrauh added a commit to stephanrauh/pdf.js that referenced this issue Oct 17, 2020
stephanrauh added a commit to stephanrauh/pdf.js that referenced this issue Oct 17, 2020
…clicking on the TOC with pageMode=`single`
stephanrauh added a commit to stephanrauh/pdf.js that referenced this issue Oct 17, 2020
…clicking on the TOC with pageMode=`single`
stephanrauh added a commit to stephanrauh/extended-pdf-viewer-showcase that referenced this issue Oct 17, 2020
@stephanrauh
Copy link
Owner

@nbaua pageViewMode="single" has landed with version 5.1.0. There's a live demo at https://pdfviewer.net/page-view-mode.

Enjoy!
Stephan

@stephanrauh stephanrauh added Solved and removed Working on it I've started to work on this ticket. More often than not, that means the feature is delivered soon. labels Oct 18, 2020
@nbaua
Copy link
Author

nbaua commented Oct 18, 2020

@stephanrauh ,

I can not thank you enough, my apologies could not revert back earlier due to my crashed laptop.
This is what I was after, I did tried to implement on my own, however I must admit, it was kind of a patch, your code is way far better. Thanks again for all your time and effort spent on this.

Regards,
N Baua

@stephanrauh
Copy link
Owner

Your welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Solved
Projects
None yet
Development

No branches or pull requests

2 participants