diff options
author | Vincent Hennebert <vhennebert@apache.org> | 2008-07-25 10:55:49 +0000 |
---|---|---|
committer | Vincent Hennebert <vhennebert@apache.org> | 2008-07-25 10:55:49 +0000 |
commit | d058e870151a49af34ec1e7204edd0ffc64aaefc (patch) | |
tree | 14c346af79c0d2207f98b17e1e9f0212c8c32f44 /src/java/org/apache/fop/svg/PDFTranscoder.java | |
parent | cc5d6604bde87fca098633ceccd66fc92808bddc (diff) | |
download | xmlgraphics-fop-d058e870151a49af34ec1e7204edd0ffc64aaefc.tar.gz xmlgraphics-fop-d058e870151a49af34ec1e7204edd0ffc64aaefc.zip |
Merged revisions 679052-679352 via svnmerge from
https://svn.eu.apache.org/repos/asf/xmlgraphics/fop/trunk
........
r679060 | acumiskey | 2008-07-23 11:39:11 +0100 (Wed, 23 Jul 2008) | 2 lines
My bad.. copy paste error I introduced which broke forrest.
........
r679164 | jeremias | 2008-07-23 20:33:24 +0100 (Wed, 23 Jul 2008) | 1 line
Only update the generated files if any source file is newer than the generated ones.
........
r679326 | vhennebert | 2008-07-24 10:35:34 +0100 (Thu, 24 Jul 2008) | 2 lines
Fed up with all those trailing whitespaces. Let's remove them all (once... and for all?)
........
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_AFPGOCAResources@679758 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/svg/PDFTranscoder.java')
-rw-r--r-- | src/java/org/apache/fop/svg/PDFTranscoder.java | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/src/java/org/apache/fop/svg/PDFTranscoder.java b/src/java/org/apache/fop/svg/PDFTranscoder.java index 281df1b1d..333cd5e4c 100644 --- a/src/java/org/apache/fop/svg/PDFTranscoder.java +++ b/src/java/org/apache/fop/svg/PDFTranscoder.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You 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. @@ -78,7 +78,7 @@ import org.apache.fop.fonts.FontInfo; * <tt>KEY_USER_STYLESHEET_URI</tt> to fix the URI of a user * stylesheet, and <tt>KEY_PIXEL_TO_MM</tt> to specify the pixel to * millimeter conversion factor. - * + * * <p><tt>KEY_AUTO_FONTS</tt> to disable the auto-detection of fonts installed in the system. * The PDF Transcoder cannot use AWT's font subsystem and that's why the fonts have to be * configured differently. By default, font auto-detection is enabled to match the behaviour @@ -93,25 +93,25 @@ public class PDFTranscoder extends AbstractFOPTranscoder /** * The key is used to specify the resolution for on-the-fly images generated - * due to complex effects like gradients and filters. + * due to complex effects like gradients and filters. */ public static final TranscodingHints.Key KEY_DEVICE_RESOLUTION = new FloatKey(); /** * The key is used to specify whether the available fonts should be automatically * detected. The alternative is to configure the transcoder manually using a configuration - * file. + * file. */ public static final TranscodingHints.Key KEY_AUTO_FONTS = new BooleanKey(); private Configuration cfg = null; - + /** Graphics2D instance that is used to paint to */ protected PDFDocumentGraphics2D graphics = null; private ImageManager imageManager; private ImageSessionContext imageSessionContext; - + /** * Constructs a new <tt>PDFTranscoder</tt>. */ @@ -132,7 +132,7 @@ public class PDFTranscoder extends AbstractFOPTranscoder } }; } - + /** {@inheritDoc} */ public void configure(Configuration cfg) throws ConfigurationException { this.cfg = cfg; @@ -147,21 +147,21 @@ public class PDFTranscoder extends AbstractFOPTranscoder * @exception TranscoderException if an error occured while transcoding */ protected void transcode(Document document, String uri, - TranscoderOutput output) + TranscoderOutput output) throws TranscoderException { graphics = new PDFDocumentGraphics2D(isTextStroked()); - graphics.getPDFDocument().getInfo().setProducer("Apache FOP Version " - + Version.getVersion() + graphics.getPDFDocument().getInfo().setProducer("Apache FOP Version " + + Version.getVersion() + ": PDF Transcoder for Batik"); if (hints.containsKey(KEY_DEVICE_RESOLUTION)) { graphics.setDeviceDPI(((Float)hints.get(KEY_DEVICE_RESOLUTION)).floatValue()); } - + setupImageInfrastructure(uri); - + try { - Configuration effCfg = this.cfg; + Configuration effCfg = this.cfg; if (effCfg == null) { //By default, enable font auto-detection if no cfg is given boolean autoFonts = true; @@ -177,7 +177,7 @@ public class PDFTranscoder extends AbstractFOPTranscoder effCfg = c; } } - + if (effCfg != null) { PDFDocumentGraphics2DConfigurator configurator = new PDFDocumentGraphics2DConfigurator(); @@ -195,14 +195,14 @@ public class PDFTranscoder extends AbstractFOPTranscoder if (getLogger().isTraceEnabled()) { getLogger().trace("document size: " + width + " x " + height); } - + // prepare the image to be painted - UnitProcessor.Context uctx = UnitProcessor.createContext(ctx, + UnitProcessor.Context uctx = UnitProcessor.createContext(ctx, document.getDocumentElement()); - float widthInPt = UnitProcessor.userSpaceToSVG(width, SVGLength.SVG_LENGTHTYPE_PT, + float widthInPt = UnitProcessor.userSpaceToSVG(width, SVGLength.SVG_LENGTHTYPE_PT, UnitProcessor.HORIZONTAL_LENGTH, uctx); int w = (int)(widthInPt + 0.5); - float heightInPt = UnitProcessor.userSpaceToSVG(height, SVGLength.SVG_LENGTHTYPE_PT, + float heightInPt = UnitProcessor.userSpaceToSVG(height, SVGLength.SVG_LENGTHTYPE_PT, UnitProcessor.HORIZONTAL_LENGTH, uctx); int h = (int)(heightInPt + 0.5); if (getLogger().isTraceEnabled()) { @@ -271,7 +271,7 @@ public class PDFTranscoder extends AbstractFOPTranscoder return null; } } - + }; } @@ -291,5 +291,5 @@ public class PDFTranscoder extends AbstractFOPTranscoder this.imageManager, this.imageSessionContext); return ctx; } - + } |