Pdf.js: When rendering pdfs using SVGs, SVG:Path error is shown

Created on 20 Nov 2017  路  8Comments  路  Source: mozilla/pdf.js

  • PDF.JS version = 2.0.120

Steps to reproduce the problem:

  1. Render PDF from base64 encoded string to svg

What went wrong?
I receive a JavaScript error when rendering as svg.
image

4-svg

All 8 comments

Without the code to reproduce this issue, there is not much we can do. Please provide the code with this particular base64 encoded string because it looks like the PDF itself is doing something unexpected.

Unfortunaly from this snippet it's really hard to see what's going on. Could you publish a working example on (for example) JSBin? In particular, we need the actual base64 encoded string that causes the error, since it's likely that the problem is actually in the data itself.

@tanner-irons please remove your base64 comments, and then build and publish complete example online. I don't think any contributor will look at this issue.

Here is a js fiddle: https://jsfiddle.net/tannerirons/sogubk74/17/
If you look at the console, you will see the svg:path errors.

For easier (local) debugging, this appears to be the PDF file in question: http://www.pdf995.com/samples/pdf.pdf

I can only reproduce the SVG errors in Chrome, in Firefox Nightly there's only the unimplemented feature warnings printed in the console.

The pages will eventually render but there is a noticeable browser freeze plus the console errors.
The pdfs that we use are much larger so the lag is much more noticeable. Unfortunately they contain medical info so I added this pdf995 sample pdf for the fiddle. The errors are the same.

Thank you for providing more information to make the issue actionable! I cannot reproduce it in Firefox 57 either, so aside from the performance it looks like it's Chrome-specific.

I find that there is a noticeable delay when rendering in the 4 big browsers (Chrome, Firefox, IE, Safari). All of the browsers except for Firefox show some variation of the svg:path parsing error. There is still, however, a lag in Firefox.
I've also tried running the pdf in the default pdf.js viewer and get the same errors so I don't believe that it's specific to my code.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sujit-baniya picture sujit-baniya  路  3Comments

hp011235 picture hp011235  路  4Comments

zerr0s picture zerr0s  路  3Comments

SehyunPark picture SehyunPark  路  3Comments

timvandermeij picture timvandermeij  路  4Comments