[FOray-commit] SF.net SVN: foray: [6957] trunk/foray/foray-pdf/src/java/org/foray/pdf/object
Modular XSL-FO Implementation for Java.
Status: Alpha
Brought to you by:
victormote
|
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. |