foray-commit Mailing List for FOray (Page 277)
Modular XSL-FO Implementation for Java.
Status: Alpha
Brought to you by:
victormote
You can subscribe to this list here.
| 2006 |
Jan
|
Feb
|
Mar
(139) |
Apr
(98) |
May
(250) |
Jun
(394) |
Jul
(84) |
Aug
(13) |
Sep
(420) |
Oct
(186) |
Nov
(1) |
Dec
(3) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2007 |
Jan
(108) |
Feb
(202) |
Mar
(291) |
Apr
(247) |
May
(374) |
Jun
(227) |
Jul
(231) |
Aug
(60) |
Sep
(31) |
Oct
(45) |
Nov
(18) |
Dec
|
| 2008 |
Jan
(38) |
Feb
(71) |
Mar
(142) |
Apr
|
May
(59) |
Jun
(6) |
Jul
(10) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2009 |
Jan
(12) |
Feb
(4) |
Mar
(88) |
Apr
(121) |
May
(17) |
Jun
(30) |
Jul
|
Aug
(5) |
Sep
|
Oct
(1) |
Nov
|
Dec
|
| 2010 |
Jan
(11) |
Feb
(76) |
Mar
(11) |
Apr
|
May
(11) |
Jun
|
Jul
|
Aug
(44) |
Sep
(14) |
Oct
(7) |
Nov
|
Dec
|
| 2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(9) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(10) |
Nov
|
Dec
|
| 2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(3) |
Jul
(4) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(168) |
| 2017 |
Jan
(77) |
Feb
(11) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2018 |
Jan
|
Feb
|
Mar
(1) |
Apr
(6) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2019 |
Jan
|
Feb
(88) |
Mar
(118) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(6) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(141) |
| 2021 |
Jan
(170) |
Feb
(20) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
(62) |
Nov
(189) |
Dec
(162) |
| 2022 |
Jan
(201) |
Feb
(118) |
Mar
(8) |
Apr
|
May
(2) |
Jun
(47) |
Jul
(19) |
Aug
(14) |
Sep
(3) |
Oct
|
Nov
(28) |
Dec
(235) |
| 2023 |
Jan
(112) |
Feb
(23) |
Mar
(2) |
Apr
(2) |
May
|
Jun
(1) |
Jul
|
Aug
(70) |
Sep
(92) |
Oct
(20) |
Nov
(1) |
Dec
(1) |
| 2024 |
Jan
|
Feb
|
Mar
(1) |
Apr
(1) |
May
(14) |
Jun
(11) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2025 |
Jan
(10) |
Feb
(29) |
Mar
|
Apr
(162) |
May
(245) |
Jun
(83) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <vic...@us...> - 2006-03-15 01:21:22
|
Revision: 6960 Author: victormote Date: 2006-03-14 17:20:55 -0800 (Tue, 14 Mar 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=6960&view=rev Log Message: ----------- Remove need for PDFDocument to have its own FontConsumer. Modified Paths: -------------- trunk/foray/foray-pdf/src/java/org/foray/pdf/FOrayPDFFactory.java trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFDocument.java trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFDocumentGraphics2D.java trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFGraphics2D.java trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFTranscoder.java Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/FOrayPDFFactory.java =================================================================== --- trunk/foray/foray-pdf/src/java/org/foray/pdf/FOrayPDFFactory.java 2006-03-15 01:12:27 UTC (rev 6959) +++ trunk/foray/foray-pdf/src/java/org/foray/pdf/FOrayPDFFactory.java 2006-03-15 01:20:55 UTC (rev 6960) @@ -55,8 +55,7 @@ } public PDFDocument createPDFDocument() { - return new org.foray.pdf.object.PDFDocument(this.fontConsumer, - this.logger); + return new org.foray.pdf.object.PDFDocument(this.logger); } private org.foray.pdf.object.PDFDocument getFOrayPDFDocument( Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFDocument.java =================================================================== --- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFDocument.java 2006-03-15 01:12:27 UTC (rev 6959) +++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFDocument.java 2006-03-15 01:20:55 UTC (rev 6960) @@ -35,7 +35,6 @@ import org.foray.pdf.PDFGraphicsState; import org.axsl.font.Font; -import org.axsl.font.FontConsumer; import org.axsl.font.FontUse; import org.axsl.pdf.PDFException; import org.axsl.ps.Encoding; @@ -159,8 +158,6 @@ */ private List filters = new ArrayList(); - private FontConsumer fontConsumer; - /** * Stores the next available tag to be used in a subset font's BaseFont or * FontName entry. @@ -192,8 +189,7 @@ * updated later. This allows Pages to refer to their * Parent before we write it out. */ - public PDFDocument(FontConsumer fontConsumer, Log logger) { - this.fontConsumer = fontConsumer; + public PDFDocument(Log logger) { this.logger = logger; // Create the Root object @@ -528,10 +524,6 @@ return defaultBorderStyle; } - public FontConsumer getFontConsumer() { - return this.fontConsumer; - } - public PDFGraphicsState getCurrentGraphicsState() { return this.currentGraphicsState; } Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFDocumentGraphics2D.java =================================================================== --- trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFDocumentGraphics2D.java 2006-03-15 01:12:27 UTC (rev 6959) +++ trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFDocumentGraphics2D.java 2006-03-15 01:20:55 UTC (rev 6960) @@ -31,6 +31,7 @@ import org.foray.pdf.object.PDFPage; import org.foray.pdf.object.PDFResources; +import org.axsl.font.FontConsumer; import org.axsl.font.FontException; import org.axsl.pdf.PDFException; @@ -73,7 +74,8 @@ * @param height the height of the document */ public PDFDocumentGraphics2D(boolean textAsShapes, OutputStream stream, - int width, int height, String appName) throws PDFException { + int width, int height, String appName, FontConsumer fontConsumer) + throws PDFException { super(textAsShapes); /* @@ -88,7 +90,7 @@ */ if (!textAsShapes) { try { - this.font = this.pdfDoc.getFontConsumer().selectFontXSL( + this.font = fontConsumer.selectFontXSL( new String[] {"Helvetica"}, org.axsl.font.Font.FONT_STYLE_NORMAL, org.axsl.font.Font.FONT_WEIGHT_NORMAL, @@ -100,8 +102,7 @@ } standalone = true; this.stream = stream; - this.pdfDoc = new PDFDocument(this.pdfDoc.getFontConsumer(), - getLogger()); + this.pdfDoc = new PDFDocument(getLogger()); this.pdfDoc.getInfo().setProducer(appName + " SVG Renderer"); this.width = width; this.height = height; Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFGraphics2D.java =================================================================== --- trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFGraphics2D.java 2006-03-15 01:12:27 UTC (rev 6959) +++ trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFGraphics2D.java 2006-03-15 01:20:55 UTC (rev 6960) @@ -866,7 +866,7 @@ fontWeight = org.axsl.font.Font.FONT_WEIGHT_BOLD; } try { - FontConsumer fontConsumer = pdfDoc.getFontConsumer(); + FontConsumer fontConsumer = this.currentFont.getFontConsumer(); return fontConsumer.selectFontXSL( FontUtility.foFontFamily(fontFamily), fontStyle, fontWeight, Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFTranscoder.java =================================================================== --- trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFTranscoder.java 2006-03-15 01:12:27 UTC (rev 6959) +++ trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFTranscoder.java 2006-03-15 01:20:55 UTC (rev 6960) @@ -243,7 +243,8 @@ PDFDocumentGraphics2D graphics; try { graphics = new PDFDocumentGraphics2D(stroke, - output.getOutputStream(), w, h, this.appName); + output.getOutputStream(), w, h, this.appName, + this.font.getFontConsumer()); } catch (PDFException ex) { throw new TranscoderException(ex); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-03-15 01:12:44
|
Revision: 6959 Author: victormote Date: 2006-03-14 17:12:27 -0800 (Tue, 14 Mar 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=6959&view=rev Log Message: ----------- Simplify constructor by using FontConsumer embedded in the FontUse itself. Modified Paths: -------------- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFContentStream.java trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFTextPainter.java trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFTranscoder.java Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFContentStream.java =================================================================== --- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFContentStream.java 2006-03-15 00:42:14 UTC (rev 6958) +++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFContentStream.java 2006-03-15 01:12:27 UTC (rev 6959) @@ -344,8 +344,7 @@ if (strokeSVGText) { textPainter = new StrokingTextPainter(); } else { - textPainter = new PDFTextPainter(getLogger(), - this.getPDFDocument().getFontConsumer(), font, letterSpacing); + textPainter = new PDFTextPainter(getLogger(), font, letterSpacing); } ctx.setTextPainter(textPainter); Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFTextPainter.java =================================================================== --- trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFTextPainter.java 2006-03-15 00:42:14 UTC (rev 6958) +++ trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFTextPainter.java 2006-03-15 01:12:27 UTC (rev 6959) @@ -25,7 +25,6 @@ package org.foray.pdf.svg.batik; import org.axsl.font.Font; -import org.axsl.font.FontConsumer; import org.axsl.font.FontException; import org.axsl.font.FontUtility; @@ -59,7 +58,6 @@ */ public class PDFTextPainter implements TextPainter { Log logger; - FontConsumer fontConsumer = null; org.axsl.font.FontUse nominalFont = null; float letterSpacing = 0; org.axsl.font.FontUse fontToUse = null; @@ -73,10 +71,9 @@ StrokingTextPainter.getInstance(); - public PDFTextPainter(Log logger, FontConsumer consumer, - org.axsl.font.FontUse font, float letterSpacing) { + public PDFTextPainter(Log logger, org.axsl.font.FontUse font, + float letterSpacing) { this.logger = logger; - this.fontConsumer = consumer; this.nominalFont = font; this.letterSpacing = letterSpacing; } @@ -279,7 +276,7 @@ for (Iterator i = gvtFonts.iterator(); i.hasNext(); ) { GVTFontFamily fam = (GVTFontFamily)i.next(); this.fontFamily = fam.getFamilyName(); - font = fontConsumer.selectFontCSS( + font = this.nominalFont.getFontConsumer().selectFontCSS( FontUtility.foFontFamily(this.fontFamily), style, weight, 0, org.axsl.font.Font.FONT_STRETCH_NORMAL, fsize * 1000, @@ -295,7 +292,7 @@ } if (font == null) { this.fontFamily = "any"; - return fontConsumer.selectFontXSL( + return this.nominalFont.getFontConsumer().selectFontXSL( new String[] {"any"}, style, weight, 0, org.axsl.font.Font.FONT_STRETCH_NORMAL, fsize * 1000, ' '); Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFTranscoder.java =================================================================== --- trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFTranscoder.java 2006-03-15 00:42:14 UTC (rev 6958) +++ trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFTranscoder.java 2006-03-15 01:12:27 UTC (rev 6959) @@ -250,8 +250,7 @@ graphics.setSVGDimension(docWidth, docHeight); currentTransform.setTransform(1, 0, 0, -1, 0, height); if (!stroke) { - textPainter = new PDFTextPainter(graphics.getLogger(), - graphics.pdfDoc.getFontConsumer(), this.font, + textPainter = new PDFTextPainter(graphics.getLogger(), this.font, this.fontSize); ctx.setTextPainter(textPainter); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-03-15 00:42:28
|
Revision: 6958 Author: victormote Date: 2006-03-14 16:42:14 -0800 (Tue, 14 Mar 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=6958&view=rev Log Message: ----------- Make the method makeOutputTarget from FOrayTarget to FOrayDocument, and make it non-static. This gives us more flexibility in bootstrapping the Renderers. Modified Paths: -------------- trunk/foray/foray-app/src/java/org/foray/app/CommandLineStarter.java trunk/foray/foray-app/src/java/org/foray/app/FOrayDocument.java trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java trunk/foray/foray-app/src/java/org/foray/app/ant/FOray.java trunk/foray/foray-app/src/java/org/foray/app/test/TestConverter.java trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoFO2PDF.java trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoObj2PDF.java trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoXML2PDF.java trunk/foray/foray-app/src/java/org/foray/demo/servlet/AbstractDemoServlet.java trunk/foray/foray-app/src/java/org/foray/demo/servlet/DemoServlet.java Modified: trunk/foray/foray-app/src/java/org/foray/app/CommandLineStarter.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/CommandLineStarter.java 2006-03-15 00:27:00 UTC (rev 6957) +++ trunk/foray/foray-app/src/java/org/foray/app/CommandLineStarter.java 2006-03-15 00:42:14 UTC (rev 6958) @@ -112,7 +112,7 @@ */ int outputType = commandLineOptions.getOutputType(); OutputConfig outputOptions = this.outputConfig; - OutputTarget outputTarget = FOrayTarget.makeOutputTarget(outputType, + OutputTarget outputTarget = document.makeOutputTarget(outputType, outputOptions); /* Modified: trunk/foray/foray-app/src/java/org/foray/app/FOrayDocument.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/FOrayDocument.java 2006-03-15 00:27:00 UTC (rev 6957) +++ trunk/foray/foray-app/src/java/org/foray/app/FOrayDocument.java 2006-03-15 00:42:14 UTC (rev 6958) @@ -26,6 +26,16 @@ import org.foray.common.FOrayException; import org.foray.common.XMLParser; +import org.foray.output.MIFConverter; +import org.foray.output.OutputConfig; +import org.foray.output.OutputTarget; +import org.foray.render.awt.AWTRenderer; +import org.foray.render.pcl.PCLRenderer; +import org.foray.render.pdf.PDFRenderer; +import org.foray.render.ps.PSRenderer; +import org.foray.render.svg.SVGRenderer; +import org.foray.render.txt.TXTRenderer; +import org.foray.render.xml.XMLRenderer; import org.axsl.font.FontConsumer; import org.axsl.font.FontServer; @@ -403,4 +413,69 @@ return this.unsupportedProperties; } + /** + * Factory method that makes a new Renderer instance for the standard + * renderers. + * @param rendererType The integral id for the Renderer that should be + * used. Must be one of: + * <ul> + * <li>RENDER_PDF + * <li>RENDER_AWT + * <li>RENDER_MIF + * <li>RENDER_XML + * <li>RENDER_PCL + * <li>RENDER_PS + * <li>RENDER_TXT + * <li>RENDER_SVG + * </ul> + * @param outputOptions Map containing the options to be used with the + * Renderer. + */ + public OutputTarget makeOutputTarget(int rendererType, + OutputConfig outputOptions) throws FOrayException { + OutputTarget renderer = null; + switch (rendererType) { + case FOrayTarget.RENDER_AWT: { + renderer = new AWTRenderer(outputOptions); + break; + } + case FOrayTarget.RENDER_PRINT: { + throw new FOrayException("Print renderer cannot be instantiated " + + "from the standard method."); + } + case FOrayTarget.RENDER_PCL: { + renderer = new PCLRenderer(outputOptions); + break; + } + case FOrayTarget.RENDER_PS: { + renderer = new PSRenderer(outputOptions); + break; + } + case FOrayTarget.RENDER_TXT: { + renderer = new TXTRenderer(outputOptions); + break; + } + case FOrayTarget.RENDER_MIF: { + renderer = new MIFConverter(outputOptions); + break; + } + case FOrayTarget.RENDER_XML: { + renderer = new XMLRenderer(outputOptions); + break; + } + case FOrayTarget.RENDER_SVG: { + renderer = new SVGRenderer(outputOptions); + break; + } + default: { + renderer = new PDFRenderer(outputOptions); + break; + } + } + if (renderer == null) { + throw new FOrayException("Unable to create renderer."); + } + return renderer; + } + } Modified: trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java 2006-03-15 00:27:00 UTC (rev 6957) +++ trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java 2006-03-15 00:42:14 UTC (rev 6958) @@ -33,19 +33,10 @@ import org.foray.common.FOrayException; import org.foray.font.FOrayFontConsumer; import org.foray.font.FOrayFontServer; -import org.foray.output.MIFConverter; -import org.foray.output.OutputConfig; import org.foray.output.OutputControl; import org.foray.output.OutputTarget; import org.foray.pioneer.PioneerLS; import org.foray.render.Renderer; -import org.foray.render.awt.AWTRenderer; -import org.foray.render.pcl.PCLRenderer; -import org.foray.render.pdf.PDFRenderer; -import org.foray.render.ps.PSRenderer; -import org.foray.render.svg.SVGRenderer; -import org.foray.render.txt.TXTRenderer; -import org.foray.render.xml.XMLRenderer; import org.axsl.areaOut.PageArea; import org.axsl.font.FontConsumer; @@ -494,71 +485,6 @@ return this.outputStream; } - /** - * Factory method that makes a new Renderer instance for the standard - * renderers. - * @param rendererType The integral id for the Renderer that should be - * used. Must be one of: - * <ul> - * <li>RENDER_PDF - * <li>RENDER_AWT - * <li>RENDER_MIF - * <li>RENDER_XML - * <li>RENDER_PCL - * <li>RENDER_PS - * <li>RENDER_TXT - * <li>RENDER_SVG - * </ul> - * @param outputOptions Map containing the options to be used with the - * Renderer. - */ - public static OutputTarget makeOutputTarget(int rendererType, - OutputConfig outputOptions) throws FOrayException { - OutputTarget renderer = null; - switch (rendererType) { - case RENDER_AWT: { - renderer = new AWTRenderer(outputOptions); - break; - } - case RENDER_PRINT: { - throw new FOrayException("Print renderer cannot be instantiated " - + "from the standard method."); - } - case RENDER_PCL: { - renderer = new PCLRenderer(outputOptions); - break; - } - case RENDER_PS: { - renderer = new PSRenderer(outputOptions); - break; - } - case RENDER_TXT: { - renderer = new TXTRenderer(outputOptions); - break; - } - case RENDER_MIF: { - renderer = new MIFConverter(outputOptions); - break; - } - case RENDER_XML: { - renderer = new XMLRenderer(outputOptions); - break; - } - case RENDER_SVG: { - renderer = new SVGRenderer(outputOptions); - break; - } - default: { - renderer = new PDFRenderer(outputOptions); - break; - } - } - if (renderer == null) { - throw new FOrayException("Unable to create renderer."); - } - return renderer; - } - public OutputTarget getOutputTarget() { return this.outputTarget; } Modified: trunk/foray/foray-app/src/java/org/foray/app/ant/FOray.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/ant/FOray.java 2006-03-15 00:27:00 UTC (rev 6957) +++ trunk/foray/foray-app/src/java/org/foray/app/ant/FOray.java 2006-03-15 00:42:14 UTC (rev 6958) @@ -489,7 +489,7 @@ rendererOptions.parseOption("fineDetail", "true", SessionConfig.PRECEDENCE_DEFAULT); } - OutputTarget renderer = FOrayTarget.makeOutputTarget(rendererType, + OutputTarget renderer = document.makeOutputTarget(rendererType, rendererOptions); new FOrayTarget(document, renderer, null, out); Modified: trunk/foray/foray-app/src/java/org/foray/app/test/TestConverter.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/test/TestConverter.java 2006-03-15 00:27:00 UTC (rev 6957) +++ trunk/foray/foray-app/src/java/org/foray/app/test/TestConverter.java 2006-03-15 00:42:14 UTC (rev 6958) @@ -293,7 +293,7 @@ SessionConfig.PRECEDENCE_DEFAULT); renderOptions.parseOption("consistentOutput", "true", SessionConfig.PRECEDENCE_DEFAULT); - OutputTarget renderer = FOrayTarget.makeOutputTarget(rendererType, + OutputTarget renderer = document.makeOutputTarget(rendererType, renderOptions); new FOrayTarget(document, renderer, null, bos); Modified: trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoFO2PDF.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoFO2PDF.java 2006-03-15 00:27:00 UTC (rev 6957) +++ trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoFO2PDF.java 2006-03-15 00:42:14 UTC (rev 6958) @@ -58,7 +58,7 @@ inputHandler.getInputSource(), inputHandler.getParser()); //Setup Renderer - OutputTarget renderer = FOrayTarget.makeOutputTarget(FOrayTarget.RENDER_PDF, + OutputTarget renderer = document.makeOutputTarget(FOrayTarget.RENDER_PDF, null); //Setup FOrayTarget Modified: trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoObj2PDF.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoObj2PDF.java 2006-03-15 00:27:00 UTC (rev 6957) +++ trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoObj2PDF.java 2006-03-15 00:42:14 UTC (rev 6958) @@ -73,7 +73,7 @@ FOrayDocument document = new FOrayDocument(driver, transformer, source); //Setup Renderer - OutputTarget renderer = FOrayTarget.makeOutputTarget(FOrayTarget.RENDER_PDF, + OutputTarget renderer = document.makeOutputTarget(FOrayTarget.RENDER_PDF, null); //Setup FOrayTarget Modified: trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoXML2PDF.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoXML2PDF.java 2006-03-15 00:27:00 UTC (rev 6957) +++ trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoXML2PDF.java 2006-03-15 00:42:14 UTC (rev 6958) @@ -71,7 +71,7 @@ FOrayDocument document = new FOrayDocument(driver, transformer, source); //Setup Renderer - OutputTarget renderer = FOrayTarget.makeOutputTarget(FOrayTarget.RENDER_PDF, + OutputTarget renderer = document.makeOutputTarget(FOrayTarget.RENDER_PDF, null); //Setup FOrayTarget Modified: trunk/foray/foray-app/src/java/org/foray/demo/servlet/AbstractDemoServlet.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/demo/servlet/AbstractDemoServlet.java 2006-03-15 00:27:00 UTC (rev 6957) +++ trunk/foray/foray-app/src/java/org/foray/demo/servlet/AbstractDemoServlet.java 2006-03-15 00:42:14 UTC (rev 6958) @@ -160,7 +160,7 @@ FOrayDocument document = setupSAXDocument(session, inputHandler); // Setup the Renderer - OutputTarget renderer = FOrayTarget.makeOutputTarget(FOrayTarget.RENDER_PDF, + OutputTarget renderer = document.makeOutputTarget(FOrayTarget.RENDER_PDF, null); // Setup FOrayTarget @@ -203,7 +203,7 @@ source); // Setup the Renderer - OutputTarget renderer = FOrayTarget.makeOutputTarget(FOrayTarget.RENDER_PDF, + OutputTarget renderer = document.makeOutputTarget(FOrayTarget.RENDER_PDF, null); // Setup FOrayTarget Modified: trunk/foray/foray-app/src/java/org/foray/demo/servlet/DemoServlet.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/demo/servlet/DemoServlet.java 2006-03-15 00:27:00 UTC (rev 6957) +++ trunk/foray/foray-app/src/java/org/foray/demo/servlet/DemoServlet.java 2006-03-15 00:42:14 UTC (rev 6958) @@ -118,7 +118,7 @@ private FOrayTarget setupTarget(FOrayDocument document) throws FOrayException { // Setup the Renderer - OutputTarget renderer = FOrayTarget.makeOutputTarget(FOrayTarget.RENDER_PDF, + OutputTarget renderer = document.makeOutputTarget(FOrayTarget.RENDER_PDF, null); // Setup FOrayTarget ByteArrayOutputStream output = new ByteArrayOutputStream(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-03-15 00:27:12
|
Revision: 6957 Author: victormote Date: 2006-03-14 16:27:00 -0800 (Tue, 14 Mar 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=6957&view=rev Log Message: ----------- Conform to axsl changes. Use new methods. Modified Paths: -------------- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFDocument.java trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFDocument.java =================================================================== --- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFDocument.java 2006-03-15 00:15:35 UTC (rev 6956) +++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFDocument.java 2006-03-15 00:27:00 UTC (rev 6957) @@ -240,9 +240,9 @@ } /** - * Get the root Outlines object. + * {@inheritDoc} */ - public PDFOutline getOutlineRoot() { + public org.axsl.pdf.PDFOutlineParent getOutlineRoot() { return this.root.getOutlineRoot(); } @@ -559,12 +559,8 @@ return pdfEncoding; } - public PDFFont getPDFFont(FontUse fontUse) - throws PDFException { + public org.axsl.pdf.PDFFont getPDFFont(FontUse fontUse) { Font font = fontUse.getFont(); - if (! font.isEmbeddable() && ! font.isPDFStandardFont()) { - throw new PDFException("Font is not embeddable."); - } /* Look for a match in the existing fonts. */ for (int i = 0; i < this.usedFonts.size(); i++) { PDFFont pdfFont = (PDFFont) this.usedFonts.get(i); @@ -600,4 +596,11 @@ this.getRoot().getDestinations().add(destination); } + /** + * {@inheritDoc} + */ + public void resetGraphicsState() { + this.getCurrentGraphicsState().reset(); + } + } Modified: trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java =================================================================== --- trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2006-03-15 00:15:35 UTC (rev 6956) +++ trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2006-03-15 00:27:00 UTC (rev 6957) @@ -33,7 +33,6 @@ import org.foray.common.StringUtilPre5; import org.foray.output.OutputConfig; import org.foray.pdf.FOrayPDFFactory; -import org.foray.pdf.object.PDFDocument; import org.foray.render.PrintRenderer; import org.axsl.areaOut.Area; @@ -52,6 +51,7 @@ import org.axsl.graphic.Graphic; import org.axsl.pdf.PDFColor; import org.axsl.pdf.PDFContentStream; +import org.axsl.pdf.PDFDocument; import org.axsl.pdf.PDFEncryption; import org.axsl.pdf.PDFException; import org.axsl.pdf.PDFExplicitDestination; @@ -134,8 +134,7 @@ */ public void startOutput() throws IOException { this.pdfFactory = new FOrayPDFFactory(getFontConsumer(), getLogger()); -// this.pdfDoc = this.pdfFactory.createPDFDocument(); - this.pdfDoc = new PDFDocument(getFontConsumer(), getLogger()); + this.pdfDoc = this.pdfFactory.createPDFDocument(); String pdfVersion = this.options.optionPDFVersion(); if (pdfVersion != null) { int pdfVersionConstant = PDFUtility.integralVersion(pdfVersion); @@ -368,13 +367,7 @@ return; } PDFFont pdfFont; - try { - pdfFont = this.pdfDoc.getPDFFont(fontUse); - } catch (PDFException e) { - /* Log a message and bail out. */ - getLogger().error(e.getMessage()); - return; - } + pdfFont = this.pdfDoc.getPDFFont(fontUse); getContentStream().setFont(pdfFont, area.traitFontSize() / 1000); /* Paint the text. */ @@ -400,7 +393,7 @@ } catch (PDFException e) { /* Ignore this. It should never happen. */ } - this.getPDFDocument().getCurrentGraphicsState().reset(); + this.getPDFDocument().resetGraphicsState(); renderRegions(page); getContentStream().close(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-03-15 00:15:40
|
Revision: 6956 Author: victormote Date: 2006-03-14 16:15:35 -0800 (Tue, 14 Mar 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=6956&view=rev Log Message: ----------- Remove unneeded throws clause. Modified Paths: -------------- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFFont.java Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFFont.java =================================================================== --- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFFont.java 2006-03-15 00:07:56 UTC (rev 6955) +++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFFont.java 2006-03-15 00:15:35 UTC (rev 6956) @@ -27,7 +27,6 @@ import org.axsl.font.Font; import org.axsl.font.FontUse; import org.axsl.font.output.FontPDF; -import org.axsl.pdf.PDFException; import org.axsl.ps.Encoding; import org.axsl.ps.EncodingVector; @@ -112,8 +111,7 @@ * @param fsFont The FreeStandingFont to be added * @return the created /Font object */ - public static PDFFont makeFont(PDFDocument pdfDoc, FontUse fsFont) - throws PDFException { + public static PDFFont makeFont(PDFDocument pdfDoc, FontUse fsFont) { if (fsFont.getFont().isPDFStandardFont()) { PDFFont font = new PDFFont(pdfDoc, fsFont); return font; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-03-15 00:08:11
|
Revision: 6955 Author: victormote Date: 2006-03-14 16:07:56 -0800 (Tue, 14 Mar 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=6955&view=rev Log Message: ----------- Conform to axsl changes. Use new methods. Modified Paths: -------------- trunk/foray/foray-pdf/src/java/org/foray/pdf/FOrayPDFFactory.java trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFLink.java trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFPage.java trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFDocumentGraphics2D.java trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFGraphics2D.java trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/FOrayPDFFactory.java =================================================================== --- trunk/foray/foray-pdf/src/java/org/foray/pdf/FOrayPDFFactory.java 2006-03-14 23:12:31 UTC (rev 6954) +++ trunk/foray/foray-pdf/src/java/org/foray/pdf/FOrayPDFFactory.java 2006-03-15 00:07:56 UTC (rev 6955) @@ -24,6 +24,8 @@ package org.foray.pdf; +import org.foray.pdf.object.PDFResources; + import org.axsl.font.FontConsumer; import org.axsl.pdf.PDFColor; import org.axsl.pdf.PDFDocument; @@ -31,6 +33,7 @@ import org.axsl.pdf.PDFException; import org.axsl.pdf.PDFExplicitDestination; import org.axsl.pdf.PDFFactory; +import org.axsl.pdf.PDFLink; import org.axsl.pdf.PDFNamedDestination; import org.axsl.pdf.PDFOutlineItem; import org.axsl.pdf.PDFOutlineParent; @@ -39,6 +42,7 @@ import org.apache.commons.logging.Log; import java.awt.Color; +import java.awt.geom.Rectangle2D; public class FOrayPDFFactory implements PDFFactory { @@ -63,6 +67,14 @@ throw new PDFException("Unsupported PDFDocument implementation."); } + private org.foray.pdf.object.PDFPage getFOrayPDFPage( + PDFPage page) throws PDFException { + if (page instanceof org.foray.pdf.object.PDFPage) { + return (org.foray.pdf.object.PDFPage) page; + } + throw new PDFException("Unsupported PDFPage implementation."); + } + /** * {@inheritDoc} */ @@ -101,12 +113,7 @@ float yPosition) throws PDFException { org.foray.pdf.object.PDFDocument forayPDFDocument = getFOrayPDFDocument(document); - if (! (page instanceof org.foray.pdf.object.PDFPage)) { - throw new PDFException("Unsupported PDFPage " - + "implementation."); - } - org.foray.pdf.object.PDFPage forayPage - = (org.foray.pdf.object.PDFPage) page; + org.foray.pdf.object.PDFPage forayPage = getFOrayPDFPage(page); org.foray.pdf.object.PDFExplicitDestination destination = new org.foray.pdf.object.PDFExplicitDestination( forayPDFDocument, forayPage, xPosition, yPosition); @@ -135,8 +142,38 @@ return destination; } + /** + * {@inheritDoc} + */ public PDFColor createPDFColor(Color color) { return new org.foray.pdf.object.PDFColor(color); } + /** + * {@inheritDoc} + */ + public PDFPage createPDFPage(PDFDocument document, + int pagewidth, int pageheight) throws PDFException { + org.foray.pdf.object.PDFDocument forayPDFDocument + = getFOrayPDFDocument(document); + PDFResources resources = forayPDFDocument.getResources(); + org.foray.pdf.object.PDFPage page = new org.foray.pdf.object.PDFPage( + forayPDFDocument, resources, pagewidth, pageheight); + return page; + } + + /** + * {@inheritDoc} + */ + public PDFLink createPDFLink(PDFDocument document, PDFPage page, + Rectangle2D.Float linkRectangle, String destination) + throws PDFException { + org.foray.pdf.object.PDFDocument forayPDFDocument + = getFOrayPDFDocument(document); + org.foray.pdf.object.PDFPage forayPage = getFOrayPDFPage(page); + PDFLink link = new org.foray.pdf.object.PDFLink(forayPDFDocument, + forayPage, linkRectangle, destination); + return link; + } + } Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFLink.java =================================================================== --- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFLink.java 2006-03-14 23:12:31 UTC (rev 6954) +++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFLink.java 2006-03-15 00:07:56 UTC (rev 6955) @@ -29,7 +29,7 @@ /** * A PDF /Annot object of /Subtype /Link. */ -public class PDFLink extends PDFAnnotation { +public class PDFLink extends PDFAnnotation implements org.axsl.pdf.PDFLink { /** Should be null if either destination or action is not. */ PDFTextString destinationName; Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFPage.java =================================================================== --- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFPage.java 2006-03-14 23:12:31 UTC (rev 6954) +++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFPage.java 2006-03-15 00:07:56 UTC (rev 6955) @@ -149,15 +149,10 @@ } /** - * Create a PDFLink object and add it to this page. - * - * @param rect the clickable rectangle - * @param destination the destination file - * @param externalLink Set to true to create an external link. - * @return the PDFLink object created + * {@inheritDoc} */ - public PDFLink makeLink(Rectangle2D.Float rect, String destination, - boolean externalLink) { + public org.axsl.pdf.PDFLink makeLink(Rectangle2D.Float rect, + String destination, boolean externalLink) { PDFDocument pdfDoc = getPDFDocument(); PDFAction action; PDFLink link = null; @@ -189,7 +184,10 @@ return link; } - public PDFContentStream getContentStream() { + /** + * {@inheritDoc} + */ + public org.axsl.pdf.PDFContentStream getContentStream() { return this.contents; } Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFDocumentGraphics2D.java =================================================================== --- trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFDocumentGraphics2D.java 2006-03-14 23:12:31 UTC (rev 6954) +++ trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFDocumentGraphics2D.java 2006-03-15 00:07:56 UTC (rev 6955) @@ -25,6 +25,7 @@ package org.foray.pdf.svg.batik; import org.foray.pdf.object.PDFColor; +import org.foray.pdf.object.PDFContentStream; import org.foray.pdf.object.PDFDocument; import org.foray.pdf.object.PDFNumber; import org.foray.pdf.object.PDFPage; @@ -154,7 +155,9 @@ PDFResources pdfResources = this.pdfDoc.getResources(); PDFPage currentPage = new PDFPage(this.pdfDoc, pdfResources, width, height); - currentPage.getContentStream().add(getString()); + PDFContentStream contentStream = (PDFContentStream) + currentPage.getContentStream(); + contentStream.add(getString()); if(currentAnnotList != null) { currentPage.getAnnotList().addAnnotationList(currentAnnotList); } Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFGraphics2D.java =================================================================== --- trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFGraphics2D.java 2006-03-14 23:12:31 UTC (rev 6954) +++ trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFGraphics2D.java 2006-03-15 00:07:56 UTC (rev 6955) @@ -232,7 +232,7 @@ String pdfdest = "/XYZ " + dest; link = new PDFLink(pdfDoc, pdfPage, linkRectangle, pdfdest); } else { - link = pdfPage.makeLink(linkRectangle, dest, false); + link = (PDFLink) pdfPage.makeLink(linkRectangle, dest, false); } currentAnnotList.addAnnotation(link); } Modified: trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java =================================================================== --- trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2006-03-14 23:12:31 UTC (rev 6954) +++ trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2006-03-15 00:07:56 UTC (rev 6955) @@ -34,7 +34,6 @@ import org.foray.output.OutputConfig; import org.foray.pdf.FOrayPDFFactory; import org.foray.pdf.object.PDFDocument; -import org.foray.pdf.object.PDFPage; import org.foray.render.PrintRenderer; import org.axsl.areaOut.Area; @@ -60,6 +59,7 @@ import org.axsl.pdf.PDFFont; import org.axsl.pdf.PDFOutlineItem; import org.axsl.pdf.PDFOutlineParent; +import org.axsl.pdf.PDFPage; import org.axsl.pdf.PDFPathPaint; import org.axsl.pdf.PDFUtility; @@ -393,10 +393,13 @@ getLogger().debug("Rendering single page to PDF."); float w = page.getWidth(); float h = page.getHeight(); - currentPage = new PDFPage(this.pdfDoc, - this.getPDFDocument().getResources(), - Math.round(w / 1000), - Math.round(h / 1000)); + try { + currentPage = this.pdfFactory.createPDFPage(this.pdfDoc, + Math.round(w / 1000), + Math.round(h / 1000)); + } catch (PDFException e) { + /* Ignore this. It should never happen. */ + } this.getPDFDocument().getCurrentGraphicsState().reset(); renderRegions(page); getContentStream().close(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-03-14 23:12:35
|
Revision: 6954 Author: victormote Date: 2006-03-14 15:12:31 -0800 (Tue, 14 Mar 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=6954&view=rev Log Message: ----------- Remove another dependency on FOrayPDF. Modified Paths: -------------- trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java Modified: trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java =================================================================== --- trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2006-03-14 23:08:40 UTC (rev 6953) +++ trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2006-03-14 23:12:31 UTC (rev 6954) @@ -34,7 +34,6 @@ import org.foray.output.OutputConfig; import org.foray.pdf.FOrayPDFFactory; import org.foray.pdf.object.PDFDocument; -import org.foray.pdf.object.PDFFont; import org.foray.pdf.object.PDFPage; import org.foray.render.PrintRenderer; @@ -58,6 +57,7 @@ import org.axsl.pdf.PDFException; import org.axsl.pdf.PDFExplicitDestination; import org.axsl.pdf.PDFFactory; +import org.axsl.pdf.PDFFont; import org.axsl.pdf.PDFOutlineItem; import org.axsl.pdf.PDFOutlineParent; import org.axsl.pdf.PDFPathPaint; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-03-14 23:08:51
|
Revision: 6953 Author: victormote Date: 2006-03-14 15:08:40 -0800 (Tue, 14 Mar 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=6953&view=rev Log Message: ----------- Conform to axsl changes. Use new methods. Modified Paths: -------------- trunk/foray/foray-pdf/src/java/org/foray/pdf/FOrayPDFFactory.java trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/FOrayPDFFactory.java =================================================================== --- trunk/foray/foray-pdf/src/java/org/foray/pdf/FOrayPDFFactory.java 2006-03-14 22:57:21 UTC (rev 6952) +++ trunk/foray/foray-pdf/src/java/org/foray/pdf/FOrayPDFFactory.java 2006-03-14 23:08:40 UTC (rev 6953) @@ -25,6 +25,7 @@ package org.foray.pdf; import org.axsl.font.FontConsumer; +import org.axsl.pdf.PDFColor; import org.axsl.pdf.PDFDocument; import org.axsl.pdf.PDFEncryption; import org.axsl.pdf.PDFException; @@ -134,4 +135,8 @@ return destination; } + public PDFColor createPDFColor(Color color) { + return new org.foray.pdf.object.PDFColor(color); + } + } Modified: trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java =================================================================== --- trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2006-03-14 22:57:21 UTC (rev 6952) +++ trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2006-03-14 23:08:40 UTC (rev 6953) @@ -33,11 +33,9 @@ import org.foray.common.StringUtilPre5; import org.foray.output.OutputConfig; import org.foray.pdf.FOrayPDFFactory; -import org.foray.pdf.object.PDFColor; import org.foray.pdf.object.PDFDocument; import org.foray.pdf.object.PDFFont; import org.foray.pdf.object.PDFPage; -import org.foray.pdf.object.PDFPathPaint; import org.foray.render.PrintRenderer; import org.axsl.areaOut.Area; @@ -54,6 +52,7 @@ import org.axsl.common.Constants; import org.axsl.font.FontUse; import org.axsl.graphic.Graphic; +import org.axsl.pdf.PDFColor; import org.axsl.pdf.PDFContentStream; import org.axsl.pdf.PDFEncryption; import org.axsl.pdf.PDFException; @@ -61,6 +60,7 @@ import org.axsl.pdf.PDFFactory; import org.axsl.pdf.PDFOutlineItem; import org.axsl.pdf.PDFOutlineParent; +import org.axsl.pdf.PDFPathPaint; import org.axsl.pdf.PDFUtility; import java.awt.Color; @@ -182,7 +182,7 @@ */ protected void drawLine(int startX, int startY, int endX, int endY, int thickness, int ruleStyle, Color strokeColor) { - PDFColor pdfColor = new PDFColor(strokeColor); + PDFColor pdfColor = this.pdfFactory.createPDFColor(strokeColor); float[] dashPattern = null; switch (ruleStyle) { case Constants.FOVAL_DASHED: @@ -207,11 +207,11 @@ Color strokeColor, boolean fill, Color fillColor) { PDFPathPaint strokePaint = null; if (strokeColor != null) { - strokePaint = new PDFColor(strokeColor); + strokePaint = this.pdfFactory.createPDFColor(strokeColor); } PDFPathPaint fillPaint = null; if (fillColor != null) { - fillPaint = new PDFColor(fillColor); + fillPaint = this.pdfFactory.createPDFColor(fillColor); } Rectangle2D.Float rectangle = new Rectangle2D.Float(x / 1000f, y / 1000f, w / 1000f, h / 1000f); @@ -283,7 +283,7 @@ } /* Set the color. */ - PDFColor areaColor = new PDFColor(area.traitColor()); + PDFColor areaColor = this.pdfFactory.createPDFColor(area.traitColor()); getContentStream().setStrokeColor(areaColor); /* Set word-spacing and letter-spacing. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-03-14 22:57:32
|
Revision: 6952 Author: victormote Date: 2006-03-14 14:57:21 -0800 (Tue, 14 Mar 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=6952&view=rev Log Message: ----------- Conform to axsl changes. Use new interfaces and methods. Modified Paths: -------------- trunk/foray/foray-pdf/src/java/org/foray/pdf/FOrayPDFFactory.java trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/FOrayPDFFactory.java =================================================================== --- trunk/foray/foray-pdf/src/java/org/foray/pdf/FOrayPDFFactory.java 2006-03-14 21:15:37 UTC (rev 6951) +++ trunk/foray/foray-pdf/src/java/org/foray/pdf/FOrayPDFFactory.java 2006-03-14 22:57:21 UTC (rev 6952) @@ -28,9 +28,12 @@ import org.axsl.pdf.PDFDocument; import org.axsl.pdf.PDFEncryption; import org.axsl.pdf.PDFException; +import org.axsl.pdf.PDFExplicitDestination; import org.axsl.pdf.PDFFactory; +import org.axsl.pdf.PDFNamedDestination; import org.axsl.pdf.PDFOutlineItem; import org.axsl.pdf.PDFOutlineParent; +import org.axsl.pdf.PDFPage; import org.apache.commons.logging.Log; @@ -89,4 +92,46 @@ italic, bold); } + /** + * {@inheritDoc} + */ + public PDFExplicitDestination createPDFExplicitDestination( + PDFDocument document, PDFPage page, float xPosition, + float yPosition) throws PDFException { + org.foray.pdf.object.PDFDocument forayPDFDocument + = getFOrayPDFDocument(document); + if (! (page instanceof org.foray.pdf.object.PDFPage)) { + throw new PDFException("Unsupported PDFPage " + + "implementation."); + } + org.foray.pdf.object.PDFPage forayPage + = (org.foray.pdf.object.PDFPage) page; + org.foray.pdf.object.PDFExplicitDestination destination + = new org.foray.pdf.object.PDFExplicitDestination( + forayPDFDocument, forayPage, xPosition, yPosition); + forayPDFDocument.registerIndirectObjectLast(destination); + return destination; + } + + /** + * {@inheritDoc} + */ + public PDFNamedDestination createPDFNamedDestination( + PDFDocument document, String name, PDFExplicitDestination explicit) + throws PDFException { + org.foray.pdf.object.PDFDocument forayPDFDocument + = getFOrayPDFDocument(document); + if (! (explicit instanceof org.foray.pdf.object.PDFExplicitDestination)) { + throw new PDFException("Unsupported PDFExplicitDestination " + + "implementation."); + } + org.foray.pdf.object.PDFExplicitDestination forayExplicitDestination + = (org.foray.pdf.object.PDFExplicitDestination) explicit; + org.foray.pdf.object.PDFNamedDestination destination + = new org.foray.pdf.object.PDFNamedDestination( + forayPDFDocument, name, forayExplicitDestination); + forayPDFDocument.addNamedDestination(destination); + return destination; + } + } Modified: trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java =================================================================== --- trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2006-03-14 21:15:37 UTC (rev 6951) +++ trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2006-03-14 22:57:21 UTC (rev 6952) @@ -35,9 +35,7 @@ import org.foray.pdf.FOrayPDFFactory; import org.foray.pdf.object.PDFColor; import org.foray.pdf.object.PDFDocument; -import org.foray.pdf.object.PDFExplicitDestination; import org.foray.pdf.object.PDFFont; -import org.foray.pdf.object.PDFNamedDestination; import org.foray.pdf.object.PDFPage; import org.foray.pdf.object.PDFPathPaint; import org.foray.render.PrintRenderer; @@ -59,6 +57,7 @@ import org.axsl.pdf.PDFContentStream; import org.axsl.pdf.PDFEncryption; import org.axsl.pdf.PDFException; +import org.axsl.pdf.PDFExplicitDestination; import org.axsl.pdf.PDFFactory; import org.axsl.pdf.PDFOutlineItem; import org.axsl.pdf.PDFOutlineParent; @@ -416,13 +415,16 @@ */ private void renderDestinations(Area area) { if (area.destinationName() != null) { - PDFExplicitDestination explicitDest = new PDFExplicitDestination( - pdfDoc, this.currentPage, area.rrOriginX() / 1000f, - area.rrOriginY() / 1000f); - this.currentPage.getPDFDocument().registerIndirectObjectLast(explicitDest); - PDFNamedDestination namedDest = new PDFNamedDestination(pdfDoc, - area.traitId(), explicitDest); - this.getPDFDocument().addNamedDestination(namedDest); + try { + PDFExplicitDestination explicitDest + = this.pdfFactory.createPDFExplicitDestination( + pdfDoc, this.currentPage, area.rrOriginX() / 1000f, + area.rrOriginY() / 1000f); + this.pdfFactory.createPDFNamedDestination(pdfDoc, + area.traitId(), explicitDest); + } catch (PDFException e) { + /* Ignore this. It should never happen. */ + } } List children = area.getChildren(); for (int i = 0; i < children.size(); i++) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-03-14 21:15:42
|
Revision: 6951 Author: victormote Date: 2006-03-14 13:15:37 -0800 (Tue, 14 Mar 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=6951&view=rev Log Message: ----------- Rename instance variables for clarity. Modified Paths: -------------- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFRoot.java Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFRoot.java =================================================================== --- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFRoot.java 2006-03-14 21:03:13 UTC (rev 6950) +++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFRoot.java 2006-03-14 21:15:37 UTC (rev 6951) @@ -37,12 +37,12 @@ /** * Root outline object */ - private PDFOutline _outline; + private PDFOutline outline; /** * Collection of destinations */ - private PDFNameTree _destinations; + private PDFNameTree destinations; /** * Create a Root (/Catalog) object. @@ -65,10 +65,10 @@ } public PDFNameTree getDestinations() { - if (_destinations == null) { - _destinations = new PDFNameTree(this.getPDFDocument()); + if (destinations == null) { + destinations = new PDFNameTree(this.getPDFDocument()); } - return _destinations; + return destinations; } /** @@ -77,11 +77,11 @@ * reference for later. */ public PDFOutline getOutlineRoot() { - if (_outline == null) { - this._outline = new PDFOutline(getPDFDocument()); - getPDFDocument().registerIndirectObjectLast(this._outline); + if (outline == null) { + this.outline = new PDFOutline(getPDFDocument()); + getPDFDocument().registerIndirectObjectLast(this.outline); } - return _outline; + return outline; } /** @@ -94,14 +94,14 @@ p.append("<<" + EOL); p.append("/Type /Catalog" + EOL); p.append("/Pages " + this.rootPages.pdfReference() + EOL); - if (_outline != null) { - p.append(" /Outlines " + _outline.pdfReference() + EOL); + if (outline != null) { + p.append(" /Outlines " + outline.pdfReference() + EOL); p.append(" /PageMode /UseOutlines" + EOL); } - if (_destinations != null) { + if (destinations != null) { p.append(" /Names" + EOL); p.append(" <<" + EOL); - p.append(" /Dests " + this._destinations.pdfReference() + EOL); + p.append(" /Dests " + this.destinations.pdfReference() + EOL); p.append(" >>" + EOL); } p.append(">>" + EOL); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-03-14 21:03:27
|
Revision: 6950 Author: victormote Date: 2006-03-14 13:03:13 -0800 (Tue, 14 Mar 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=6950&view=rev Log Message: ----------- Make and use new class PDFNameTree. Modified Paths: -------------- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFDocument.java trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFRoot.java trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java Added Paths: ----------- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFNameTree.java Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFDocument.java =================================================================== --- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFDocument.java 2006-03-14 20:32:36 UTC (rev 6949) +++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFDocument.java 2006-03-14 21:03:13 UTC (rev 6950) @@ -596,4 +596,8 @@ this.getInfo().setCreationDate(creationDate); } + public void addNamedDestination(PDFNamedDestination destination) { + this.getRoot().getDestinations().add(destination); + } + } Added: trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFNameTree.java =================================================================== --- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFNameTree.java (rev 0) +++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFNameTree.java 2006-03-14 21:03:13 UTC (rev 6950) @@ -0,0 +1,67 @@ +/* + * Copyright 2006 The FOray Project. + * http://www.foray.org + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * This work is in part derived from the following work(s), used with the + * permission of the licensor: + * Apache FOP, licensed by the Apache Software Foundation + * + */ + +/* $Id$ */ + +package org.foray.pdf.object; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Iterator; + +/** + * A PDF Name Tree. The Name Tree is described in PDF Reference, Third Edition, + * Section 3.8.4. + */ +public class PDFNameTree extends PDFObject { + + private Collection names; + + public PDFNameTree(PDFDocument doc) { + super(doc); + this.names = new ArrayList(); + } + + /** + * Represent the object as PDF. + * @return The PDF string + */ + public String toPDF() { + StringBuffer p = new StringBuffer(); + p.append(this.pdfID() + EOL); + p.append("<<" + EOL); + p.append("/Names [" + EOL); + for (Iterator i = names.iterator(); i.hasNext(); ) { + PDFDestination dest = (PDFDestination)i.next(); + p.append(dest.toPDF()); + } + p.append("]" + EOL); + p.append(">>" + EOL); + p.append("endobj" + EOL); + return p.toString(); + } + + public void add(PDFNamedDestination destination) { + this.names.add(destination); + } + +} Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFRoot.java =================================================================== --- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFRoot.java 2006-03-14 20:32:36 UTC (rev 6949) +++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFRoot.java 2006-03-14 21:03:13 UTC (rev 6950) @@ -24,10 +24,6 @@ package org.foray.pdf.object; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; - /** * class representing a Root (/Catalog) object */ @@ -46,7 +42,7 @@ /** * Collection of destinations */ - private Collection _destinations; + private PDFNameTree _destinations; /** * Create a Root (/Catalog) object. @@ -68,9 +64,9 @@ this.rootPages.addPage(page); } - public Collection getDestinations() { + public PDFNameTree getDestinations() { if (_destinations == null) { - _destinations = new ArrayList(); + _destinations = new PDFNameTree(this.getPDFDocument()); } return _destinations; } @@ -103,12 +99,10 @@ p.append(" /PageMode /UseOutlines" + EOL); } if (_destinations != null) { - p.append(" /Names << /Dests << /Names [" + EOL); - for (Iterator i = _destinations.iterator(); i.hasNext(); ) { - PDFDestination dest = (PDFDestination)i.next(); - p.append(dest.toPDF()); - } - p.append("] >> >>" + EOL); + p.append(" /Names" + EOL); + p.append(" <<" + EOL); + p.append(" /Dests " + this._destinations.pdfReference() + EOL); + p.append(" >>" + EOL); } p.append(">>" + EOL); p.append("endobj" + EOL); Modified: trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java =================================================================== --- trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2006-03-14 20:32:36 UTC (rev 6949) +++ trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2006-03-14 21:03:13 UTC (rev 6950) @@ -422,7 +422,7 @@ this.currentPage.getPDFDocument().registerIndirectObjectLast(explicitDest); PDFNamedDestination namedDest = new PDFNamedDestination(pdfDoc, area.traitId(), explicitDest); - this.currentPage.getPDFDocument().getRoot().getDestinations().add(namedDest); + this.getPDFDocument().addNamedDestination(namedDest); } List children = area.getChildren(); for (int i = 0; i < children.size(); i++) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-03-14 20:32:42
|
Revision: 6949 Author: victormote Date: 2006-03-14 12:32:36 -0800 (Tue, 14 Mar 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=6949&view=rev Log Message: ----------- Minor readability changes. Modified Paths: -------------- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFRoot.java Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFRoot.java =================================================================== --- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFRoot.java 2006-03-14 19:33:20 UTC (rev 6948) +++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFRoot.java 2006-03-14 20:32:36 UTC (rev 6949) @@ -95,7 +95,8 @@ public String toPDF() { StringBuffer p = new StringBuffer(); p.append(this.pdfID() + EOL); - p.append("<< /Type /Catalog" + EOL); + p.append("<<" + EOL); + p.append("/Type /Catalog" + EOL); p.append("/Pages " + this.rootPages.pdfReference() + EOL); if (_outline != null) { p.append(" /Outlines " + _outline.pdfReference() + EOL); @@ -109,7 +110,8 @@ } p.append("] >> >>" + EOL); } - p.append(">>" + EOL + "endobj" + EOL); + p.append(">>" + EOL); + p.append("endobj" + EOL); return p.toString(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-03-14 19:33:26
|
Revision: 6948 Author: victormote Date: 2006-03-14 11:33:20 -0800 (Tue, 14 Mar 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=6948&view=rev Log Message: ----------- Make content generic so that it is easier to see where the correct order. Modified Paths: -------------- trunk/foray/resource/fo-examples/basic/pdfoutline.fo Modified: trunk/foray/resource/fo-examples/basic/pdfoutline.fo =================================================================== --- trunk/foray/resource/fo-examples/basic/pdfoutline.fo 2006-03-14 00:28:20 UTC (rev 6947) +++ trunk/foray/resource/fo-examples/basic/pdfoutline.fo 2006-03-14 19:33:20 UTC (rev 6948) @@ -1,1411 +1,199 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- -THIS IS NOT THE LATEST VERSION OF THE FOP DOCUMENTATION BUT ONLY AN EXAMPLE FILE - -This files shows next to the trivial usage of fo:block and fo:inline examples of -- fo:basic-link external-destination -- fo:basic-link internal-destination -- fo:table -- fo:list-block (including a bullet from the font Symbol as list-item-label) -- fo:page-number-citation (computes dynamically the page number in section 'content') +<!-- This file provides an example use of the fo:bookmark-tree, fo:bookmark, + and fo:bookmark-title formatting objects. --> -<!-- note the extensions namespace (foray) --> - -<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" - xmlns:foray="http://org.foray/fo-extensions/2004"> +<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> <fo:layout-master-set> - <!-- layout for the first page --> - <fo:simple-page-master master-name="first" - page-height="29.7cm" - page-width="21cm" - margin-top="1cm" - margin-bottom="2cm" - margin-left="2.5cm" - margin-right="2.5cm"> + <fo:simple-page-master master-name="first" page-height="29.7cm" + page-width="21cm" margin-top="1cm" margin-bottom="2cm" margin-left="2.5cm" + margin-right="2.5cm"> <fo:region-body margin-top="3cm" margin-bottom="1.5cm"/> <fo:region-before extent="3cm"/> <fo:region-after extent="1.5cm"/> </fo:simple-page-master> <!-- layout for the other pages --> - <fo:simple-page-master master-name="rest" - page-height="29.7cm" - page-width="21cm" - margin-top="1cm" - margin-bottom="2cm" - margin-left="2.5cm" - margin-right="2.5cm"> + <fo:simple-page-master master-name="rest" page-height="29.7cm" + page-width="21cm" margin-top="1cm" margin-bottom="2cm" margin-left="2.5cm" + margin-right="2.5cm"> <fo:region-body margin-top="2.5cm" margin-bottom="1.5cm"/> <fo:region-before extent="2.5cm"/> <fo:region-after extent="1.5cm"/> </fo:simple-page-master> -<fo:page-sequence-master master-name="basicPSM" > - <fo:repeatable-page-master-alternatives> + <fo:page-sequence-master master-name="basicPSM"> + <fo:repeatable-page-master-alternatives> <fo:conditional-page-master-reference master-reference="first" - page-position="first" /> + page-position="first"/> <fo:conditional-page-master-reference master-reference="rest" - page-position="rest" /> + page-position="rest"/> <!-- recommended fallback procedure --> - <fo:conditional-page-master-reference master-reference="rest" /> - </fo:repeatable-page-master-alternatives> -</fo:page-sequence-master> - + <fo:conditional-page-master-reference master-reference="rest"/> + </fo:repeatable-page-master-alternatives> + </fo:page-sequence-master> </fo:layout-master-set> <!-- end: defines page layout --> - -<fo:bookmark-tree> - <fo:bookmark internal-destination="sec1"> - <fo:bookmark-title>What is FOP?</fo:bookmark-title> - </fo:bookmark> - - <fo:bookmark internal-destination="sec2"> - <fo:bookmark-title>Downloading FOP</fo:bookmark-title> - </fo:bookmark> - - <fo:bookmark internal-destination="sec3"> - <fo:bookmark-title>Running FOP</fo:bookmark-title> - - <fo:bookmark internal-destination="sec3-1"> - <fo:bookmark-title>Prerequisites</fo:bookmark-title> - - <fo:bookmark internal-destination="sec3-1-1"> - <fo:bookmark-title>Java 1.1</fo:bookmark-title> + <fo:bookmark-tree> + <fo:bookmark internal-destination="Section-01"> + <fo:bookmark-title>Section 1</fo:bookmark-title> + </fo:bookmark> + <fo:bookmark internal-destination="Section-02"> + <fo:bookmark-title>Section 2</fo:bookmark-title> + </fo:bookmark> + <fo:bookmark internal-destination="Section-03"> + <fo:bookmark-title>Section 3</fo:bookmark-title> + <fo:bookmark internal-destination="Section-03-01"> + <fo:bookmark-title>Section 3.1</fo:bookmark-title> + <fo:bookmark internal-destination="Section-03-01-01"> + <fo:bookmark-title>Section 3.1.1</fo:bookmark-title> + </fo:bookmark> + <fo:bookmark internal-destination="Section-03-01-02"> + <fo:bookmark-title>Section 3.1.2</fo:bookmark-title> + </fo:bookmark> + <fo:bookmark internal-destination="Section-03-01-03"> + <fo:bookmark-title>Section 3.1.3</fo:bookmark-title> + </fo:bookmark> </fo:bookmark> - - <fo:bookmark internal-destination="sec3-1-2"> - <fo:bookmark-title>XML Parser</fo:bookmark-title> + <fo:bookmark internal-destination="Section-03-02"> + <fo:bookmark-title>Section 3.2</fo:bookmark-title> </fo:bookmark> - - <fo:bookmark internal-destination="sec3-1-3"> - <fo:bookmark-title>XSLT Processor</fo:bookmark-title> - </fo:bookmark> - </fo:bookmark> - - <fo:bookmark internal-destination="sec3-2"> - <fo:bookmark-title>Starting FOP</fo:bookmark-title> + <fo:bookmark internal-destination="Section-04"> + <fo:bookmark-title>Section 4</fo:bookmark-title> </fo:bookmark> + <fo:bookmark internal-destination="Section-05"> + <fo:bookmark-title>Section 5</fo:bookmark-title> + </fo:bookmark> + <fo:bookmark internal-destination="Section-06"> + <fo:bookmark-title>Section 6</fo:bookmark-title> + </fo:bookmark> + <fo:bookmark internal-destination="Section-07"> + <fo:bookmark-title font-style="italic">Section 7</fo:bookmark-title> + </fo:bookmark> + <fo:bookmark internal-destination="Section-08"> + <fo:bookmark-title font-weight="bold">Section 8</fo:bookmark-title> + </fo:bookmark> + <fo:bookmark internal-destination="Section-09"> + <fo:bookmark-title font-style="italic" font-weight="bold">Section +9</fo:bookmark-title> + </fo:bookmark> + <fo:bookmark internal-destination="Section-10"> + <fo:bookmark-title color="red">Section 10</fo:bookmark-title> + </fo:bookmark> + <fo:bookmark internal-destination="Section-11"> + <fo:bookmark-title>Section 11</fo:bookmark-title> + </fo:bookmark> + </fo:bookmark-tree> - </fo:bookmark> - - <fo:bookmark internal-destination="sec4"> - <fo:bookmark-title>Embedding FOP</fo:bookmark-title> - </fo:bookmark> - - <fo:bookmark internal-destination="sec5"> - <fo:bookmark-title>What's Implemented?</fo:bookmark-title> - </fo:bookmark> - <fo:bookmark internal-destination="sec6"> - <fo:bookmark-title>Limitations</fo:bookmark-title> - </fo:bookmark> - <fo:bookmark internal-destination="sec7"> - <fo:bookmark-title font-style="italic">Bugs</fo:bookmark-title> - </fo:bookmark> - <fo:bookmark internal-destination="sec8"> - <fo:bookmark-title font-weight="bold">Compiling FOP</fo:bookmark-title> - </fo:bookmark> - <fo:bookmark internal-destination="sec9"> - <fo:bookmark-title font-style="italic" font-weight="bold">Getting - Involved</fo:bookmark-title> - </fo:bookmark> - <fo:bookmark internal-destination="sec10"> - <fo:bookmark-title color="red">FOP Relevant Specifications</fo:bookmark-title> - </fo:bookmark> - <fo:bookmark internal-destination="sec11"> - <fo:bookmark-title>License</fo:bookmark-title> - </fo:bookmark> -</fo:bookmark-tree> - - - <!-- actual layout --> + <!-- Content layout. --> <fo:page-sequence master-reference="basicPSM"> - - -<fo:static-content flow-name="xsl-region-before"> -<fo:block text-align="end" font-size="10pt" font-family="serif" line-height="14pt" color="red" > -This is not the latest Fop documentation, but just an fo example. FOP - p. <fo:page-number/> -</fo:block> -</fo:static-content> - - -<fo:flow flow-name="xsl-region-body"> - -<fo:block id="secA" font-size="18pt" font-family="sans-serif" line-height="24pt" space-after.optimum="15pt" background-color="blue" color="white" text-align="center" padding-top="3pt">FOP: An Open-Source XSL Formatter and Renderer</fo:block> - -<fo:block font-size="14pt" font-family="sans-serif" line-height="10pt" space-after.optimum="15pt" font-weight="bold" start-indent="15pt"> - Content - </fo:block> -<fo:table table-layout="fixed"> -<fo:table-column column-width="1cm"/> -<fo:table-column column-width="12cm"/> -<fo:table-column column-width="1cm"/> -<fo:table-body font-size="10pt" font-family="sans-serif"> -<fo:table-row line-height="12pt"> -<fo:table-cell> -<fo:block text-align="end">A) - </fo:block> -</fo:table-cell> -<fo:table-cell> -<fo:block text-align="start"><fo:basic-link color="blue" internal-destination="sec1">What is FOP?</fo:basic-link></fo:block> -</fo:table-cell> -<fo:table-cell> -<fo:block text-align="end"><fo:page-number-citation ref-id="sec1"/></fo:block> -</fo:table-cell> -</fo:table-row> -<fo:table-row line-height="12pt"> -<fo:table-cell> -<fo:block text-align="end">B) - </fo:block> -</fo:table-cell> -<fo:table-cell> -<fo:block text-align="start"><fo:basic-link color="blue" internal-destination="sec2">Downloading FOP</fo:basic-link></fo:block> -</fo:table-cell> -<fo:table-cell> -<fo:block text-align="end"><fo:page-number-citation ref-id="sec2"/></fo:block> -</fo:table-cell> -</fo:table-row> -<fo:table-row line-height="12pt"> -<fo:table-cell> -<fo:block text-align="end">C) - </fo:block> -</fo:table-cell> -<fo:table-cell> -<fo:block text-align="start"><fo:basic-link color="blue" internal-destination="sec3">Running FOP</fo:basic-link></fo:block> -</fo:table-cell> -<fo:table-cell> -<fo:block text-align="end"><fo:page-number-citation ref-id="sec3"/></fo:block> -</fo:table-cell> -</fo:table-row> -<fo:table-row line-height="12pt"> -<fo:table-cell> -<fo:block text-align="end">D) - </fo:block> -</fo:table-cell> -<fo:table-cell> -<fo:block text-align="start"><fo:basic-link color="blue" internal-destination="sec4">Embedding FOP</fo:basic-link> </fo:block> -</fo:table-cell> -<fo:table-cell> -<fo:block text-align="end"><fo:page-number-citation ref-id="sec4"/></fo:block> -</fo:table-cell> -</fo:table-row> -<fo:table-row line-height="12pt"> -<fo:table-cell> -<fo:block text-align="end">E) - </fo:block> -</fo:table-cell> -<fo:table-cell> -<fo:block text-align="start"><fo:basic-link color="blue" internal-destination="sec5">What's Implemented?</fo:basic-link></fo:block> -</fo:table-cell> -<fo:table-cell> -<fo:block text-align="end"><fo:page-number-citation ref-id="sec5"/></fo:block> -</fo:table-cell> -</fo:table-row> -<fo:table-row line-height="12pt"> -<fo:table-cell> -<fo:block text-align="end">F) - </fo:block> -</fo:table-cell> -<fo:table-cell> -<fo:block text-align="start"><fo:basic-link color="blue" internal-destination="sec6">Limitations</fo:basic-link></fo:block> -</fo:table-cell> -<fo:table-cell> -<fo:block text-align="end"><fo:page-number-citation ref-id="sec6"/></fo:block> -</fo:table-cell> -</fo:table-row> -<fo:table-row line-height="12pt"> -<fo:table-cell> -<fo:block text-align="end">G) - </fo:block> -</fo:table-cell> -<fo:table-cell> -<fo:block text-align="start"><fo:basic-link color="blue" internal-destination="sec7">Bugs</fo:basic-link></fo:block> -</fo:table-cell> -<fo:table-cell> -<fo:block text-align="end"><fo:page-number-citation ref-id="sec7"/></fo:block> -</fo:table-cell> -</fo:table-row> -<fo:table-row line-height="12pt"> -<fo:table-cell> -<fo:block text-align="end">H) - </fo:block> -</fo:table-cell> -<fo:table-cell> -<fo:block text-align="start"><fo:basic-link color="blue" internal-destination="sec8">Compiling FOP</fo:basic-link></fo:block> -</fo:table-cell> -<fo:table-cell> -<fo:block text-align="end"><fo:page-number-citation ref-id="sec8"/></fo:block> -</fo:table-cell> -</fo:table-row> -<fo:table-row line-height="12pt"> -<fo:table-cell> -<fo:block text-align="end">I) - </fo:block> -</fo:table-cell> -<fo:table-cell> -<fo:block text-align="start"><fo:basic-link color="blue" internal-destination="sec9">Getting involved</fo:basic-link></fo:block> -</fo:table-cell> -<fo:table-cell> -<fo:block text-align="end"><fo:page-number-citation ref-id="sec9"/></fo:block> -</fo:table-cell> -</fo:table-row> -<fo:table-row line-height="12pt"> -<fo:table-cell> -<fo:block text-align="end">J) - </fo:block> -</fo:table-cell> -<fo:table-cell> -<fo:block text-align="start"><fo:basic-link color="blue" internal-destination="sec10">FOP Relevant Specifications</fo:basic-link></fo:block> -</fo:table-cell> -<fo:table-cell> -<fo:block text-align="end"><fo:page-number-citation ref-id="sec10"/></fo:block> -</fo:table-cell> -</fo:table-row> -<fo:table-row line-height="12pt"> -<fo:table-cell> -<fo:block text-align="end">K) - </fo:block> -</fo:table-cell> -<fo:table-cell> -<fo:block text-align="start"><fo:basic-link color="blue" internal-destination="sec11">Licence</fo:basic-link></fo:block> -</fo:table-cell> -<fo:table-cell> -<fo:block text-align="end"><fo:page-number-citation ref-id="sec11"/></fo:block> -</fo:table-cell> -</fo:table-row> -</fo:table-body> -</fo:table> - - -<fo:block id="sec1" font-size="18pt" font-family="serif" line-height="20pt" - space-before.optimum="20pt" space-after.optimum="14pt" break-before="page">A) -What is FOP?</fo:block> - <fo:block space-after.optimum="3pt" font-family="serif">FOP is the world's first print formatter driven by XSL formatting - objects. It is a Java 1.1 application that reads a formatting object - tree and then turns it into a PDF document. The formatting object - tree, can be in the form of an XML document (output by an XSLT engine - like XT or Xalan) or can be passed in memory as a DOM Document or (in - the case of XT) SAX events. - - </fo:block> - <fo:block space-after.optimum="3pt" font-family="serif">FOP is part of Apache's XML project. The homepage of FOP is - <fo:inline font-style="italic" font-family="serif"><fo:basic-link color="blue" external-destination="url(http://xml.apache.org/fop)">http://xml.apache.org/fop</fo:basic-link></fo:inline> - </fo:block> - - - - - <fo:block id="sec2" font-size="18pt" font-family="serif" line-height="20pt" space-before.optimum="20pt" space-after.optimum="14pt" >B) - Downloading FOP</fo:block> - <fo:block space-after.optimum="3pt" font-family="serif">The latest release version is <fo:inline font-style="italic" font-family="serif">FOP -0.14</fo:inline> <fo:inline font-family="serif"> - () - </fo:inline>. </fo:block> - <fo:block space-after.optimum="3pt" font-family="serif">NOTE: you do not have to unjar or unzip this jar file.</fo:block> - <fo:block space-after.optimum="3pt" font-family="serif">Documentation can be downloaded here as <fo:inline font-style="italic" font-family="serif">HMTL file</fo:inline> -<fo:inline font-family="serif"> - () - </fo:inline> or - as <fo:inline font-style="italic" font-family="serif">PDF file</fo:inline> -<fo:inline font-family="serif"> - () - </fo:inline>.</fo:block> - <fo:block space-after.optimum="3pt" font-family="serif">To run FOP from the command line, see Running FOP. If you are interested in - embedding FOP in a Java application of your own, see Embedding FOP. - </fo:block> - <fo:block space-after.optimum="3pt" font-family="serif">You can also download the <fo:inline font-style="italic" font-family="serif">source code v. 0.14</fo:inline> -<fo:inline font-family="serif"> - () - </fo:inline> as jar file</fo:block> - - - - <fo:block id="sec3" font-size="18pt" font-family="serif" line-height="20pt" space-before.optimum="20pt" space-after.optimum="14pt" >C) - Running FOP</fo:block> - - <fo:block id="sec3-1" font-size="16pt" font-family="serif" line-height="18pt" space-before.optimum="8pt" space-after.optimum="8pt" >1) Prerequisites</fo:block> - <fo:block space-after.optimum="3pt" font-family="serif">Following software must be installed:</fo:block> - <fo:block id="sec3-1-1" space-after.optimum="3pt" font-family="serif">a) Java 1.1.x or later</fo:block> - <fo:block space-after.optimum="3pt" font-family="serif">For the fo-file viewer mode of FOP (see below) you must have the swing classes installed. - From Java 1.2 on (aka Java 2) they are part of the standard java distribution. - If you use Java 1.1.x you must seperately include the swing classes, which can - be found at the <fo:inline font-style="italic" font-family="serif"> - Sun website</fo:inline> -<fo:inline font-family="serif"> - (http://java.sun.com/products/jfc/#download-swing) - </fo:inline>. + <fo:static-content flow-name="xsl-region-before"> + <fo:block text-align="end" font-size="10pt" font-family="serif" + line-height="14pt" color="red">Bookmark Test - p. <fo:page-number/> </fo:block> - <fo:block id="sec3-1-2" space-after.optimum="3pt" font-family="serif">b) An XML parser which supports SAX and DOM like - <fo:inline font-style="italic" font-family="serif">Xerces-J</fo:inline> -<fo:inline font-family="serif"> - (http://xml.apache.org/xerces-j/index.html) - </fo:inline>.</fo:block> - <fo:block id="sec3-1-3" space-after.optimum="3pt" font-family="serif">c) If you have to produce the flow objects files, which are the input for FOP, - you need a transformation utility to create this files from your xml files. - Normally this is an XSLT stylesheet processor like - <fo:inline font-style="italic" font-family="serif">XT</fo:inline> -<fo:inline font-family="serif"> - (http://www.jclark.com/xml/xt.html) - </fo:inline> - or <fo:inline font-style="italic" font-family="serif">XALAN</fo:inline> -<fo:inline font-family="serif"> - (http://xml.apache.org/xalan/index.html) - </fo:inline>. - </fo:block> + </fo:static-content> + <fo:flow flow-name="xsl-region-body"> + <fo:block id="secA" font-size="18pt" font-family="sans-serif" + line-height="24pt" space-after.optimum="15pt" background-color="blue" + color="white" text-align="center" padding-top="3pt">BookmarkTest</fo:block> + <fo:block id="Section-01" font-size="18pt" font-family="serif" + line-height="20pt" space-before.optimum="20pt" + space-after.optimum="14pt">Section 1</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">This is Section +1, Paragraph 1, Sentence 1.</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">This is Section +1, Paragraph 2, Sentence 1.</fo:block> - <fo:block id="sec3-2" font-size="16pt" font-family="serif" line-height="18pt" space-before.optimum="8pt" space-after.optimum="8pt" >2) Starting FOP as an standalone application</fo:block> - <fo:block space-after.optimum="3pt" font-family="serif">There are three ways to run FOP from the command line.</fo:block> - <fo:block space-after.optimum="3pt" font-family="serif">a) Batch processing formatting objects (fo) files: </fo:block> - <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">java org.apache.fop.apps.CommandLine fo-file pdf-file</fo:block> - <fo:block space-after.optimum="3pt" font-family="serif">b) Batch processing xml files (includes production of the fo-files):</fo:block> - <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">java org.apache.fop.apps.CommandLine xml-file xsl-file pdf-file</fo:block> - <fo:block space-after.optimum="3pt" font-family="serif">c) Previewing the fo-file:</fo:block> - <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">java org.apache.fop.apps.AWTCommandLine fo-file</fo:block> - <fo:block space-after.optimum="3pt" font-family="serif">Each method uses next to the fop classes other packages. The following describes - each method in detail.</fo:block> + <fo:block id="Section-02" font-size="18pt" font-family="serif" +line-height="20pt" space-before.optimum="20pt" +space-after.optimum="14pt">Section 2</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">This is Section +2, Paragraph 1, Sentence 1.</fo:block> - <fo:block font-size="14pt" font-family="serif" line-height="16pt" space-before.optimum="8pt" space-after.optimum="4pt" >a) Method One</fo:block> - <fo:block space-after.optimum="3pt" font-family="serif">One is to first use an XSLT engine to produce the formatting object tree as an - XML document and then running the class org.apache.fop.apps.CommandLine with the - formatting object file name and PDF filename as arguments. You will need to include - FOP and your XML Parser in your classpath and so you might invoke - </fo:block> - <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">java -cp fop_x_xx_x.jar;xerces.jar</fo:block> - <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">org.apache.fop.apps.CommandLine fo-file pdf-file</fo:block> - <fo:block space-after.optimum="3pt" font-family="serif">If your SAX Parser is other than Xerces, you will need to set the property - org.xml.sax.parser to the SAX Parser class to use. The following example shows - the command line, if you use XP, the XML parser from James Clark: - </fo:block> - <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">java -Dorg.xml.sax.parser=com.jclark.xml.sax.Driver</fo:block> - <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">-cp fop_x_xx_x.jar;sax.jar;xt.jar;xp.jar;xerces.jar</fo:block> - <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">org.apache.fop.apps.AWTCommandLine formatting-tree-file pdf-file</fo:block> - <fo:block space-after.optimum="3pt" font-family="serif">(You have to include xerces.jar or another xml parser which supports DOM in your classpath.) </fo:block> + <fo:block id="Section-03" font-size="18pt" font-family="serif" +line-height="20pt" space-before.optimum="20pt" +space-after.optimum="14pt">Section 3</fo:block> + <fo:block id="Section-03-01" font-size="16pt" font-family="serif" +line-height="18pt" space-before.optimum="8pt" space-after.optimum="8pt">Section +3.1</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">This is Section +3.1, Paragraph 1, Sentence 1.</fo:block> - <fo:block font-size="14pt" font-family="serif" line-height="16pt" space-before.optimum="8pt" space-after.optimum="4pt" >b) Method Two</fo:block> - <fo:block space-after.optimum="3pt" font-family="serif">Rather than performing transformation with an XSLT before invoking FOP, it is - possible, if you use XT as your XSLT engine, to just call FOP and have it call - XT for you. To do this, run the class org.apache.fop.apps.CommandLine with the - source XML file name, XSL file name and PDF file name as arguments. You will - need to include FOP, SAX, your SAX Parser and XT in your classpath and so you might - invoke - </fo:block> - <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">java -Dorg.xml.sax.parser=com.jclark.xml.sax.Driver</fo:block> - <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">-cp fop_x_xx_x.jar;xt.jar;xerces.jar</fo:block> - <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">org.apache.fop.apps.CommandLine xml-file xsl-file pdf-file</fo:block> - <fo:block space-after.optimum="3pt" font-family="serif">Again, if your SAX Parser is other than Xerces, you will need to set the property - org.xml.sax.parser to the SAX Parser class to use. - </fo:block> + <fo:block id="Section-03-01-01" space-after.optimum="3pt" +font-family="serif">Section 3.1.1</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">This is Section +3.1.2, Paragraph 1, Sentence 1.</fo:block> + <fo:block id="Section-03-01-02" space-after.optimum="3pt" +font-family="serif">Section 3.1.2</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">This is Section +3.1.2, Paragraph 1, Sentence 1.</fo:block> - <fo:block font-size="14pt" font-family="serif" line-height="16pt" space-before.optimum="8pt" space-after.optimum="4pt" >c) Method Three</fo:block> - <fo:block space-after.optimum="3pt" font-family="serif">If you already produced the FO file, you can preview the results of your - transformation without using any pdf viewer by invoking FOP with the viewer - application. You will need to include FOP and your XML Parser in your classpath - </fo:block> - <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">java -cp fop_x_xx_x.jar;xerces.jar</fo:block> - <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">org.apache.fop.apps.AWTCommandLine fo-file </fo:block> - <fo:block space-after.optimum="3pt" font-family="serif">The viewer uses the swing classes.</fo:block> - <fo:block space-after.optimum="3pt" font-family="serif">Note: If you are using java 2 or later (i.e. jdk 1.2. or later) you can put all - needed jar files into the subdirectory jdk1.2.x\jre\lib\ext (windows example). Then - FOP can be started without classpath: - </fo:block> - <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">java org.apache.fop.apps.CommandLine fo-file pdf-file</fo:block> + <fo:block id="Section-03-01-03" space-after.optimum="3pt" +font-family="serif">Section 3.1.3</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">This is Section +3.1.3, Paragraph 1, Sentence 1.</fo:block> + <fo:block id="Section-03-02" font-size="16pt" font-family="serif" +line-height="18pt" space-before.optimum="8pt" +space-after.optimum="8pt">Section 3.2</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">This is Section +3.2, Paragraph 1, Sentence 1.</fo:block> + <fo:block id="Section-04" font-size="18pt" font-family="serif" +line-height="20pt" space-before.optimum="20pt" +space-after.optimum="14pt">Section 4</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">This is Section +4, Paragraph 1, Sentence 1.</fo:block> - <fo:block font-size="16pt" font-family="serif" line-height="18pt" space-before.optimum="8pt" space-after.optimum="8pt" >3) Running FOP on MacOS</fo:block> + <fo:block id="Section-05" font-size="18pt" font-family="serif" +line-height="20pt" space-before.optimum="20pt" +space-after.optimum="14pt">Section 5</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">This is Section +5, Paragraph 1, Sentence 1.</fo:block> - <fo:block space-after.optimum="3pt" font-family="serif">Ensure that you have a recent MRJ, and that you have downloaded and - unpacked the XP and SAX distributions. The xp.jar and sax.jar files work - as is on MacOS. - </fo:block> - <fo:block space-after.optimum="3pt" font-family="serif">Drag the FOP jarfile onto the JBindery icon. When the first dialog - appears, type "org.apache.fop.apps.CommandLine" in the "Class name" field. - Using UNIX syntax, type the names of the input formatting-object file and - the output PDF in the "Optional parameters" field. - </fo:block> - <fo:block space-after.optimum="3pt" font-family="serif">Click on the Classpath icon. To add the xp.jar and sax.jar files, click - the "Add .zip file" button, navigate to the file in question, and click - Open. - </fo:block> - <fo:block space-after.optimum="3pt" font-family="serif">Once both are added (the FOP jarfile will already be in the list), click - Run. A "stdout" window will appear and display FOP runtime messages. - </fo:block> + <fo:block id="Section-06" font-size="18pt" font-family="serif" +line-height="20pt" space-before.optimum="20pt" +space-after.optimum="14pt">Section 6</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">This is Section +6, Paragraph 1, Sentence 1.</fo:block> + <fo:block id="Section-07" font-size="18pt" font-family="serif" +line-height="20pt" space-before.optimum="20pt" +space-after.optimum="14pt">Section 7</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">This is Section +7, Paragraph 1, Sentence 1.</fo:block> - <fo:block font-size="16pt" font-family="serif" line-height="18pt" space-before.optimum="8pt" space-after.optimum="8pt" >4) Problems</fo:block> - <fo:block space-after.optimum="3pt" font-family="serif">If you have problems running FOP, please have a look at the - <fo:inline font-style="italic" font-family="serif">FOP FAQ</fo:inline> -<fo:inline font-family="serif"> - (faq.html) - </fo:inline>. If you don't find a solution there, - you can ask for help on the list fo...@xm.... Maybe it's bug and - maybe somebody is already working on it. - </fo:block> + <fo:block id="Section-08" font-size="18pt" font-family="serif" +line-height="20pt" space-before.optimum="20pt" +space-after.optimum="14pt">Section 8</fo:block> + <fo:block font-size="16pt" font-family="serif" line-height="18pt" + space-before.optimum="8pt" space-after.optimum="8pt">This is Section +8, Paragraph 1, Sentence 1.</fo:block> + <fo:block id="Section-09" font-size="18pt" font-family="serif" +line-height="20pt" space-before.optimum="20pt" +space-after.optimum="14pt">Section 9</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">This is Section +9, Paragraph 1, Sentence 1.</fo:block> + <fo:block id="Section-10" font-size="18pt" font-family="serif" +line-height="20pt" space-before.optimum="20pt" +space-after.optimum="14pt">Section 10</fo:block> + <fo:block space-after.optimum="3pt" font-family="serif">This is Section +10, Paragraph 1, Sentence 1.</fo:block> - - <fo:block id="sec4" font-size="18pt" font-family="serif" line-height="20pt" space-before.optimum="20pt" space-after.optimum="14pt" >D) - Embedding FOP </fo:block> - <fo:block space-after.optimum="3pt" font-family="serif">Instantiate org.apache.fop.apps.Driver. Once this class is - instantiated, methods are called to set the - Renderer to use, the (possibly multiple) ElementMapping(s) to - use and the PrintWriter to use to output the results of the - rendering (where applicable). In the case of the Renderer and - ElementMapping(s), the Driver may be supplied either with the - object itself, or the name of the class, in which case Driver will - instantiate the class itself. The advantage of the latter is it - enables runtime determination of Renderer and ElementMapping(s). - </fo:block> - <fo:block space-after.optimum="3pt" font-family="serif">Once the Driver is set up, the buildFOTree method - is called. Depending on whether DOM or SAX is being used, the - invocation of the method is either buildFOTree(Document) or - buildFOTree(Parser, InputSource) respectively. - </fo:block> - <fo:block space-after.optimum="3pt" font-family="serif">A third possibility may be used to build the FO Tree, namely - calling getDocumentHandler() and firing the SAX events yourself. - </fo:block> - <fo:block space-after.optimum="3pt" font-family="serif">Once the FO Tree is built, the format() and render() methods may be - called in that order. - </fo:block> - <fo:block space-after.optimum="3pt" font-family="serif">Here is an example use of Driver from CommandLine.java:</fo:block> - <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">Driver driver = new Driver();</fo:block> - <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">driver.setRenderer("org.apache.fop.render.pdf.PDFRenderer", version);</fo:block> - <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">driver.addElementMapping("org.apache.fop.fo.StandardElementMapping");</fo:block> - <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">driver.addElementMapping("org.apache.fop.svg.SVGElementMapping");</fo:block> - <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">driver.setWriter(new PrintWriter(new FileWriter(args[1])));</fo:block> - <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">driver.buildFOTree(parser, fileInputSource(args[0]));</fo:block> - <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">driver.format();</fo:block> - <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt">driver.render();</fo:block> - - - - - - - <fo:block id="sec5" font-size="18pt" font-family="serif" line-height="20pt" space-before.optimum="20pt" space-after.optimum="14pt" >E) - What's Implemented?</fo:block> - <fo:block space-after.optimum="3pt" font-family="serif">Also see STATUS for what is being worked on.</fo:block> - - <fo:block font-size="16pt" font-family="serif" line-height="18pt" space-before.optimum="8pt" space-after.optimum="8pt" >1) Formatting Objects</fo:block> - <fo:list-block start-indent="1cm" provisional-distance-between-starts="12pt" font-family="serif"> - <fo:list-item> -<fo:list-item-label end-indent="label-end()"> -<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> -</fo:list-item-label> -<fo:list-item-body start-indent="body-start()"> -<fo:block>root </fo:block> -</fo:list-item-body> -</fo:list-item> - <fo:list-item> -<fo:list-item-label end-indent="label-end()"> -<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> -</fo:list-item-label> -<fo:list-item-body start-indent="body-start()"> -<fo:block>layout-master-set </fo:block> -</fo:list-item-body> -</fo:list-item> - <fo:list-item> -<fo:list-item-label end-indent="label-end()"> -<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> -</fo:list-item-label> -<fo:list-item-body start-indent="body-start()"> -<fo:block>simple-page-master </fo:block> -</fo:list-item-body> -</fo:list-item> - <fo:list-item> -<fo:list-item-label end-indent="label-end()"> -<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> -</fo:list-item-label> -<fo:list-item-body start-indent="body-start()"> -<fo:block>region-body </fo:block> -</fo:list-item-body> -</fo:list-item> - <fo:list-item> -<fo:list-item-label end-indent="label-end()"> -<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> -</fo:list-item-label> -<fo:list-item-body start-indent="body-start()"> -<fo:block>region-before </fo:block> -</fo:list-item-body> -</fo:list-item> - <fo:list-item> -<fo:list-item-label end-indent="label-end()"> -<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> -</fo:list-item-label> -<fo:list-item-body start-indent="body-start()"> -<fo:block>region-after </fo:block> -</fo:list-item-body> -</fo:list-item> - <fo:list-item> -<fo:list-item-label end-indent="label-end()"> -<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> -</fo:list-item-label> -<fo:list-item-body start-indent="body-start()"> -<fo:block>page-sequence </fo:block> -</fo:list-item-body> -</fo:list-item> - <fo:list-item> -<fo:list-item-label end-indent="label-end()"> -<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> -</fo:list-item-label> -<fo:list-item-body start-indent="body-start()"> -<fo:block>sequence-specification </fo:block> -</fo:list-item-body> -</fo:list-item> - <fo:list-item> -<fo:list-item-label end-indent="label-end()"> -<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> -</fo:list-item-label> -<fo:list-item-body start-indent="body-start()"> -<fo:block>sequence-specifier-single </fo:block> -</fo:list-item-body> -</fo:list-item> - <fo:list-item> -<fo:list-item-label end-indent="label-end()"> -<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> -</fo:list-item-label> -<fo:list-item-body start-indent="body-start()"> -<fo:block>sequence-specifier-repeating </fo:block> -</fo:list-item-body> -</fo:list-item> - <fo:list-item> -<fo:list-item-label end-indent="label-end()"> -<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> -</fo:list-item-label> -<fo:list-item-body start-indent="body-start()"> -<fo:block>sequence-specifier-alternating </fo:block> -</fo:list-item-body> -</fo:list-item> - <fo:list-item> -<fo:list-item-label end-indent="label-end()"> -<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> -</fo:list-item-label> -<fo:list-item-body start-indent="body-start()"> -<fo:block>flow </fo:block> -</fo:list-item-body> -</fo:list-item> - <fo:list-item> -<fo:list-item-label end-indent="label-end()"> -<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> -</fo:list-item-label> -<fo:list-item-body start-indent="body-start()"> -<fo:block>static-content </fo:block> -</fo:list-item-body> -</fo:list-item> - <fo:list-item> -<fo:list-item-label end-indent="label-end()"> -<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> -</fo:list-item-label> -<fo:list-item-body start-indent="body-start()"> -<fo:block>block </fo:block> -</fo:list-item-body> -</fo:list-item> - <fo:list-item> -<fo:list-item-label end-indent="label-end()"> -<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> -</fo:list-item-label> -<fo:list-item-body start-indent="body-start()"> -<fo:block>list-block </fo:block> -</fo:list-item-body> -</fo:list-item> - <fo:list-item> -<fo:list-item-label end-indent="label-end()"> -<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> -</fo:list-item-label> -<fo:list-item-body start-indent="body-start()"> -<fo:block>list-item </fo:block> -</fo:list-item-body> -</fo:list-item> - <fo:list-item> -<fo:list-item-label end-indent="label-end()"> -<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> -</fo:list-item-label> -<fo:list-item-body start-indent="body-start()"> -<fo:block>list-item-label </fo:block> -</fo:list-item-body> -</fo:list-item> - <fo:list-item> -<fo:list-item-label end-indent="label-end()"> -<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> -</fo:list-item-label> -<fo:list-item-body start-indent="body-start()"> -<fo:block>list-item-body </fo:block> -</fo:list-item-body> -</fo:list-item> - <fo:list-item> -<fo:list-item-label end-indent="label-end()"> -<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> -</fo:list-item-label> -<fo:list-item-body start-indent="body-start()"> -<fo:block>page-number </fo:block> -</fo:list-item-body> -</fo:list-item> - <fo:list-item> -<fo:list-item-label end-indent="label-end()"> -<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> -</fo:list-item-label> -<fo:list-item-body start-indent="body-start()"> -<fo:block>display-sequence </fo:block> -</fo:list-item-body> -</fo:list-item> - <fo:list-item> -<fo:list-item-label end-indent="label-end()"> -<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> -</fo:list-item-label> -<fo:list-item-body start-indent="body-start()"> -<fo:block>inline </fo:block> -</fo:list-item-body> -</fo:list-item> - <fo:list-item> -<fo:list-item-label end-indent="label-end()"> -<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> -</fo:list-item-label> -<fo:list-item-body start-indent="body-start()"> -<fo:block>display-rule </fo:block> -</fo:list-item-body> -</fo:list-item> - <fo:list-item> -<fo:list-item-label end-indent="label-end()"> -<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> -</fo:list-item-label> -<fo:list-item-body start-indent="body-start()"> -<fo:block>display-graphic </fo:block> -</fo:list-item-body> -</fo:list-item> - <fo:list-item> -<fo:list-item-label end-indent="label-end()"> -<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> -</fo:list-item-label> -<fo:list-item-body start-indent="body-start()"> -<fo:block>table (minimal support)</fo:block> -</fo:list-item-body> -</fo:list-item> - <fo:list-item> -<fo:list-item-label end-indent="label-end()"> -<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> -</fo:list-item-label> -<fo:list-item-body start-indent="body-start()"> -<fo:block>table-column (minimal support)</fo:block> -</fo:list-item-body> -</fo:list-item> - <fo:list-item> -<fo:list-item-label end-indent="label-end()"> -<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> -</fo:list-item-label> -<fo:list-item-body start-indent="body-start()"> -<fo:block>table-body (minimal support)</fo:block> -</fo:list-item-body> -</fo:list-item> - <fo:list-item> -<fo:list-item-label end-indent="label-end()"> -<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> -</fo:list-item-label> -<fo:list-item-body start-indent="body-start()"> -<fo:block>table-row (minimal support)</fo:block> -</fo:list-item-body> -</fo:list-item> - <fo:list-item> -<fo:list-item-label end-indent="label-end()"> -<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> -</fo:list-item-label> -<fo:list-item-body start-indent="body-start()"> -<fo:block>table-cell (minimal support)</fo:block> -</fo:list-item-body> -</fo:list-item> - </fo:list-block> - - - - <fo:block font-size="16pt" font-family="serif" line-height="18pt" space-before.optimum="8pt" space-after.optimum="8pt" >2) Properties</fo:block> - <fo:list-block start-indent="1cm" provisional-distance-between-starts="12pt" font-family="serif"> - <fo:list-item> -<fo:list-item-label end-indent="label-end()"> -<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> -</fo:list-item-label> -<fo:list-item-body start-indent="body-start()"> -<fo:block>end-indent </fo:block> -</fo:list-item-body> -</fo:list-item> - <fo:list-item> -<fo:list-item-label end-indent="label-end()"> -<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> -</fo:list-item-label> -<fo:list-item-body start-indent="body-start()"> -<fo:block>page-master-name </fo:block> -</fo:list-item-body> -</fo:list-item> - <fo:list-item> -<fo:list-item-label end-indent="label-end()"> -<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> -</fo:list-item-label> -<fo:list-item-body start-indent="body-start()"> -<fo:block>page-master-first </fo:block> -</fo:list-item-body> -</fo:list-item> - <fo:list-item> -<fo:list-item-label end-indent="label-end()"> -<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> -</fo:list-item-label> -<fo:list-item-body start-indent="body-start()"> -<fo:block>page-master-repeating </fo:block> -</fo:list-item-body> -</fo:list-item> - <fo:list-item> -<fo:list-item-label end-indent="label-end()"> -<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> -</fo:list-item-label> -<fo:list-item-body start-indent="body-start()"> -<fo:block>page-master-odd </fo:block> -</fo:list-item-body> -</fo:list-item> - <fo:list-item> -<fo:list-item-label end-indent="label-end()"> -<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> -</fo:list-item-label> -<fo:list-item-body start-indent="body-start()"> -<fo:block>page-master-even </fo:block> -</fo:list-item-body> -</fo:list-item> - <fo:list-item> -<fo:list-item-label end-indent="label-end()"> -<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> -</fo:list-item-label> -<fo:list-item-body start-indent="body-start()"> -<fo:block>margin-top (only on pages and regions)</fo:block> -</fo:list-item-body> -</fo:list-item> - <fo:list-item> -<fo:list-item-label end-indent="label-end()"> -<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> -</fo:list-item-label> -<fo:list-item-body start-indent="body-start()"> -<fo:block>margin-bottom (only on pages and regions)</fo:block> -</fo:list-item-body> -</fo:list-item> - <fo:list-item> -<fo:list-item-label end-indent="label-end()"> -<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> -</fo:list-item-label> -<fo:list-item-body start-indent="body-start()"> -<fo:block>margin-left (only on pages and regions)</fo:block> -</fo:list-item-body> -</fo:list-item> - <fo:list-item> -<fo:list-item-label end-indent="label-end()"> -<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> -</fo:list-item-label> -<fo:list-item-body start-indent="body-start()"> -<fo:block>margin-right (only on pages and regions)</fo:block> -</fo:list-item-body> -</fo:list-item> - <fo:list-item> -<fo:list-item-label end-indent="label-end()"> -<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> -</fo:list-item-label> -<fo:list-item-body start-indent="body-start()"> -<fo:block>extent </fo:block> -</fo:list-item-body> -</fo:list-item> - <fo:list-item> -<fo:list-item-label end-indent="label-end()"> -<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> -</fo:list-item-label> -<fo:list-item-body start-indent="body-start()"> -<fo:block>page-width </fo:block> -</fo:list-item-body> -</fo:list-item> - <fo:list-item> -<fo:list-item-label end-indent="label-end()"> -<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> -</fo:list-item-label> -<fo:list-item-body start-indent="body-start()"> -<fo:block>page-height </fo:block> -</fo:list-item-body> -</fo:list-item> - <fo:list-item> -<fo:list-item-label end-indent="label-end()"> -<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> -</fo:list-item-label> -<fo:list-item-body start-indent="body-start()"> -<fo:block>flow-name </fo:block> -</fo:list-item-body> -</fo:list-item> - <fo:list-item> -<fo:list-item-label end-indent="label-end()"> -<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> -</fo:list-item-label> -<fo:list-item-body start-indent="body-start()"> -<fo:block>font-family </fo:block> -</fo:list-item-body> -</fo:list-item> - <fo:list-item> -<fo:list-item-label end-indent="label-end()"> -<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> -</fo:list-item-label> -<fo:list-item-body start-indent="body-start()"> -<fo:block>font-style </fo:block> -</fo:list-item-body> -</fo:list-item> - <fo:list-item> -<fo:list-item-label end-indent="label-end()"> -<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> -</fo:list-item-label> -<fo:list-item-body start-indent="body-start()"> -<fo:block>font-weight </fo:block> -</fo:list-item-body> -</fo:list-item> - <fo:list-item> -<fo:list-item-label end-indent="label-end()"> -<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> -</fo:list-item-label> -<fo:list-item-body start-indent="body-start()"> -<fo:block>font-size </fo:block> -</fo:list-item-body> -</fo:list-item> - <fo:list-item> -<fo:list-item-label end-indent="label-end()"> -<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> -</fo:list-item-label> -<fo:list-item-body start-indent="body-start()"> -<fo:block>line-height </fo:block> -</fo:list-item-body> -</fo:list-item> - <fo:list-item> -<fo:list-item-label end-indent="label-end()"> -<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> -</fo:list-item-label> -<fo:list-item-body start-indent="body-start()"> -<fo:block>text-align </fo:block> -</fo:list-item-body> -</fo:list-item> - <fo:list-item> -<fo:list-item-label end-indent="label-end()"> -<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> -</fo:list-item-label> -<fo:list-item-body start-indent="body-start()"> -<fo:block>text-align-last </fo:block> -</fo:list-item-body> -</fo:list-item> - <fo:list-item> -<fo:list-item-label end-indent="label-end()"> -<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> -</fo:list-item-label> -<fo:list-item-body start-indent="body-start()"> -<fo:block>space-before.optimum </fo:block> -</fo:list-item-body> -</fo:list-item> - <fo:list-item> -<fo:list-item-label end-indent="label-end()"> -<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> -</fo:list-item-label> -<fo:list-item-body start-indent="body-start()"> -<fo:block>space-after.optimum </fo:block> -</fo:list-item-body> -</fo:list-item> - <fo:list-item> -<fo:list-item-label end-indent="label-end()"> -<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> -</fo:list-item-label> -<fo:list-item-body start-indent="body-start()"> -<fo:block>start-indent </fo:block> -</fo:list-item-body> -</fo:list-item> - <fo:list-item> -<fo:list-item-label end-indent="label-end()"> -<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> -</fo:list-item-label> -<fo:list-item-body start-indent="body-start()"> -<fo:block>end-indent </fo:block> -</fo:list-item-body> -</fo:list-item> - <fo:list-item> -<fo:list-item-label end-indent="label-end()"> -<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> -</fo:list-item-label> -<fo:list-item-body start-indent="body-start()"> -<fo:block>provisional-distance-between-starts </fo:block> -</fo:list-item-body> -</fo:list-item> - <fo:list-item> -<fo:list-item-label end-indent="label-end()"> -<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> -</fo:list-item-label> -<fo:list-item-body start-indent="body-start()"> -<fo:block>provisional-label-separation </fo:block> -</fo:list-item-body> -</fo:list-item> - <fo:list-item> -<fo:list-item-label end-indent="label-end()"> -<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> -</fo:list-item-label> -<fo:list-item-body start-indent="body-start()"> -<fo:block>rule-thickness </fo:block> -</fo:list-item-body> -</fo:list-item> - <fo:list-item> -<fo:list-item-label end-indent="label-end()"> -<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> -</fo:list-item-label> -<fo:list-item-body start-indent="body-start()"> -<fo:block>color </fo:block> -</fo:list-item-body> -</fo:list-item> - <fo:list-item> -<fo:list-item-label end-indent="label-end()"> -<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> -</fo:list-item-label> -<fo:list-item-body start-indent="body-start()"> -<fo:block>wrap-option </fo:block> -</fo:list-item-body> -</fo:list-item> - <fo:list-item> -<fo:list-item-label end-indent="label-end()"> -<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> -</fo:list-item-label> -<fo:list-item-body start-indent="body-start()"> -<fo:block>white-space-treatment </fo:block> -</fo:list-item-body> -</fo:list-item> - <fo:list-item> -<fo:list-item-label end-indent="label-end()"> -<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> -</fo:list-item-label> -<fo:list-item-body start-indent="body-start()"> -<fo:block>break-before </fo:block> -</fo:list-item-body> -</fo:list-item> - <fo:list-item> -<fo:list-item-label end-indent="label-end()"> -<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> -</fo:list-item-label> -<fo:list-item-body start-indent="body-start()"> -<fo:block>break-after </fo:block> -</fo:list-item-body> -</fo:list-item> - <fo:list-item> -<fo:list-item-label end-indent="label-end()"> -<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> -</fo:list-item-label> -<fo:list-item-body start-indent="body-start()"> -<fo:block>text-indent </fo:block> -</fo:list-item-body> -</fo:list-item> - <fo:list-item> -<fo:list-item-label end-indent="label-end()"> -<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> -</fo:list-item-label> -<fo:list-item-body start-indent="body-start()"> -<fo:block>href</fo:block> -</fo:list-item-body> -</fo:list-item> - <fo:list-item> -<fo:list-item-label end-indent="label-end()"> -<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> -</fo:list-item-label> -<fo:list-item-body start-indent="body-start()"> -<fo:block>column-width</fo:block> -</fo:list-item-body> -</fo:list-item> - <fo:list-item> -<fo:list-item-label end-indent="label-end()"> -<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> -</fo:list-item-label> -<fo:list-item-body start-indent="body-start()"> -<fo:block>background-color</fo:block> -</fo:list-item-body> -</fo:list-item> - <fo:list-item> -<fo:list-item-label end-indent="label-end()"> -<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> -</fo:list-item-label> -<fo:list-item-body start-indent="body-start()"> -<fo:block>padding-top (only in conjunction with background color)</fo:block> -</fo:list-item-body> -</fo:list-item> - <fo:list-item> -<fo:list-item-label end-indent="label-end()"> -<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> -</fo:list-item-label> -<fo:list-item-body start-indent="body-start()"> -<fo:block>padding-left (only in conjunction with background color)</fo:block> -</fo:list-item-body> -</fo:list-item> - <fo:list-item> -<fo:list-item-label end-indent="label-end()"> -<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> -</fo:list-item-label> -<fo:list-item-body start-indent="body-start()"> -<fo:block>padding-bottom (only in conjunction with background color)</fo:block> -</fo:list-item-body> -</fo:list-item> - <fo:list-item> -<fo:list-item-label end-indent="label-end()"> -<fo:block><fo:inline font-family="Symbol">•</fo:inline></fo:block> -</fo:list-item-label> -<fo:list-item-body start-indent="body-start()"> -<fo:block>padding-right (only in conjunction with background color)</fo:block> -</fo:list-item-body> -</fo:list-item> - </fo:list-block> - - - - - - - <fo:block id="sec6" font-size="18pt" font-family="serif" line-height="20pt" space-before.optimum="20pt" space-after.optimum="14pt" >F) - Limitations</fo:block> - <fo:block space-after.optimum="3pt" font-family="serif">Although FOP implements the above listed fo objects and properties, sometimes it does so - only in a limited way. - </fo:block> - - <fo:block font-size="16pt" font-family="serif" line-height="18pt" space-before.optimum="8pt" space-after.optimum="8pt" >list-block</fo:block> - <fo:block space-after.optimum="3pt" font-family="serif">The fo working draft allows describes two ways to markup lists.The list-block must have as - children either: 1) pairs of fo:list-item-label and fo:list-item-body formatting objects, or - 2) fo:list-item formatting objects.</fo:block> - <fo:block space-after.optimum="3pt" font-family="serif">At the moment FOP only implements the second way. Therefore a list has a basic structure like this:</fo:block> - <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"><fo:list-block></fo:block> - <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"><fo:list-item></fo:block> - <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"><fo:list-item-label><fo:block></fo:block></fo:list-item-label></fo:block> - <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"><fo:list-item-body><fo:block></fo:block></fo:list-item-body></fo:block> - <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"></fo:list-item></fo:block> - <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"></fo:list-block></fo:block> - - - <fo:block font-size="16pt" font-family="serif" line-height="18pt" space-before.optimum="8pt" space-after.optimum="8pt" >Padding</fo:block> - <fo:block space-after.optimum="3pt" font-family="serif">Padding works in conjunction with indents and spaces. It is only implemented - for blocks. At the moment padding can't be used to make extra space (indents+spaces - must be used), but only to control how much the background-color extends beyond - the content rectangle. - </fo:block> - - - <fo:block font-size="16pt" font-family="serif" line-height="18pt" space-before.optimum="8pt" space-after.optimum="8pt" >Tables</fo:block> - <fo:block space-after.optimum="3pt" font-family="serif">There two limitations for tables: 1) FOP needs you to explicitly specify column widths - 2) Cells have to contain block-level FOs. They can't contain straight character data. - </fo:block> - <fo:block space-after.optimum="3pt" font-family="serif">A working basic example of a table looks like this: </fo:block> - <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"><fo:table></fo:block> - <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> <fo:table-column column-width="150pt"/></fo:block> - <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> <fo:table-column column-width="150pt"/></fo:block> - <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> <fo:table-body font-size="10pt" font-family="sans-serif"></fo:block> - <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> <fo:table-row></fo:block> - <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> <fo:table-cell></fo:block> - <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> <fo:block>text</fo:block></fo:block> - <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-before.optimum="0pt" space-after.optimum="0pt"> </fo:table-cell></fo:block> - <fo:block font-size="10pt" font-family="monospace" line-height="12pt" space-be... [truncated message content] |
|
From: <vic...@us...> - 2006-03-14 00:28:25
|
Revision: 6947 Author: victormote Date: 2006-03-13 16:28:20 -0800 (Mon, 13 Mar 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=6947&view=rev Log Message: ----------- Beautify the output a bit. Modified Paths: -------------- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFOutlineItem.java Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFOutlineItem.java =================================================================== --- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFOutlineItem.java 2006-03-14 00:20:43 UTC (rev 6946) +++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFOutlineItem.java 2006-03-14 00:28:20 UTC (rev 6947) @@ -210,35 +210,35 @@ result.append(this.pdfID() + EOL + "<<" + EOL); int countDescendants = this.count(); // subentry Outline object - result.append(" /Title " + title.toPDF() + EOL); - result.append(" /Parent " + parent.pdfReference() + EOL); + result.append(" /Title " + title.toPDF() + EOL); + result.append(" /Parent " + parent.pdfReference() + EOL); if (getFirst() != null && getLast() != null) { - result.append(" /First " + getFirst().pdfReference() + EOL); - result.append(" /Last " + getLast().pdfReference() + EOL); + result.append(" /First " + getFirst().pdfReference() + EOL); + result.append(" /Last " + getLast().pdfReference() + EOL); } if (getPrevious() != null) { - result.append(" /Prev " + getPrevious().pdfReference() + EOL); + result.append(" /Prev " + getPrevious().pdfReference() + EOL); } if (getNext() != null) { - result.append(" /Next " + getNext().pdfReference() + EOL); + result.append(" /Next " + getNext().pdfReference() + EOL); } if (countDescendants > 0) { - result.append(" /Count -" + countDescendants + EOL); + result.append(" /Count -" + countDescendants + EOL); } if (this.destinationString != null) { - result.append("/Dest " + this.destinationString.toPDF() + result.append(" /Dest " + this.destinationString.toPDF() + EOL); } else if (this.destination != null) { - result.append("/Dest " + this.destination.toPDF()); + result.append(" /Dest " + this.destination.toPDF()); } else if (this.action != null) { - result.append("/A " + this.action.toPDF()); + result.append(" /A " + this.action.toPDF()); } if (this.color != null && ! this.color.isBlack()) { - result.append("/C " + this.color.toPDF() + EOL); + result.append(" /C " + this.color.toPDF() + EOL); } if (this.flags() != 0) { - result.append("/F " + this.flags() + EOL); + result.append(" /F " + this.flags() + EOL); } result.append(">> endobj" + EOL); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-03-14 00:20:47
|
Revision: 6946 Author: victormote Date: 2006-03-13 16:20:43 -0800 (Mon, 13 Mar 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=6946&view=rev Log Message: ----------- Make sure that any objects written as "last" objects get their referenced objects written as well. Modified Paths: -------------- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFDocument.java Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFDocument.java =================================================================== --- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFDocument.java 2006-03-14 00:18:20 UTC (rev 6945) +++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFDocument.java 2006-03-14 00:20:43 UTC (rev 6946) @@ -337,6 +337,7 @@ recordLocation(o); this.position += o.output(stream); } + writeIndirectObjects(stream); /* remember position of xref table */ int xrefPosition = this.position; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-03-14 00:18:25
|
Revision: 6945 Author: victormote Date: 2006-03-13 16:18:20 -0800 (Mon, 13 Mar 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=6945&view=rev Log Message: ----------- Add the Type entry to dictionary. Modified Paths: -------------- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFOutline.java Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFOutline.java =================================================================== --- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFOutline.java 2006-03-13 23:49:08 UTC (rev 6944) +++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFOutline.java 2006-03-14 00:18:20 UTC (rev 6945) @@ -47,13 +47,15 @@ */ protected String toPDF() { StringBuffer result = new StringBuffer(); - result.append(this.pdfID() + EOL + "<<" + EOL); + result.append(this.pdfID() + EOL); + result.append("<<" + EOL); + result.append(" /Type Outlines" + EOL); if (getFirst() != null && getLast() != null) { - result.append(" /First " + getFirst().pdfReference() + EOL); - result.append(" /Last " + getLast().pdfReference() + EOL); + result.append(" /First " + getFirst().pdfReference() + EOL); + result.append(" /Last " + getLast().pdfReference() + EOL); } if (count() > 0) { - result.append(" /Count " + count() + EOL); + result.append(" /Count " + count() + EOL); } result.append(">> endobj" + EOL); return result.toString(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-03-13 23:49:21
|
Revision: 6944 Author: victormote Date: 2006-03-13 15:49:08 -0800 (Mon, 13 Mar 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=6944&view=rev Log Message: ----------- Implement the axsl interface. Modified Paths: -------------- trunk/foray/foray-areatree/src/java/org/foray/area/BookmarkTreeArea.java Modified: trunk/foray/foray-areatree/src/java/org/foray/area/BookmarkTreeArea.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/BookmarkTreeArea.java 2006-03-13 23:31:04 UTC (rev 6943) +++ trunk/foray/foray-areatree/src/java/org/foray/area/BookmarkTreeArea.java 2006-03-13 23:49:08 UTC (rev 6944) @@ -29,7 +29,8 @@ /** * A NonArea class for items generated by fo:bookmark-tree. */ -public class BookmarkTreeArea extends NonArea { +public class BookmarkTreeArea extends NonArea + implements org.axsl.areaOut.BookmarkTreeArea { public BookmarkTreeArea(BookmarkTree generatedBy, AreaNode parent) { super(generatedBy, parent); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-03-13 23:31:16
|
Revision: 6943 Author: victormote Date: 2006-03-13 15:31:04 -0800 (Mon, 13 Mar 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=6943&view=rev Log Message: ----------- Conform to axsl changes. Modified Paths: -------------- trunk/foray/foray-pdf/src/java/org/foray/pdf/FOrayPDFFactory.java trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/FOrayPDFFactory.java =================================================================== --- trunk/foray/foray-pdf/src/java/org/foray/pdf/FOrayPDFFactory.java 2006-03-13 23:03:15 UTC (rev 6942) +++ trunk/foray/foray-pdf/src/java/org/foray/pdf/FOrayPDFFactory.java 2006-03-13 23:31:04 UTC (rev 6943) @@ -29,9 +29,13 @@ import org.axsl.pdf.PDFEncryption; import org.axsl.pdf.PDFException; import org.axsl.pdf.PDFFactory; +import org.axsl.pdf.PDFOutlineItem; +import org.axsl.pdf.PDFOutlineParent; import org.apache.commons.logging.Log; +import java.awt.Color; + public class FOrayPDFFactory implements PDFFactory { FontConsumer fontConsumer; @@ -65,4 +69,24 @@ return new org.foray.pdf.object.PDFEncryption(forayPDFDocument); } + /** + * {@inheritDoc} + */ + public PDFOutlineItem createPDFOutlineItem(PDFDocument document, + PDFOutlineParent parent, String titleText, + String internalDestination, Color color, boolean italic, + boolean bold) throws PDFException { + org.foray.pdf.object.PDFDocument forayPDFDocument + = getFOrayPDFDocument(document); + if (! (parent instanceof org.foray.pdf.object.PDFOutlineParent)) { + throw new PDFException("Unsupported PDFOutlineParent " + + "implementation."); + } + org.foray.pdf.object.PDFOutlineParent forayOutlineParent + = (org.foray.pdf.object.PDFOutlineParent) parent; + return new org.foray.pdf.object.PDFOutlineItem(forayPDFDocument, + forayOutlineParent, titleText, internalDestination, color, + italic, bold); + } + } Modified: trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java =================================================================== --- trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2006-03-13 23:03:15 UTC (rev 6942) +++ trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2006-03-13 23:31:04 UTC (rev 6943) @@ -38,8 +38,6 @@ import org.foray.pdf.object.PDFExplicitDestination; import org.foray.pdf.object.PDFFont; import org.foray.pdf.object.PDFNamedDestination; -import org.foray.pdf.object.PDFOutlineItem; -import org.foray.pdf.object.PDFOutlineParent; import org.foray.pdf.object.PDFPage; import org.foray.pdf.object.PDFPathPaint; import org.foray.render.PrintRenderer; @@ -62,6 +60,8 @@ import org.axsl.pdf.PDFEncryption; import org.axsl.pdf.PDFException; import org.axsl.pdf.PDFFactory; +import org.axsl.pdf.PDFOutlineItem; +import org.axsl.pdf.PDFOutlineParent; import org.axsl.pdf.PDFUtility; import java.awt.Color; @@ -465,9 +465,14 @@ if (title.traitFontWeight() >= 700) { bold = true; } - PDFOutlineItem pdfOutline = new PDFOutlineItem(pdfDoc, parent, - title.getTitleText(), area.traitInternalDestination(), color, - italic, bold); + PDFOutlineItem pdfOutline = null; + try { + pdfOutline = this.pdfFactory.createPDFOutlineItem(pdfDoc, + parent, title.getTitleText(), area.traitInternalDestination(), + color, italic, bold); + } catch (PDFException e) { + /* Ignore this. It should never happen. */ + } // Recursively handle child bookmarks List children = area.getChildren(); for (int i = 0; i < children.size(); i++) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-03-13 23:03:30
|
Revision: 6942 Author: victormote Date: 2006-03-13 15:03:15 -0800 (Mon, 13 Mar 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=6942&view=rev Log Message: ----------- Conform to axsl changes. Modified Paths: -------------- trunk/foray/foray-pdf/src/java/org/foray/pdf/PDFGraphicsState.java trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFContentStream.java trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFFont.java trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFString.java trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFGraphics2D.java trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/PDFGraphicsState.java =================================================================== --- trunk/foray/foray-pdf/src/java/org/foray/pdf/PDFGraphicsState.java 2006-03-13 22:25:28 UTC (rev 6941) +++ trunk/foray/foray-pdf/src/java/org/foray/pdf/PDFGraphicsState.java 2006-03-13 23:03:15 UTC (rev 6942) @@ -24,9 +24,11 @@ package org.foray.pdf; -import org.foray.pdf.object.PDFColor; -import org.foray.pdf.object.PDFFont; +import org.axsl.pdf.PDFColor; +import org.axsl.pdf.PDFFont; +import java.awt.Color; + /** * Represents a PDF Graphics State object. The Graphics State is ordinarily * used by PDF viewer applications. Our application is instead a PDF writing @@ -61,8 +63,8 @@ * PDF Reference, 3rd Edition, Section 4.3. */ public void reset() { - this.strokeColor = PDFColor.PDF_RGB_BLACK; - this.fillColor = PDFColor.PDF_RGB_BLACK; + this.strokeColor = new org.foray.pdf.object.PDFColor(Color.BLACK); + this.fillColor = new org.foray.pdf.object.PDFColor(Color.BLACK); this.characterSpacing = 0; this.wordSpacing = 0; this.font = null; Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFContentStream.java =================================================================== --- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFContentStream.java 2006-03-13 22:25:28 UTC (rev 6941) +++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFContentStream.java 2006-03-13 23:03:15 UTC (rev 6942) @@ -35,6 +35,8 @@ import org.axsl.graphic.Graphic; import org.axsl.graphic.GraphicException; import org.axsl.graphic.SVGGraphic; +import org.axsl.pdf.PDFColor; +import org.axsl.pdf.PDFFont; import org.axsl.pdf.PDFPathPaint; import org.apache.batik.bridge.BridgeContext; @@ -173,6 +175,9 @@ add("] " + dashPhase + " d" + EOL); } + /** + * {@inheritDoc} + */ public void drawLine(Line2D.Float line, float thickness, float[] dashArray, float dashPhase, PDFPathPaint stroke) { closeTextObject(); @@ -185,6 +190,9 @@ add("Q" + EOL); } + /** + * {@inheritDoc} + */ public void drawRectangle(Rectangle2D.Float rectangle, boolean stroke, PDFPathPaint strokePaint, boolean fill, PDFPathPaint fillPaint) { // Bail out if stroke and fill are both missing. @@ -219,7 +227,7 @@ } /** - * @param image + * {@inheritDoc} */ public void drawGraphic(Rectangle2D.Float contentRectangle, Rectangle2D.Float clipRectangle, Graphic image, @@ -261,9 +269,7 @@ } /** - * render SVG document to PDF - * - * @param doc The document to render + * {@inheritDoc} */ public void drawSVGDocument(SVGDocument doc, Rectangle2D.Float contentRectangle, Rectangle2D.Float clipRectangle, Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFFont.java =================================================================== --- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFFont.java 2006-03-13 22:25:28 UTC (rev 6941) +++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFFont.java 2006-03-13 23:03:15 UTC (rev 6942) @@ -344,6 +344,10 @@ return fsFont; } + public FontUse getFontUse() { + return this.fsFont; + } + public FontPDF getFontOutput() { if (this.fontOutput == null) { this.fontOutput = (FontPDF) fsFont.getFontOutput("application/pdf"); Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFString.java =================================================================== --- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFString.java 2006-03-13 22:25:28 UTC (rev 6941) +++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFString.java 2006-03-13 23:03:15 UTC (rev 6942) @@ -28,6 +28,7 @@ import org.axsl.font.Font; import org.axsl.font.FontUse; +import org.axsl.pdf.PDFFont; /** * A PDF String Object, as defined in PDF Reference, 2nd edition, Section 3.2.3. @@ -49,7 +50,7 @@ StringBuffer buffer = new StringBuffer(); buffer.append("["); buffer.append(startTextDelimiter()); - FontUse font = this.font.fsFont; + FontUse font = this.font.getFontUse(); for (int i = 0; i < theString.length(); i++) { int codePoint = StringUtilPre5.codePointAt(theString, i); if (StringUtilPre5.isSupplementaryCodePoint(codePoint)) { @@ -73,7 +74,7 @@ * @param glyphIndex */ private void addCharToBuffer(StringBuffer buffer, int glyphIndex) { - Font font = this.font.fsFont.getFont(); + Font font = this.font.getFontUse().getFont(); if (font.getFontComplexity() == Font.FONT_COMPOSITE) { buffer.append(PDFString.getUnicodeString(glyphIndex)); return; @@ -123,7 +124,7 @@ } private char startTextDelimiter() { - Font font = this.font.fsFont.getFont(); + Font font = this.font.getFontUse().getFont(); if (font.getFontComplexity() == Font.FONT_COMPOSITE) { return '<'; } @@ -131,7 +132,7 @@ } private char endTextDelimiter() { - Font font = this.font.fsFont.getFont(); + Font font = this.font.getFontUse().getFont(); if (font.getFontComplexity() == Font.FONT_COMPOSITE) { return '>'; } Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFGraphics2D.java =================================================================== --- trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFGraphics2D.java 2006-03-13 22:25:28 UTC (rev 6941) +++ trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFGraphics2D.java 2006-03-13 23:03:15 UTC (rev 6942) @@ -145,7 +145,7 @@ float fontSize, SVGDocument svgDocument) { super(textAsShapes); pdfDoc = doc; - currentFont = doc.getCurrentGraphicsState().getFont().getFsFont(); + currentFont = doc.getCurrentGraphicsState().getFont().getFontUse(); currentFontSize = doc.getCurrentGraphicsState().getFontSize(); this.font = font; this.fontSize = fontSize; Modified: trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java =================================================================== --- trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2006-03-13 22:25:28 UTC (rev 6941) +++ trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2006-03-13 23:03:15 UTC (rev 6942) @@ -34,7 +34,6 @@ import org.foray.output.OutputConfig; import org.foray.pdf.FOrayPDFFactory; import org.foray.pdf.object.PDFColor; -import org.foray.pdf.object.PDFContentStream; import org.foray.pdf.object.PDFDocument; import org.foray.pdf.object.PDFExplicitDestination; import org.foray.pdf.object.PDFFont; @@ -59,6 +58,7 @@ import org.axsl.common.Constants; import org.axsl.font.FontUse; import org.axsl.graphic.Graphic; +import org.axsl.pdf.PDFContentStream; import org.axsl.pdf.PDFEncryption; import org.axsl.pdf.PDFException; import org.axsl.pdf.PDFFactory; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-03-13 22:25:40
|
Revision: 6941 Author: victormote Date: 2006-03-13 14:25:28 -0800 (Mon, 13 Mar 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=6941&view=rev Log Message: ----------- Simplify some method signatures by having each PDFContentStream cache the PDFPage that it is related to. Modified Paths: -------------- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFContentStream.java trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFPage.java trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFContentStream.java =================================================================== --- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFContentStream.java 2006-03-13 22:17:17 UTC (rev 6940) +++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFContentStream.java 2006-03-13 22:25:28 UTC (rev 6941) @@ -57,13 +57,17 @@ public class PDFContentStream extends PDFStream implements org.axsl.pdf.PDFContentStream { + /** The page this content stream is attached to. */ + PDFPage page; + boolean textObjectOpen = false; /** * Create a PDFContentStream. */ - public PDFContentStream(PDFDocument doc) { + public PDFContentStream(PDFDocument doc, PDFPage page) { super(doc); + this.page = page; } private PDFGraphicsState getGS() { @@ -220,12 +224,12 @@ public void drawGraphic(Rectangle2D.Float contentRectangle, Rectangle2D.Float clipRectangle, Graphic image, FontUse font, float fontSize, float letterSpacing, - boolean strokeSVGText, PDFAnnotList annotList) { + boolean strokeSVGText) { if (image instanceof SVGGraphic) { try { SVGDocument svg = ((SVGGraphic) image).getSVGDocument(); drawSVGDocument(svg, contentRectangle, clipRectangle, font, fontSize, - letterSpacing, strokeSVGText, annotList); + letterSpacing, strokeSVGText); } catch (GraphicException e) {} return; } @@ -264,7 +268,7 @@ public void drawSVGDocument(SVGDocument doc, Rectangle2D.Float contentRectangle, Rectangle2D.Float clipRectangle, FontUse font, float fontSize, float letterSpacing, - boolean strokeSVGText, PDFAnnotList annotList) { + boolean strokeSVGText) { closeTextObject(); PDFGraphics2D graphics = getPDFContent4SVG(contentRectangle, font, fontSize, letterSpacing, doc, strokeSVGText); @@ -291,7 +295,7 @@ add("Q" + EOL); // Add annotation accumulated to the list for the current page. - annotList.addAnnotationList(graphics.getAnnotList()); + this.page.getAnnotList().addAnnotationList(graphics.getAnnotList()); } private void clip(Rectangle2D.Float clipRectangle, Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFPage.java =================================================================== --- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFPage.java 2006-03-13 22:17:17 UTC (rev 6940) +++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFPage.java 2006-03-13 22:25:28 UTC (rev 6941) @@ -83,7 +83,7 @@ this.resources = resources; this.pagewidth = pagewidth; this.pageheight = pageheight; - this.contents = new PDFContentStream(this.getPDFDocument()); + this.contents = new PDFContentStream(this.getPDFDocument(), this); this.contents.addDefaultFilters(); PDFEncryption encryption = this.getPDFDocument().getEncryption(); if (encryption != null) { Modified: trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java =================================================================== --- trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2006-03-13 22:17:17 UTC (rev 6940) +++ trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2006-03-13 22:25:28 UTC (rev 6941) @@ -241,7 +241,7 @@ float letterSpacing = area.actualLetterSpacing() / 1000f; getContentStream().drawGraphic(pdfContentRectangle, pdfClipRectangle, image, font, fontSize, letterSpacing, - outputControl.strokeSVGText(), currentPage.getAnnotList()); + outputControl.strokeSVGText()); } /** @@ -267,8 +267,7 @@ float letterSpacing = area.actualLetterSpacing() / 1000f; getContentStream().drawSVGDocument(area.getSVGDocument(), contentRectangle, null, font, fontSize, letterSpacing, - outputControl.strokeSVGText(), - currentPage.getAnnotList()); + outputControl.strokeSVGText()); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-03-13 22:17:22
|
Revision: 6940 Author: victormote Date: 2006-03-13 14:17:17 -0800 (Mon, 13 Mar 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=6940&view=rev Log Message: ----------- Conform to axsl changes. Modified Paths: -------------- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFContentStream.java trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFPathPaint.java Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFContentStream.java =================================================================== --- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFContentStream.java 2006-03-13 22:01:50 UTC (rev 6939) +++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFContentStream.java 2006-03-13 22:17:17 UTC (rev 6940) @@ -35,6 +35,7 @@ import org.axsl.graphic.Graphic; import org.axsl.graphic.GraphicException; import org.axsl.graphic.SVGGraphic; +import org.axsl.pdf.PDFPathPaint; import org.apache.batik.bridge.BridgeContext; import org.apache.batik.bridge.GVTBuilder; Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFPathPaint.java =================================================================== --- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFPathPaint.java 2006-03-13 22:01:50 UTC (rev 6939) +++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFPathPaint.java 2006-03-13 22:17:17 UTC (rev 6940) @@ -41,6 +41,9 @@ // do nothing } + /** + * {@inheritDoc} + */ public String getColorSpaceOut(boolean fillNotStroke) { return (""); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-03-13 22:02:03
|
Revision: 6939 Author: victormote Date: 2006-03-13 14:01:50 -0800 (Mon, 13 Mar 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=6939&view=rev Log Message: ----------- Conform to axsl changes. Modified Paths: -------------- trunk/foray/foray-pdf/src/java/org/foray/pdf/FOrayPDFFactory.java trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFDocument.java trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/FOrayPDFFactory.java =================================================================== --- trunk/foray/foray-pdf/src/java/org/foray/pdf/FOrayPDFFactory.java 2006-03-13 21:20:18 UTC (rev 6938) +++ trunk/foray/foray-pdf/src/java/org/foray/pdf/FOrayPDFFactory.java 2006-03-13 22:01:50 UTC (rev 6939) @@ -43,8 +43,8 @@ } public PDFDocument createPDFDocument() { - // TODO Auto-generated method stub - return null; + return new org.foray.pdf.object.PDFDocument(this.fontConsumer, + this.logger); } private org.foray.pdf.object.PDFDocument getFOrayPDFDocument( Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFDocument.java =================================================================== --- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFDocument.java 2006-03-13 21:20:18 UTC (rev 6938) +++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFDocument.java 2006-03-13 22:01:50 UTC (rev 6939) @@ -48,6 +48,7 @@ import java.io.UnsupportedEncodingException; import java.net.URL; import java.util.ArrayList; +import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -71,31 +72,6 @@ * bytes. */ public static final String ENCODING = "ISO-8859-1"; - /** Constant indicating version 1.3 of the PDF spec. Note that the - * version-related constants are integrals, for easier comparison during - * evaluation. */ - public static final byte PDF_VERSION_1_3 = 0; - /** Constant indicating version 1.4 of the PDF spec. */ - public static final byte PDF_VERSION_1_4 = 1; - /** Constant indicating version 1.5 of the PDF spec. */ - public static final byte PDF_VERSION_1_5 = 2; - /** Constant indicating version 1.6 of the PDF spec. */ - public static final byte PDF_VERSION_1_6 = 3; - - private static final byte[] validVersions = { - PDF_VERSION_1_3, - PDF_VERSION_1_4, - PDF_VERSION_1_5, - PDF_VERSION_1_6 - }; - - private static final String[] versionStrings = { - "1.3", - "1.4", - "1.5", - "1.6", - }; - /** The version of PDF that this document should create when it is * written. */ private int pdfVersion = PDF_VERSION_1_6; @@ -240,17 +216,8 @@ } /** - * Sets the PDF version that should be created when this document is - * written. + * {@inheritDoc} * If not set, the default value is PDF_VERSION_1_6. - * Note that setting this value to a lower version will only eliminate - * features that are known to cause problems in PDF applications supporting - * a lower version. - * If a feature is not supported in a lower version, but causes no problems - * for that lower version, it will be included, so that applications - * supporting higher versions may take advantage of it. - * @param newVersion One of #PDF_VERSION_1_3, #PDF_VERSION_1_4, - * #PDF_VERSION_1_5, or #PDF_VERSION_1_6. */ public void setVersion(int newVersion) throws PDFException { if (newVersion >= 0 && newVersion < validVersions.length) { @@ -339,9 +306,7 @@ } /** - * Writes the PDF header. This method must be called prior to formatting - * and outputting AreaTrees. - * @param stream The OutputStream to write the header to. + * {@inheritDoc} */ public void outputHeader(OutputStream stream) throws IOException { this.position = 0; @@ -517,6 +482,9 @@ return filters; } + /** + * {@inheritDoc} + */ public void addDefaultFilter(String filterToAdd) { if (filterToAdd == null) { return; @@ -577,23 +545,6 @@ return (PDFXObject) xObjectsMap.get(url); } - /** - * For a given String, finds the version constant that represents that - * version. - * @param stringVersion The String representing the version. Valid values - * include "1.3", "1.4", "1.5", and "1.6". - * @return The integral constant used to represent #stringVersion, or -1 - * if none exists. - */ - public static int integralVersion(String stringVersion) { - for (int i = 0; i < versionStrings.length; i++) { - if (stringVersion.equals(versionStrings[i])) { - return i; - } - } - return -1; - } - public PDFEncoding obtainPDFEncoding(Encoding encoding) { if (encoding == null) { return null; @@ -607,7 +558,8 @@ return pdfEncoding; } - public PDFFont getPDFFont(FontUse fontUse) throws PDFException { + public PDFFont getPDFFont(FontUse fontUse) + throws PDFException { Font font = fontUse.getFont(); if (! font.isEmbeddable() && ! font.isPDFStandardFont()) { throw new PDFException("Font is not embeddable."); @@ -629,4 +581,18 @@ return pdfFont; } + /** + * {@inheritDoc} + */ + public void setProducer(String producer) { + this.getInfo().setProducer(producer); + } + + /** + * {@inheritDoc} + */ + public void setCreationDate(Date creationDate) { + this.getInfo().setCreationDate(creationDate); + } + } Modified: trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java =================================================================== --- trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2006-03-13 21:20:18 UTC (rev 6938) +++ trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2006-03-13 22:01:50 UTC (rev 6939) @@ -62,6 +62,7 @@ import org.axsl.pdf.PDFEncryption; import org.axsl.pdf.PDFException; import org.axsl.pdf.PDFFactory; +import org.axsl.pdf.PDFUtility; import java.awt.Color; import java.awt.Rectangle; @@ -134,10 +135,11 @@ */ public void startOutput() throws IOException { this.pdfFactory = new FOrayPDFFactory(getFontConsumer(), getLogger()); +// this.pdfDoc = this.pdfFactory.createPDFDocument(); this.pdfDoc = new PDFDocument(getFontConsumer(), getLogger()); String pdfVersion = this.options.optionPDFVersion(); if (pdfVersion != null) { - int pdfVersionConstant = PDFDocument.integralVersion(pdfVersion); + int pdfVersionConstant = PDFUtility.integralVersion(pdfVersion); try { this.pdfDoc.setVersion(pdfVersionConstant); } catch (PDFException e) { @@ -145,11 +147,11 @@ getLogger().error("Unsupported PDF Version: " + pdfVersion); } } - this.pdfDoc.getInfo().setProducer( + this.pdfDoc.setProducer( getOutputControl().getApplicationNameShort() + " " + getOutputControl().getVersion()); Date now = new Date(); - pdfDoc.getInfo().setCreationDate(now); + this.pdfDoc.setCreationDate(now); // setup Encryption addEncryption(); List filters = this.options.optionPDFFilters(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-03-13 21:20:32
|
Revision: 6938 Author: victormote Date: 2006-03-13 13:20:18 -0800 (Mon, 13 Mar 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=6938&view=rev Log Message: ----------- Make PDFRenderer create its own PDFFactory. Modified Paths: -------------- trunk/foray/foray-app/.classpath trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java trunk/foray/foray-pdf/src/java/org/foray/pdf/FOrayPDFFactory.java trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java Modified: trunk/foray/foray-app/.classpath =================================================================== --- trunk/foray/foray-app/.classpath 2006-03-13 20:48:32 UTC (rev 6937) +++ trunk/foray/foray-app/.classpath 2006-03-13 21:20:18 UTC (rev 6938) @@ -11,7 +11,6 @@ <classpathentry kind="src" path="/FOrayPioneer"/> <classpathentry kind="src" path="/axslFont"/> <classpathentry kind="src" path="/axslGraphic"/> - <classpathentry kind="src" path="/FOrayPDF"/> <classpathentry kind="src" path="/axslAreaOut"/> <classpathentry kind="src" path="/FOrayOutput"/> <classpathentry kind="src" path="/axslFOTree"/> @@ -26,6 +25,5 @@ <classpathentry kind="var" path="FORAY_LIB_ROOT/resolver.jar"/> <classpathentry kind="var" path="FORAY_LIB_ROOT/xml-apis-1.3.02.jar"/> <classpathentry kind="var" path="FORAY_LIB_ROOT/commons-logging.jar"/> - <classpathentry combineaccessrules="false" kind="src" path="/axslPDF"/> <classpathentry kind="output" path="build/eclipse"/> </classpath> Modified: trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java 2006-03-13 20:48:32 UTC (rev 6937) +++ trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java 2006-03-13 21:20:18 UTC (rev 6938) @@ -37,7 +37,6 @@ import org.foray.output.OutputConfig; import org.foray.output.OutputControl; import org.foray.output.OutputTarget; -import org.foray.pdf.FOrayPDFFactory; import org.foray.pioneer.PioneerLS; import org.foray.render.Renderer; import org.foray.render.awt.AWTRenderer; @@ -550,8 +549,7 @@ break; } default: { - FOrayPDFFactory pdfFactory = new FOrayPDFFactory(); - renderer = new PDFRenderer(outputOptions, pdfFactory); + renderer = new PDFRenderer(outputOptions); break; } } Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/FOrayPDFFactory.java =================================================================== --- trunk/foray/foray-pdf/src/java/org/foray/pdf/FOrayPDFFactory.java 2006-03-13 20:48:32 UTC (rev 6937) +++ trunk/foray/foray-pdf/src/java/org/foray/pdf/FOrayPDFFactory.java 2006-03-13 21:20:18 UTC (rev 6938) @@ -24,14 +24,22 @@ package org.foray.pdf; +import org.axsl.font.FontConsumer; import org.axsl.pdf.PDFDocument; import org.axsl.pdf.PDFEncryption; import org.axsl.pdf.PDFException; import org.axsl.pdf.PDFFactory; +import org.apache.commons.logging.Log; + public class FOrayPDFFactory implements PDFFactory { - public FOrayPDFFactory() { + FontConsumer fontConsumer; + Log logger; + + public FOrayPDFFactory(FontConsumer fontConsumer, Log logger) { + this.fontConsumer = fontConsumer; + this.logger = logger; } public PDFDocument createPDFDocument() { Modified: trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java =================================================================== --- trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2006-03-13 20:48:32 UTC (rev 6937) +++ trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2006-03-13 21:20:18 UTC (rev 6938) @@ -32,6 +32,7 @@ import org.foray.common.FOrayException; import org.foray.common.StringUtilPre5; import org.foray.output.OutputConfig; +import org.foray.pdf.FOrayPDFFactory; import org.foray.pdf.object.PDFColor; import org.foray.pdf.object.PDFContentStream; import org.foray.pdf.object.PDFDocument; @@ -87,9 +88,8 @@ /** * Create a PDF renderer. */ - public PDFRenderer(OutputConfig renderConfig, PDFFactory pdfFactory) { + public PDFRenderer(OutputConfig renderConfig) { super(renderConfig); - this.pdfFactory = pdfFactory; } private void addEncryption() { @@ -133,6 +133,7 @@ * {@inheritDoc} */ public void startOutput() throws IOException { + this.pdfFactory = new FOrayPDFFactory(getFontConsumer(), getLogger()); this.pdfDoc = new PDFDocument(getFontConsumer(), getLogger()); String pdfVersion = this.options.optionPDFVersion(); if (pdfVersion != null) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-03-13 20:48:43
|
Revision: 6937 Author: victormote Date: 2006-03-13 12:48:32 -0800 (Mon, 13 Mar 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=6937&view=rev Log Message: ----------- Conform to changes in axsl. Modified Paths: -------------- trunk/foray/foray-pdf/src/java/org/foray/pdf/PDFGraphicsState.java trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/PDFGraphicsState.java =================================================================== --- trunk/foray/foray-pdf/src/java/org/foray/pdf/PDFGraphicsState.java 2006-03-13 20:39:13 UTC (rev 6936) +++ trunk/foray/foray-pdf/src/java/org/foray/pdf/PDFGraphicsState.java 2006-03-13 20:48:32 UTC (rev 6937) @@ -34,7 +34,7 @@ * it allows us to avoid writing operators that change the Graphics State * unnecessarily. */ -public class PDFGraphicsState implements org.axsl.pdf.PDFGraphicsState { +public class PDFGraphicsState { private PDFColor strokeColor; /** The "non-stroke" or "other" color. */ Modified: trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java =================================================================== --- trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2006-03-13 20:39:13 UTC (rev 6936) +++ trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2006-03-13 20:48:32 UTC (rev 6937) @@ -32,7 +32,6 @@ import org.foray.common.FOrayException; import org.foray.common.StringUtilPre5; import org.foray.output.OutputConfig; -import org.foray.pdf.PDFGraphicsState; import org.foray.pdf.object.PDFColor; import org.foray.pdf.object.PDFContentStream; import org.foray.pdf.object.PDFDocument; @@ -487,10 +486,6 @@ return this.pdfDoc; } - public PDFGraphicsState getGraphicsState() { - return this.pdfDoc.getCurrentGraphicsState(); - } - private PDFContentStream getContentStream() { return this.currentPage.getContentStream(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <vic...@us...> - 2006-03-13 20:39:28
|
Revision: 6936 Author: victormote Date: 2006-03-13 12:39:13 -0800 (Mon, 13 Mar 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=6936&view=rev Log Message: ----------- 1. Conform to aXSL changes. 2. Use the FOrayPDFFactory. Modified Paths: -------------- trunk/foray/foray-app/.classpath trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFEncryption.java trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java Modified: trunk/foray/foray-app/.classpath =================================================================== --- trunk/foray/foray-app/.classpath 2006-03-13 20:35:14 UTC (rev 6935) +++ trunk/foray/foray-app/.classpath 2006-03-13 20:39:13 UTC (rev 6936) @@ -26,5 +26,6 @@ <classpathentry kind="var" path="FORAY_LIB_ROOT/resolver.jar"/> <classpathentry kind="var" path="FORAY_LIB_ROOT/xml-apis-1.3.02.jar"/> <classpathentry kind="var" path="FORAY_LIB_ROOT/commons-logging.jar"/> + <classpathentry combineaccessrules="false" kind="src" path="/axslPDF"/> <classpathentry kind="output" path="build/eclipse"/> </classpath> Modified: trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java 2006-03-13 20:35:14 UTC (rev 6935) +++ trunk/foray/foray-app/src/java/org/foray/app/FOrayTarget.java 2006-03-13 20:39:13 UTC (rev 6936) @@ -37,6 +37,7 @@ import org.foray.output.OutputConfig; import org.foray.output.OutputControl; import org.foray.output.OutputTarget; +import org.foray.pdf.FOrayPDFFactory; import org.foray.pioneer.PioneerLS; import org.foray.render.Renderer; import org.foray.render.awt.AWTRenderer; @@ -549,7 +550,8 @@ break; } default: { - renderer = new PDFRenderer(outputOptions); + FOrayPDFFactory pdfFactory = new FOrayPDFFactory(); + renderer = new PDFRenderer(outputOptions, pdfFactory); break; } } Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFEncryption.java =================================================================== --- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFEncryption.java 2006-03-13 20:35:14 UTC (rev 6935) +++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFEncryption.java 2006-03-13 20:39:13 UTC (rev 6936) @@ -141,9 +141,7 @@ } /** - * This method allows the setting of the user password - * @param value The string to use as the user password. It may be blank but - * not null. + * {@inheritDoc} */ public void setUserPassword(String value) { this.userPassword = value; @@ -156,8 +154,8 @@ return this.userPassword; } - /** Sets the owner password for the PDF - * @param value The owner password + /** + * {@inheritDoc} */ public void setOwnerPassword(String value) { this.ownerPassword = value; @@ -170,24 +168,27 @@ return this.ownerPassword; } - /** Set whether the document will allow printing. - * @param value The new permision value + /** + * {@inheritDoc} */ public void setAllowPrint(boolean value) { this.allowPrint = value; } - /** Set whether the document will allow the content to be extracted - * @param value The new permission value + + /** + * {@inheritDoc} */ public void setAllowCopyContent(boolean value) { this.allowCopyContent = value; } - /** Set whether the document will allow content editting - * @param value The new permission value + + /** + * {@inheritDoc} */ public void setAllowEditContent(boolean value) { this.allowEditContent = value; } + /** Set whether the document will allow annotation modificcations * @param value The new permission value */ Modified: trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java =================================================================== --- trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2006-03-13 20:35:14 UTC (rev 6935) +++ trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java 2006-03-13 20:39:13 UTC (rev 6936) @@ -36,7 +36,6 @@ import org.foray.pdf.object.PDFColor; import org.foray.pdf.object.PDFContentStream; import org.foray.pdf.object.PDFDocument; -import org.foray.pdf.object.PDFEncryption; import org.foray.pdf.object.PDFExplicitDestination; import org.foray.pdf.object.PDFFont; import org.foray.pdf.object.PDFNamedDestination; @@ -60,7 +59,9 @@ import org.axsl.common.Constants; import org.axsl.font.FontUse; import org.axsl.graphic.Graphic; +import org.axsl.pdf.PDFEncryption; import org.axsl.pdf.PDFException; +import org.axsl.pdf.PDFFactory; import java.awt.Color; import java.awt.Rectangle; @@ -75,6 +76,9 @@ */ public class PDFRenderer extends PrintRenderer { + /** The PDFFactory responsible to generate PDF objects. */ + PDFFactory pdfFactory; + /** The PDF Document being created. */ PDFDocument pdfDoc; @@ -84,8 +88,9 @@ /** * Create a PDF renderer. */ - public PDFRenderer(OutputConfig renderConfig) { + public PDFRenderer(OutputConfig renderConfig, PDFFactory pdfFactory) { super(renderConfig); + this.pdfFactory = pdfFactory; } private void addEncryption() { @@ -108,7 +113,13 @@ encrypt = true; } if (encrypt) { - PDFEncryption encryption = new PDFEncryption(this.getPDFDocument()); + PDFEncryption encryption = null; + try { + encryption = this.pdfFactory.createPDFEncryption( + this.getPDFDocument()); + } catch (PDFException e) { + this.getLogger().error("PDF Encryption failed", e); + } encryption.setOwnerPassword(oPassword); encryption.setUserPassword(uPassword); encryption.setAllowPrint(allowPrint); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |