question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issues rendering pdf as SVG

See original GitHub issue

Configuration:

  • 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:

  1. Implement SVG rendering using PDFJS.SVGGraphics
  2. 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:closed
  • Created 7 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
ldenouecommented, Nov 6, 2016

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?

0reactions
shklyarikcommented, Dec 2, 2016

@yurydelendik, you right, I tried add opacity = 0 for canvas before render and set opacity = 1 after render, and I feel the work faster.

Read more comments on GitHub >

github_iconTop Results From Across the Web

SVG Render issue in Word (Office 365)
I've been having issues with SVG images rendering incorrectly in PDF exports from Word. I've tried changing quality settings when exporting ...
Read more >
PDF to SVG rendering issues using PDFBox and Apache ...
I am using a combination of PDFBox with Apache Batik in order to render PDF pages as SVG documents. Most of them work...
Read more >
Render SVG images using vector primitives in PDF format
In R3 2020 SP1 the rendering of the SVG images in PDF is done using native PDF graphical primitives rather than rendering to...
Read more >
Resolve issues with scanned PDF previews
Resolve issues with scanned PDF previews. ... In some organizations, SVG file previews of scanned PDFs are not rendering completely or at full...
Read more >
BUG in SVG rendering
Hi, I have the same issue when generating PDF. 0.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found