I'm using spire.pdf 5.1.0 library.
I'm trying to add SVG to a PDF as a new layer.
First, I'm converting SVG to PDF. At this time, styles in SVG seem to be ignored.
Is there a way to apply SVG styles? Or can I add SVG as a new layer to a PDF in another way?
OS: Windows 10 Pro 21H2
JDK: OpenJDK 1.8.0
SVG and PDF:
I attached SVG and PDF files.
pom.xml:
- Code: Select all
<dependency>
<groupId>e-iceblue</groupId>
<artifactId>spire.pdf</artifactId>
<version>5.1.0</version>
</dependency>
code:
- Code: Select all
PdfDocument svg = new PdfDocument();
svg.loadFromSvg(srcSvgPath);
svg.saveToFile(dstPath, FileFormat.PDF);
Thank you