Comments (3)
There should be such a way. jpeg and tiff embedding is supported as a high level method in hummus, but svg is not. however, it should be possible to either embed a PDF version of that SVG acquired by other means than hummus, or translate it directly (as is how the implementation of JPG and TIFF images does).
I looked a little bit and came up with some links that might prove useful to you:
generics:
- http://stackoverflow.com/questions/3360641/how-to-insert-a-svg-file-in-a-pdf-document
- http://stackoverflow.com/questions/5835795/generating-pdfs-from-svg-input?rq=1
This one here:
https://github.com/ahwolf/jsPDF/blob/master/jspdf.plugin.svgToPdf.js
shows an interesting approach which translates the SVG to underlying library commands. This is possible with hummus as well, as hummus provides access to vector based graphic operators of PDF. You can focus on features that you think are more common in SVG files that you will receive and do something similar. if you choose this approach you will need to become a little familiar with PDF drawing operators. start with this link to learn about methods of adding such content to PDF:
https://github.com/galkahana/PDF-Writer/wiki/Adding-Content-to-PDF-Pages
from pdf-writer.
Thanks for your feedback.
The approaches and links you provided are useful. Need to investigate a bit more to decide which approach that will be faster to implement.
from pdf-writer.
Any improvement on this?
from pdf-writer.
Related Issues (20)
- How to draw Bezier curves using PDF-Witer library? HOT 2
- Parse a screenplay into scene objects? HOT 2
- color emojis HOT 16
- Links are removed when documents are merged HOT 8
- Color inversion problem occurs when exporting images HOT 1
- infinite loop HOT 2
- Crash when WriteUsedFontsDefinitions HOT 17
- Publish to github releases without PDFWriterTesting HOT 4
- U3D support, 10 years later HOT 10
- `Segmentation fault (core dumped)` just for adding `PDFWriter pdfWriter` in the `h` file HOT 11
- Fail to draw rectangle to pdf,if rectangle larger than(595x842) HOT 2
- german umlaute diacritic not rendered properly HOT 2
- Make a PDF with an image in memory HOT 4
- Double hex encoding in AbstractContentContext::TJHexLow HOT 3
- Perfectly kosher bug :) HOT 13
- bug: Stack overflow with Invalid PageTree HOT 1
- bug: Stack Overflow when loop in ParseNewObject -> ParseExistingInDirectStreamObject HOT 1
- bug: Requested Allocation Size too big HOT 2
- bug: Heap Use-after-free HOT 1
- bug: Allocation size too big when /Count is high 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 pdf-writer.