Issues rendering pdf as SVG
See original GitHub issueConfiguration:
- Web browser and its version: Google Chrome 49.0.2623.110 (64-bit) (but really all browsers)
- Operating system and its version: OSX 10.10.5
- PDF.js version: 1.5.188
- Is an extension: no
Steps to reproduce the problem:
- Implement SVG rendering using PDFJS.SVGGraphics
- Preview complex pdf with gradients and shading
What is the expected behavior? (add screenshot)
We are using PDF.js as part of our product to render a lot of pdf white papers. Some of these PDF documents are quite complex with a lot of graphs and visual elements. After updating PDF.js to version 1.5.188, I tried to implement SVG rendering in an attempt to solve some of the performance issues we are facing with canvas rendering. However, in most cases our white papers do not display properly when using SVG rendering. Similar issues occur when trying to print a pdf rendered with SVG.
What went wrong? (add screenshot)
I get a lot of warnings about unimplemented methods in the console:
Warning: Unimplemented method shadingFill
Warning: Unimplemented method endGroup
Warning: Unimplemented method dependency
Warning: Unimplemented method setTextRise
Warning: Unimplemented method setTextRenderingMode
Warning: Unimplemented method beginGroup
I also get errors related to negative height values:
Error: Invalid negative value for <svg:rect> attribute height="-452.541"
We were hoping to be able to move towards the SVG implementation but unfortunately it seems like a lot of features are not yet implemented and therefore this approach is not production-ready.
When can we expect the SVG rendering to be fully implemented ?
Best Regards, Stephane
Issue Analytics
- State:
- Created 7 years ago
- Comments:9 (3 by maintainers)
Top GitHub Comments
SVG would still be great to have even on mobile for retina displays. Canvas rendering is really bad on retina but SVG looks great at any resolution. Seriously, nobody wants an SVG renderer?
@yurydelendik, you right, I tried add opacity = 0 for canvas before render and set opacity = 1 after render, and I feel the work faster.