New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SVG path is incorrectly broken into 2 nodes #10522
Comments
This may be related to bug #9167. |
I think the culprit is here: pdf.js/src/core/operator_list.js Lines 533 to 534 in a045a00
I'm not very familiar with the workings of OperatorList but it looks like operator lists are split into chunks of about 1000 operators. Sometimes the chunk boundary is placed in the middle of a PDF path definition. This produces two OPS.constructPath operators and the latter one doesn't start with a moveTo .
Does this sound plausible? Instead of modifying |
Correct; this is to allow rendering to begin before the entire
Yes, and it should be easy to verify (just increase the value a lot, effectively disabling this chunking).
Agreed, modifying the constant is definitely not an acceptable solution. First of all, it would do nothing more than move the error elsewhere. Second of all, and much more importantly, changing it could have far-reaching implications for the general rendering performance in the canvas back-end.
Again, that sounds totally reasonable. |
I can confirm that if I increase CHUNK_SIZE to 10000000 then the problem goes away. |
Attach (recommended) or Link to PDF file here:
test4.pdf
Configuration:
Steps to reproduce the problem:
What is the expected behavior? (add screenshot)
No errors.
What went wrong? (add screenshot)
One path in the output got split into 2 parts.
The initial "M" is in one node and the following "L" is in the next node.
These should be in the same node.
Link to a viewer (if hosted on a site other than mozilla.github.io/pdf.js or as Firefox/Chrome extension):
The text was updated successfully, but these errors were encountered: