Comments (4)
The problem is something else. I don't believe the curly braces are a problem. At least they do work in my stripped down test:
The problems are:
There is a bug in your SVG for the path syntax. It's invalid and it seems svg2pdf is less lenient than the browser, here:
You may not have a comma after the MoveTo command, so instead of d="M 0 0,L 1 1"
you need to have d="M 0 0 L 1 1"
. There is no comma allowed between the draw commands: Spec
The other problem is that your font size is given in percentage units. Svg2pdf does not understand this (a percentage of what?). Change your SVG to use absolute font sizes and it will work as in my example.
from svg2pdf.js.
The issue is caused by the curly braces in the HTML comments. I think this is a valid bug, as everything between <!--
and -->
should just be ignored.
Also, note that in the codepen the same SVG is included twice, probably by accident.
from svg2pdf.js.
The issue is caused by the curly braces in the HTML comments. I think this is a valid bug, as everything between
<!--
and-->
should just be ignored.
Removed all html comments https://codepen.io/robixxu/pen/MWGJmzq but i get the same result
Also, note that in the codepen the same SVG is included twice, probably by accident.
Yes, fixed.
from svg2pdf.js.
The problem is something else. I don't believe the curly braces are a problem. At least they do work in my stripped down test:
The problems are: There is a bug in your SVG for the path syntax. It's invalid and it seems svg2pdf is less lenient than the browser, here:
You may not have a comma after the MoveTo command, so instead of
d="M 0 0,L 1 1"
you need to haved="M 0 0 L 1 1"
. There is no comma allowed between the draw commands: SpecThe other problem is that your font size is given in percentage units. Svg2pdf does not understand this (a percentage of what?). Change your SVG to use absolute font sizes and it will work as in my example.
Thank you! I appreciate it.
Have a great day/night!
from svg2pdf.js.
Related Issues (20)
- Source map points to nonexisting `src/` folder in `npm` package HOT 1
- The transform-origin attribute of svg is rendered into pdf, which is not visible HOT 1
- TypeError: t.toFixed is not a function HOT 6
- Acrobat Always Asks to Save Changes to "unmodified" File on Close of PDF HOT 5
- Underline and shadow of text not converted to pdf
- stroke-width="inherit" breaks in jsPDF HOT 2
- Force stroke='none' if 'stroke-width' === 0 HOT 3
- Support for XML HOT 1
- SVG is upscaled in the pdf-file HOT 3
- When font-size declared in rem, text is missing in the exported file. HOT 4
- Artifacts at letter s of font Aleo after conversion - but font Aleo itself has no such issue in jspdf HOT 5
- Latest master doesn't build HOT 1
- Excess clipping of nested SVG HOT 8
- Marker clipping HOT 2
- Error: Invalid argument passed to jsPDF.scale Error HOT 4
- Black background added to paths HOT 8
- Chinese is not supported HOT 2
- The exported PDF is not rendering custom fonts on some of the PDF text objects. HOT 8
- How to concatenate multiple SVG files? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from svg2pdf.js.