[
https://issues.apache.org/jira/browse/BATIK-1357?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17728375#comment-17728375
]
Dave Roxburgh commented on BATIK-1357:
--------------------------------------
Hi Srikant,
I'm no expert in SVG but I believe the switch child chosen will depend on your
environment. In my testing, the <foreignObject> was being selected and Batik
did not output the text. When I bypassed the <foreignObject> child (by, for
example, adding a duplicate <text> child before the <foreignObject> child) the
text was output perfectly. So, as a work-around, if you replace the <switch>
construct with the <text> child alone (or something similar), you should find
your labels are output.
Regards,
Dave
> Labels are missing in PDF when SVG is converted to PDF using PDFTranscoder
> --------------------------------------------------------------------------
>
> Key: BATIK-1357
> URL: https://issues.apache.org/jira/browse/BATIK-1357
> Project: Batik
> Issue Type: Bug
> Affects Versions: 1.10
> Reporter: Srikant Das
> Priority: Major
> Attachments: test.svg
>
>
> I was converting an SVG File into PDF using Apache Batik but labels are
> missing in the PDF
> The following code is used to generate PDF:
> {code:java}
> import org.apache.batik.transcoder.TranscoderInput;
> import org.apache.batik.transcoder.TranscoderOutput;
> ...
> File svgFile = new File("./target/test.svg");
> ...
> PDFTranscoder transcoder = new PDFTranscoder();
> try (FileInputStream fileInputStream = new FileInputStream(svgFile);
> FileOutputStream fileOutputStream = new FileOutputStream(new
> File("./target/test-batik.pdf"))) {
> TranscoderInput transcoderInput = new TranscoderInput(fileInputStream);
> TranscoderOutput transcoderOutput = new
> TranscoderOutput(fileOutputStream);
> transcoder.transcode(transcoderInput, transcoderOutput);
> }
> {code}
> {code:java}
> //dependency
> <dependency>
> <groupId>org.apache.xmlgraphics</groupId>
> <artifactId>batik-transcoder</artifactId>
> <version>1.10</version>
> </dependency>
> {code}
> Could you please help me to resolve this issue?
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]