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.

Path element cannot be exported to PDF

See original GitHub issue

Currently, only line, rect, ellipse, circle, text elements can be exported to pdf. see jspdf.plugin.svgToPdf.js.

Any <path> element in the svg document cannot be exported to pdf.

The following svg document will be exported as an empty pdf. 2 path elements are ignored.

<svg width="640" height="480" xmlns="http://www.w3.org/2000/svg">
  <path d="m100,229c191,97 173,-94 379,45" fill="#FF0000" stroke="#000000" stroke-width="5"/>
  <path d="m223,101a114,62 0 1 0 219,2" fill="#FF0000" stroke="#000000" stroke-width="5"/>
</svg>

image

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:11 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
cuixipingcommented, Jan 16, 2020

My fix now supports all path commands except arc commands(A,a) to be exported to pdf.

1reaction
cuixipingcommented, Aug 17, 2018

jsPDF supports bezier curves. But jspdf.plugin.svgToPdf.js (from CBiX/svgToPdf.js) does not support path element.

Maybe svgedit should use alafr/SVG-to-PDFKit which has much more features:

  • shapes: rect, circle, path, ellipse, line, polyline, polygon
  • special elements: use, nested svg
  • text elements: text, tspan, textPath
  • text attributes: x, y, dx, dy, rotate, text-anchor, textLength, word-spacing, letter-spacing, font-size
  • styling: with attributes only
  • colors: fill, stroke & color (rgb, rgba, hex, string), fill-opacity, stroke-opacity & opacity
  • units: all standard units
  • transformations: transform, viewBox & preserveAspectRatio attributes
  • clip paths & masks
  • images
  • fonts
  • gradients
  • patterns
  • links
Read more comments on GitHub >

github_iconTop Results From Across the Web

"path cannot be empty" error when exporting report to PDF ...
In TIBCO Jaspersoft® Studio, navigate to the Source tab and search for any invalid entries relating to pdfFontName attribute. which is causing ...
Read more >
File format options for PDF export - Adobe Support
When you export PDFs to different file formats using the Export PDF tool in Acrobat, each file format includes unique conversion settings.
Read more >
Id CC 2020 pdf export failure - Adobe InDesign
Id CC 2020 pdf export failure. I get an error "Failed to Export the PDF file" when exporting file previously created in Id...
Read more >
KB39142: Image defined with absolute path on network do not ...
When a user attempts to export a document to PDF from MicroStrategy Web that contains an image with an absolute path on a...
Read more >
LyX: "Directory path to the document cannot contain spaces ...
For several years I've been able to export to PDF using pdflatex regardless of whether or not there was spaces in the directory...
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