Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
60
rated 0 times [  67] [ 7]  / answers: 1 / hits: 18339  / 9 Years ago, mon, july 27, 2015, 12:00:00

i would like to use pdf.js in my webApplication and customize it's view, so i can embedd it into the rest of my application (i was thinking about using an iframe).



At first i would like to get rid of most of the default toolbar-buttons like print or download file but keep the zoom and page navigation.
Instead, i want these features (print/download) to appear inside my application's toolbar.
How to do that? How can i hide the print/download buttons from the pdf.js toolbar and call this features with my custom buttons which are rendered inside my webapplication already?



Or should i use another library other than pdf.js?



Any information are very helpful!!


More From » ajax

 Answers
2

Ok, i found how to do it.
To hide a button simply add the CSS class hidden to it like toolbarButton download hiddenMediumView hidden.
To download the file, just call PDFViewerApplication.download();. To print it, use window.print().



All the handlers are listet in the view.js file. Just search for // Event handling functions.. In my version it's on line 1840.



I guess that's the simplest way. Of cours buttons could be removed completely from the DOM but that would mean to also alter the view.js file.


[#65656] Friday, July 24, 2015, 9 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
julieth

Total Points: 382
Total Questions: 99
Total Answers: 85

Location: Cape Verde
Member since Fri, Nov 27, 2020
4 Years ago
;