Hi,
Attachments don't come through. Please upload them to a sharehoster.
Tilman
Am 30.07.2020 um 07:28 schrieb 槻木正臣:
To Whom It May Concern
I am using apache batik 1.9 and apache pdfbox 2.0.20 to convert PDF to
SVG.
When I set 150 in PDFPageable, unnecessary lines are displayed.
Is there a way around it?
PDF file
pdf.png
SVG file
svg.png
Source code
-----
PDDocument pddocument = null;
Writer out = null;
try {
pddocument = PDDocument.load(new File(loadfile));
PDFPageable document = new PDFPageable(pddocument,
Orientation.AUTO, false, 150);
DOMImplementation domImpl =
GenericDOMImplementation.getDOMImplementation();
String svgNS = "http://www.w3.org/2000/svg";
org.w3c.dom.Document svgDocument = domImpl.createDocument(svgNS,
"svg", null);
SVGGeneratorContext ctx =
SVGGeneratorContext.createDefault(svgDocument);
ctx.setEmbeddedFontsOn(true);
SVGGraphics2D svgGenerator = new SVGGraphics2D(ctx, false);
Printable printTbl = document.getPrintable(page);
printTbl.print(svgGenerator, document.getPageFormat(page), page);
out = new OutputStreamWriter(new FileOutputStream(new
File(savefile)), "UTF-8");
svgGenerator.stream(out);
svgGenerator.dispose();
} finally {
if (out != null){
out.close();
}
if(pddocument != null){
pddocument.close();
}
}
-----
I look forward to hearing from you.
━━━━━━━━━━━━━━━━━━━━━━━
応用技術株式会社
槻木 正臣(Tsukigi Masaomi)
〒530-0015
大阪市北区中崎西2丁目4番12号 梅田センタービル 10階
Tel:(06)6373-6101 Fax:(06)6373-6100
E-mail : ma-tsuk...@apptec.co.jp <mailto:ma-tsuk...@apptec.co.jp>
━━━━━━━━━━━━━━━━━━━━━━━
【秘密保持のお願い】このメールには機密情報や個人情報が含まれている可能性がございます。誤ってこのメールを受信された場合は、お手数ですがシステム上から削除いただき、送信者または管理者(priv...@apptec.co.jp
<mailto:priv...@apptec.co.jp>)に御連絡頂ますようお願い申し上げます。
Confidentiality Note: This email may contain confidential
and/or private information. If you received this email in error
please delete and notify to sender or
adminstrator(priv...@apptec.co.jp <mailto:priv...@apptec.co.jp>).