Loading a local PDF file in WebViewer

Trying to load a local PDF file in PDF.JS or any other PDF file for that matter. Any work around available?

Use FolderItem1.Open(True) where FolderItem1 is a reference to the pdf. It will run the default application to read pdf and load that pdf.

think twice before using PDF.js as viewer. I’ve kicked it from all my projects cause it sometimes doesn’t display xerox scans with signatures on it, or any handwritten remarks in PDFs from ipads or surface devices or complex construction site plans with lots of layers.

on websites I only offer a download option (using wkhtml2pdf)
if you’re local use the standard application handler for pdf files

Why not load the PDF in the webviewer and let the browser’s PDF plugin display it?

or use our MBS Xojo DynaPDF Plugin to render page and show JPEG of the page?

[quote=476559:@Christian Schmitz]Why not load the PDF in the webviewer and let the browser’s PDF plugin display it?
[/quote]

Perhaps because Firefox, Edge or Chrome use PDF.js? In most cases this might be adequate, but in some cases esp. when dealing with different origins of PDFs, all in different PDF-formats, you may enter stormy waters with PDF.js

You see the gray shadow in the outer window? This is PDF.js displaying a PDF but missing a layer.
The inner window shows macOS Preview App with the layer shown correctly.

In business this is deadly, if you send cour customers PDFs wih signatures or comments or modified contract position, which are not visible.

There are some PDFs that can’t be displayed correctly with MacOS Preview that display correctly with Adobe and other viewers. In this case, I don’t think a Download only option will help if the user only has Preview as the viewer.

True, but your consequences are wrong then. Let always your customer decide what viewer to use. the use case is important. if you are the one, who is generating the pdfs, then pdf.js could be fine. But if you are dealing with pdfs from different sources in a DMS (document management system), then it might fail.

I need to do the following:

  1. Load PDF file into a viewer(native or HTML)
  2. Navigate to particular page
  3. know which page is being displayed if user scrolls
  4. show multiple keyword hit highlighting

Anything out there do that in XOJO?

How are you trying to load the file ?

Could you post your code ?

BTW, it would be nice if you switched the channel to Web, instead of Gettin Started, so people who search for similar topics can find it.