You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by Apache Wiki <wi...@apache.org> on 2006/03/21 16:12:52 UTC
[Xmlgraphics-fop Wiki] Update of "ApiDesign" by JeremiasMaerki
Dear Wiki user,
You have subscribed to a wiki page or wiki category on "Xmlgraphics-fop Wiki" for change notification.
The following page has been changed by JeremiasMaerki:
http://wiki.apache.org/xmlgraphics-fop/ApiDesign
The comment on the change is:
Reflect recent changes
------------------------------------------------------------------------------
FOUserAgent userAgent = fopFactory.newFOUserAgent();
userAgent.setTitle("My document");
- // Construct fop with desired output format
- Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, userAgent);
-
// Setup output
OutputStream out = new java.io.FileOutputStream(pdffile);
out = new java.io.BufferedOutputStream(out);
+ try {
- try {
- fop.setOutputStream(out);
+ // Construct fop with desired output format
+ Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, userAgent, out);
// Setup XSLT
TransformerFactory factory = TransformerFactory.newInstance();
@@ -116, +114 @@
// Start XSLT transformation and FOP processing
transformer.transform(src, res);
+
+ FormattingResults results = fop.getResults();
+ System.out.println("Generated " + results.getPageCount() + " pages.");
} finally {
out.close();
}
- FormattingResults results = fop.getResults();
- System.out.println("Generated " + results.getPageCount() + " pages.");
}}}
= Open Items =
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org