Servoy PDF Viewer

Forum to discuss the new web client version of Servoy.

Servoy PDF Viewer

Postby huber » Tue Nov 28, 2023 3:39 pm

Exploring the usefulness and possibilities of the Servoy PDF Viewer Component for our NG application, we implemented a first trial to preview Jasper Reports. Displaying the report works fine.

1) Now it would be nice to hide a shown pane on the left side of the window containing a vertical control (slider for pages?, doesn't seem to do anything).

2) Also I would like to control the buttons. In the Servoy API docs I find methods like getToolbarControlIds or setToolbarControlsVisibility, but how to apply them? They do not appear on the pdf_Js_Viewer component.

3) Further, I would like to control the printing header and footer in the code. Currently, I can do it in the print dialog, but would prefer them to set to uncheck when printing.

Any hints are appreciated.

Regards

Servoy 2022.6.0.3782
Robert Huber
7r AG, Switzerland
SAN Developer
http://www.seven-r.ch
User avatar
huber
 
Posts: 518
Joined: Mon May 14, 2012 11:31 pm

Re: Servoy PDF Viewer

Postby dcamargo » Tue Nov 28, 2023 6:58 pm

Hi Robert,

1) Currently, it's not possible to hide/show the pages panel, just the toolbar button, so if the button is hidden it won't be possible to show the panel.
The panel itself is useful if the PDF you are displaying has meta info but I think the pages are always generated by the pdf.js library
I guess you can request the feature to hide/show the entire panel

2) The individual buttons can be controlled once you display a PDF, not before, I am not sure if that's by design, you can only hide the entire toolbar when no PDF is displayed
Code: Select all
elements.pdfViewer.getToolbarControlIds()
should return an array of element names so you can do:
Code: Select all
elements.pdfViewer.setToolbarControlsVisibility(['openFile'], false)
to hide the specific button

3) When you print a PDF (using the print toolbar button) there should not be any header and footer like when you print a web page (print button from the browser)

I hope this helps
Danny Camargo
Servoy & Web Developer
dcamargo
 
Posts: 13
Joined: Tue Aug 23, 2016 8:59 pm

Re: Servoy PDF Viewer

Postby huber » Tue Nov 28, 2023 8:52 pm

Hi Danny

Thanks for your fast answer, and help.

1) Thanks, in our case, the slider oder whatever it is, is not functional, it's stuck at the bottom and shows 0, regardless of the number of pages the report is showing.

2) I tried what you suggest, the standard way of accessing methods, but after
Code: Select all
elements.pdfViewer
there is no method getToolbar.ControllIds available. I assume it's not working in Servoy 2022.06? Obviously in your version it is working, which I assume is the latest?

3) When the user just prints (by pressing the printer button using the default settings), on the output (paper) print it shows the header and footer, unless I actively uncheck them. But as we don't know what settings are set at customers site and at an individual printer, it would be very helpful to uncheck header and footer programmatically to avoid having a wasted print.

Best regards,
Robert Huber
7r AG, Switzerland
SAN Developer
http://www.seven-r.ch
User avatar
huber
 
Posts: 518
Joined: Mon May 14, 2012 11:31 pm

Re: Servoy PDF Viewer

Postby dcamargo » Tue Nov 28, 2023 9:20 pm

I don't know how backward-compatible it is, I tested v2023.09, maybe that's why it doesn't work for you
Danny Camargo
Servoy & Web Developer
dcamargo
 
Posts: 13
Joined: Tue Aug 23, 2016 8:59 pm


Return to Servoy NGClient

Who is online

Users browsing this forum: No registered users and 15 guests

cron