Ability to rotate individual pages of document via the NgxExtendedPdfViewerService #2629
Replies: 2 comments 1 reply
-
Good question. In my eyes, this feature is too exotic to put it into the general library, but I support telling people how to do it. The difference is that when you're using a low-level API, you know you're doing it at your own risk (at least I hope so). However, the minimum requirement would be that everything works. Rotating the page should
I've got a solution for the first point: to re-render the page, do this: const pageView = this.PDFViewerApplication.pdfViewer.getPageView(5); // Replace 5 with your page index
pageView.rotation = (pageView.rotation + 90 ) % 360; // put your desired angle here
(pageView as any).update(pageView.scale, pageView.rotation); // force re-rendering I might implement the feature in |
Beta Was this translation helpful? Give feedback.
-
I'm happy to help contribute, I think part 2 can be easily achieved by updating the custom thumbnail template but I will get to that after I have managed to resolve the following issue: I'm just working through the first part of that solution still and seem to have run into an issue where if the rotation is 90,180 or 270 (not 0), then the page contents appear blank when rotated. There is also a noticeable lag/latency issue with the browser tab. It's quite odd. Do you have any suggestions on why this could be? PS: Worth noting if I trigger the re-render by altering the zoom level from 100% to 101% for example the rotation is fine and renders as expected without any latency issues in the browser. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Firstly I've really enjoyed using ngx-extended-pdf-viewer. I think its an excellent tool. One thing I have been struggling to do is rotating individual pages in the document and then reflecting those changes.
Currently I am able to rotate an individual page by updating the rotation value in PDFPageView for the specific page, however i then need to trigger a different zoom level in order to see the changes.
Are there plans to have a feature allowing specific page rotations instead of just the whole document?
Beta Was this translation helpful? Give feedback.
All reactions