Comments (3)
The text is rendered with the font the moment the SVG is painted into the PDF. Depending on what font strategy you choose the font is subset and embedded into the PDF (the default) or drawn using vector shapes. For details look here.
So, yes you need the font while creating the PDF. This is a somewhat hard requirement, as the font is needed to get all the text geometric information.
PDFs don't understand SVGs, so the SVG must be translated into the corresponding PDF commands/resources. How are you using this library? Directly using this library in combination with Batik or indirect using OpenHTMLtoPDF? This library does not render SVG itself, it just provides a Graphics2D adapter to allow in combination with Batik to render a SVG into a PDF.
from pdfbox-graphics2d.
Thanks for your quick reply!
Yes, I am using it directly in combination with Batik, I had hoped the SVG would simply refer to a font that may or not may be installed on the target machine, but it seems that is not the case.
Thanks again!
from pdfbox-graphics2d.
If you want to save space in the PDF you can use PdfBoxGraphics2DFontTextDrawerDefaultFonts - this replaces the fonts with the default builtin PDF fonts.
from pdfbox-graphics2d.
Related Issues (20)
- fontRenderingContext is not good for vector drawing HOT 2
- Adding jaxb-api in the pom of extended-tests HOT 6
- Adding test scope to outer dependencies in the pom of extended-tests HOT 1
- PdfBoxGraphics2DFontTextDrawer.getFontMetrics always floors the width HOT 3
- stop-opacity on linearGradient stops are not rendered HOT 3
- Document how to reuse / share images inside a document across different Graphics2D
- Correctly support embedding the same image with different KEY_INTERPOLATION values. HOT 1
- mapColor parameters in RGBtoCMYKColorMapper HOT 1
- What is a good way to handle "Page N of M" drawing? HOT 2
- TestPPTXRendering.testPPTXRendering failing with libapache-poi-java from Debian 12 HOT 2
- RadialGradientPaint incorrect focal point location and transition direction HOT 1
- drawIssue with incorrect argument HOT 1
- drawRect does not properly close rectangle HOT 2
- String rotation HOT 3
- Exception in RadialGradientPaint HOT 4
- System.err in PdfBoxGraphics2DFontTextDrawer HOT 8
- Draw Attributed text only supports Font, while Family/Weight/Posture is an alternate way. HOT 4
- add pdfbox 3.0.0 support HOT 3
- InternalDeprecatedCOSCloner causing JPMS module issues HOT 3
- Reuse PDFCloneUtilities.
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 pdfbox-graphics2d.