You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-dev@xmlgraphics.apache.org by Alberto Carrascal <al...@gmail.com> on 2013/01/31 09:50:44 UTC
PDF pagination
Hi all,
I'm trying to export pdf reports by converting original SVG documents. This
is the code I'm using to do it:
public static void renderReport(Document document, File file) throws
IOException, TranscoderException,
TransformerException {
OutputStream outputStream = new FileOutputStream(file);
try {
TransformerFactory transformerFactory = TransformerFact
ory.newInstance();
Transformer transformer = transformerFactory.newTransformer();
transformer.setOutputProperty(OutputKeys.INDENT, "yes");
transformer.setOutputProperty("{
http://xml.apache.org/xslt}indent-amount", "4");
DOMSource domSource = new DOMSource(document);
StreamResult streamResult = new StreamResult(System.out);
transformer.transform(domSource, streamResult);
TranscoderInput transcoderInput = new TranscoderInput(document);
TranscoderOutput transcoderOutput = new TranscoderOutpu
t(outputStream);
Transcoder transcoder = new PDFTranscoder();
transcoder.transcode(transcoderInput, transcoderOutput);
outputStream.flush();
} finally {
outputStream.close();
}
}
The question is: is there any supported batik feature to paginate final pdf
reports?
Thanks