Hi,
I need help.
I must hide the PdfViewer toolbar and add custom wisej button in a form, that call some function for example ZoomIn ZoomOut Page….
how I can call this function from a Wisej button?
best
Cristian
Hello Alex,
Please download the updated sample from https://drive.google.com/file/d/1WmKb3j3XDMFxyZ0zAJZ0Idx5X_93ioEu/view?usp=drive_link
Look at the new Web.config file and make sure you clear the browser cache before running the sample!
Best regards,
Alaa
Hi Cristian,
In addition to my previous answer, I have attached a sample that replicates your goal.
You’ll find a “hidden” toolbar, see viewer.css at the end of the file level.
And the functionality to zoom in and out of the document using Wisej.NET’s buttons.
Unfortunately, due to the size limit here, you’ll have to add the missing pieces of the Pdf.js source code into the sample.
HTH,
Alaa
Hi Alaa, sorry for the late answer, the days around 15Aug are a truly dead period in our part of the globe…
It works correctly now, thanks for the updated sample.
Alex
Thank you,
all solved 🙂
Hi guys,
I’m trying to access the PDFViewerApplication object myself, and I came across this thread. I downloaded Alaa’s example application from 2022, and tried to upgrade it to the latest pdfjs version (4.5.136). When the application starts, I get an error 404.3 for two .mjs files not found (viewer.mjs and pdf.mjs). In your version back in 2022 there weren’t any .mjs files, the equivalent were .js.
I added handlers for .mjs static files in my web.config, and then I get the errors:
Failed to load module script: Expected a Javascript module script but the server responded with a MIME type of “application/octet-stream”. Strict MIME type checking is enforced for module scripts per HTML spec.
Any suggestions would be greatly appreciated.
Best,
Alex
Hi Alaa,
thank you your code works perfectly, I have see page++ and page– too!!!
I understand how you find ‘PDFViewerApplication.zoomIn’ but I don’t understand how do you have find this
‘this.__objectEl.__element.contentWindow‘ I’d like to understand.
best
Cristian Zerbinati
Hi Cristian,
You’ll need to use the Eval(“some_script_or_function_name”) or Call(“function_name”) to execute or call JavaScript functions from within Wisej.NET.
For more info, please check out this link here: Wisej.NET Documentation | Application – JavaScript
HTH,
Alaa
Hi Frank,
ViewerType Mozzilla on Firefox browser
I have download the source of pdfjs-2.6.347 and in the pdfviewer I have insert the path of the viewer in “ViewerURL” property.
It works, but I need to call function from wisej
best
Hi Cristian,
which PDFViewerType/Browser are you using?
Best regards
Frank
Please login first to submit.