RE: Building FOP (was: [PATCH] Fix DPI for PDF Transcoder.)
From: Glen Mazza <[EMAIL PROTECTED]> Thanks very much, Chris, for checking this for us. Glen My pleasure. If there are any "small" jobs I can do to aid the development of 1.0 then feel free to ask. Chris _ Use MSN Messenger to send music and pics to your friends http://www.msn.co.uk/messenger
RE: Building FOP (was: [PATCH] Fix DPI for PDF Transcoder.)
--- Chris Bowditch <[EMAIL PROTECTED]> wrote: > > I did an update just now on both Trunk and > maintenance branches. After doing > a "build clean" both built successfully. I assume > > Thanks very much, Chris, for checking this for us. Glen __ Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard http://antispam.yahoo.com/whatsnewfree
RE: Building FOP (was: [PATCH] Fix DPI for PDF Transcoder.)
From: "OBRADOVIC,PETAR (HP-Vancouver,ex1)" <[EMAIL PROTECTED]> A polite request: please dont re-use existing threads to start a new thread I am sorry if I am missing something obvious but I am not able to build the latest code after this change. It seems that "batik.jar" which is checked in "xml-fop" CVS does not contain this class (SVGAbstractTranscoderUserAgent). I looked in "xml-batik" but I didn't have any luck finding this class there either. I am Ok for now by switching back to version 1.7 of "PDFTranscoder.java". I did an update just now on both Trunk and maintenance branches. After doing a "build clean" both built successfully. I assume you are referring to the trunk 1.0Dev branch as PDFTranscoder only lives in the trunk. I checked what version I built with: 1.8 which includes the latest changes. The batik.jar in the lib directory is revision 1.11 Chris _ Use MSN Messenger to send music and pics to your friends http://www.msn.co.uk/messenger
RE: [PATCH] Fix DPI for PDF Transcoder.
I am sorry if I am missing something obvious but I am not able to build the latest code after this change. It seems that "batik.jar" which is checked in "xml-fop" CVS does not contain this class (SVGAbstractTranscoderUserAgent). I looked in "xml-batik" but I didn't have any luck finding this class there either. I am Ok for now by switching back to version 1.7 of "PDFTranscoder.java". Petar -Original Message- From: Glen Mazza [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 05, 2003 9:46 PM To: [EMAIL PROTECTED] Subject: Re: [PATCH] Fix DPI for PDF Transcoder. --- Thomas DeWeese <[EMAIL PROTECTED]> wrote: > > BTW, an embarrassing Java 101 question: Why > wasn't it > > necessary to manually import the > > SVGAbstractTranscoderUserAgent class in the PDFTranscoder.java file? > >Because it is an innerclass of a baseclass. OK...I see it now, it's defined in SVGAbstractTranscoder, which PDFTranscoder descends from. Glen __ Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard http://antispam.yahoo.com/whatsnewfree
Re: [PATCH] Fix DPI for PDF Transcoder.
--- Thomas DeWeese <[EMAIL PROTECTED]> wrote: > > BTW, an embarrassing Java 101 question: Why > wasn't it > > necessary to manually import the > > SVGAbstractTranscoderUserAgent class in the > > PDFTranscoder.java file? > >Because it is an innerclass of a baseclass. OK...I see it now, it's defined in SVGAbstractTranscoder, which PDFTranscoder descends from. Glen __ Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard http://antispam.yahoo.com/whatsnewfree
Re: [PATCH] Fix DPI for PDF Transcoder.
Hi Glen, Glen Mazza wrote: Just applied--thanks. Thanks! BTW, an embarrassing Java 101 question: Why wasn't it necessary to manually import the SVGAbstractTranscoderUserAgent class in the PDFTranscoder.java file? Because it is an innerclass of a baseclass. Glen --- Thomas DeWeese <[EMAIL PROTECTED]> wrote: +protected org.apache.batik.bridge.UserAgent createUserAgent() { +return new SVGAbstractTranscoderUserAgent() { +// The PDF stuff wants everything at 72dpi +public float getPixelUnitToMillimeter() { +return 0.3427778f; +} +}; +} + __ Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard http://antispam.yahoo.com/whatsnewfree
Re: [PATCH] Fix DPI for PDF Transcoder.
Thomas, Just applied--thanks. BTW, an embarrassing Java 101 question: Why wasn't it necessary to manually import the SVGAbstractTranscoderUserAgent class in the PDFTranscoder.java file? Glen --- Thomas DeWeese <[EMAIL PROTECTED]> wrote: > +protected org.apache.batik.bridge.UserAgent > createUserAgent() { > +return new SVGAbstractTranscoderUserAgent() > { > +// The PDF stuff wants everything > at 72dpi > +public float > getPixelUnitToMillimeter() { > +return 0.3427778f; > +} > +}; > +} > + __ Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard http://antispam.yahoo.com/whatsnewfree
Re: [PATCH] Fix DPI for PDF Transcoder.
Thanks, Thomas--I'll get to this tonight or tomorrow night. Glen --- Thomas DeWeese <[EMAIL PROTECTED]> wrote: > Hi all, > > I've attached a patch to the PDF transcoder > which changes the > UserAgent to always report a pixel to millimeter > conversion > corresponding to 72dpi. This is required because > this is the > default userspace of the PDFGraphics2D. > > It also fixes a minor issue with how the PDF > graphics is setup. > > Index: > src/java/org/apache/fop/svg/PDFTranscoder.java > === > RCS file: > /home/cvs/xml-fop/src/java/org/apache/fop/svg/PDFTranscoder.java,v > retrieving revision 1.7 > diff -w -u -r1.7 PDFTranscoder.java > --- src/java/org/apache/fop/svg/PDFTranscoder.java > 11 Oct 2003 14:48:49 -1.7 > +++ src/java/org/apache/fop/svg/PDFTranscoder.java2 > Nov 2003 18:12:10 - > @@ -119,6 +119,15 @@ > > } > > +protected org.apache.batik.bridge.UserAgent > createUserAgent() { > +return new SVGAbstractTranscoderUserAgent() > { > +// The PDF stuff wants everything > at 72dpi > +public float > getPixelUnitToMillimeter() { > +return 0.3427778f; > +} > +}; > +} > + > /** > * @see > org.apache.avalon.framework.configuration.Configurable#configure(Configuration) > */ > @@ -158,7 +167,7 @@ > > try { > > graphics.setupDocument(output.getOutputStream(), w, > h); > -graphics.setSVGDimension(width, > height); > +graphics.setSVGDimension(w, h); > > if > (hints.containsKey(ImageTranscoder.KEY_BACKGROUND_COLOR)) > { > graphics.setBackgroundColor > __ Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard http://antispam.yahoo.com/whatsnewfree
[PATCH] Fix DPI for PDF Transcoder.
Hi all, I've attached a patch to the PDF transcoder which changes the UserAgent to always report a pixel to millimeter conversion corresponding to 72dpi. This is required because this is the default userspace of the PDFGraphics2D. It also fixes a minor issue with how the PDF graphics is setup. Index: src/java/org/apache/fop/svg/PDFTranscoder.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/svg/PDFTranscoder.java,v retrieving revision 1.7 diff -w -u -r1.7 PDFTranscoder.java --- src/java/org/apache/fop/svg/PDFTranscoder.java 11 Oct 2003 14:48:49 - 1.7 +++ src/java/org/apache/fop/svg/PDFTranscoder.java 2 Nov 2003 18:12:10 - @@ -119,6 +119,15 @@ } +protected org.apache.batik.bridge.UserAgent createUserAgent() { +return new SVGAbstractTranscoderUserAgent() { +// The PDF stuff wants everything at 72dpi +public float getPixelUnitToMillimeter() { +return 0.3427778f; +} +}; +} + /** * @see org.apache.avalon.framework.configuration.Configurable#configure(Configuration) */ @@ -158,7 +167,7 @@ try { graphics.setupDocument(output.getOutputStream(), w, h); -graphics.setSVGDimension(width, height); +graphics.setSVGDimension(w, h); if (hints.containsKey(ImageTranscoder.KEY_BACKGROUND_COLOR)) { graphics.setBackgroundColor
dpi
Hi all, I have a question about the dpi resolution in pdf documents generated via FOP. From previous mailings I was able to extract the following information (please correct me if I'm wrong): The resolution of text depends on the output device (monitor, printer, etc.), but the resolution for gifs and jpegs is set to 72 dpi. Is there anyway to raise this value to say 150 dpi (I would like to print the document out)? One suggestion was to simply make the graphic bigger than it needs to be or to use SVG. However, I have existing graphics in gif-format which I would like to bring into my PDF-document. Does anybody have any suggestions? I would be very thankful. Regards, Marc Sumner - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Some changes to reflect DPI stored in images
Title: Some changes to reflect DPI stored in images Currently, I changed only JPEG class to reflect DPI. To add support to other image types, only change the corresponding analyzer. I compile this changes with FOP 0.20.2 without any errors /*/ /* org.apache.fop.fo.flow.ExternalGraphic */ /* changed function "layout" of ExternalGraphic class */ /* here is only short fragment of changed code */ /*/ public Status layout(Area area) throws FOPException { try { FopImage img = FopImageFactory.Make(src); // if width / height needs to be computed if ((width == 0) || (height == 0)) { // aspect ratio double imgWidth = img.getWidth(); double imgHeight = img.getHeight(); int imgDPIx = img.getDPIx(); int imgDPIy = img.getDPIy(); if ((imgDPIx > 0)&&(imgDPIy > 0)) { // 72 dpi is the default resolution of PDF imgWidth = (int)(imgWidth*72/imgDPIx); imgHeight = (int)(imgHeight*72/imgDPIx); } if ((width == 0) && (height == 0)) { width = (int)((imgWidth * 1000d)); height = (int)((imgHeight * 1000d)); } else if (height == 0) { height = (int)((imgHeight * ((double)width)) / imgWidth); } else if (width == 0) { width = (int)((imgWidth * ((double)height)) / imgHeight); } } // scale image if it doesn't fit in the area/page // Need to be more tested... ... /*/ /* org.apache.fop.image.FopImage */ /* added 2 function to FopImage interface*/ /*/ public interface FopImage { // image DPI public int getDPIx() throws FopImageException; public int getDPIy() throws FopImageException; } /*/ /* org.apache.fop.image.AbstractFopImage */ /* some changes to support DPI */ /*/ public abstract class AbstractFopImage implements FopImage { /** * Image DPI horizontal (in dots per inch). */ protected int m_dpi_x = 0; /** * Image DPI vertical (in dots per inch). */ protected int m_dpi_y = 0; /** * Constructor. * Construct a new FopImage object and initialize its default properties: * * image width * image height * * The image data isn't kept in memory. * @param href image URL * @return a new FopImage object * @exception FopImageException an error occured during initialization */ public AbstractFopImage(URL href) throws FopImageException { this.m_href = href; try { this.m_imageReader = ImageReaderFactory.Make(this.m_href.toExternalForm(), this.m_href.openStream()); } catch (Exception e) { throw new FopImageException(e.getMessage()); } this.m_width = this.m_imageReader.getWidth(); this.m_height = this.m_imageReader.getHeight(); this.m_dpi_x = this.m_imageReader.getDPIx(); this.m_dpi_y = this.m_imageReader.getDPIy(); } /** * Constructor. * Construct a new FopImage object and initialize its default properties: * * image width * image height * * The image data isn't kept in memory. * @param href image URL * imgReader ImageReader object * @return a new FopImage object * @exception FopImageException an error occured during initialization */ public AbstractFopImage(URL href, ImageReader imgReader) throws FopImageException { this.m_href = href; this.m_imageReader = imgReader; this.m_width = this.m_imageReader.getWidth(); this.m_height = this.m_imageReader.getHeight(); this.m_dpi_x = this.m_imageReader.getDPIx(); this.m_dpi_y = this.m_imageReader.getDPIy(); } /** * Return the image DPI horizontal * @return the image DPI horizontal * @exception FopImageException an error occured during property retriaval */ public int getDPIx() throws FopImageException { if (this.m_dpi_x == 0) this.loadImage(); return this.m_dpi_x; } /** * Return the image DPI vertical. * @return the image DPI vertical * @exception FopImageException an error occured during property retriaval */ public int getDPIy() throws Fo
RE: DPI of images...
Christian wrote: > If I insert images in PDFs, what DPI is used? Is that defined? > Are the DPI used, that can be stored in JPG? According to the spec, for fo:external-graphic: http://www.w3.org/TR/xsl/slice6.html#fo_external-graphic "In the case when the graphics format does not specify an intrinsic size of the graphic the size is determined in an implementation-defined manner. NOTE: For example, a size of 1/96" as the size of one pixel for rasterized images may be used. " I've used a large image and set the width and height attributes, which resulted in the image outputting in higher resolution. Hope that helps, Joshua -- This message and any attachment is confidential and may be privileged or otherwise protected from disclosure. If you have received it by mistake please let us know by reply and then delete it from your system; you should not copy the message or disclose its contents to anyone. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
DPI of images...
Hi! If I insert images in PDFs, what DPI is used? Is that defined? Are the DPI used, that can be stored in JPG? Thanks in advance Christian DIRON Wirtschaftsinformatik GmbH & Co. KG Christian Beer ([EMAIL PROTECTED]) Daimlerweg 39-41Tel. : +49(251)979-200 48163 Muenster Fax : +49(251)979-2020 Germany Email: [EMAIL PROTECTED] BESUCHEN SIE UNS AUF DER INTERNET WORLD IN NEW YORK VISIT US AT THE INTERNET WORLD IN NEW YORK 10.-14. Dezember 2001 - December 10th-14th 2001 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
RE: dpi
If you're printing a background color (not graphic), the resolution of your printer is irrelevant. By the way, most printers will lay down flat color areas by mixing CMYK (or in some cases, just CMY) as dictated by your color, and interpreted through the OS and your printer software. So, no sweat! jw -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Monday, October 15, 2001 5:50 PM To: [EMAIL PROTECTED] Subject: RE: dpi Thanks. What about background colours which do not use svg? So if you do Extensible Markup Language (XML) 1.0 does the blue colour also print at the printer resolution? -Original Message- From: Jim Wright [mailto:[EMAIL PROTECTED]] Sent: Monday, October 15, 2001 3:39 PM To: [EMAIL PROTECTED] Subject: RE: dpi Change it with what? I assume you mean graphics... A pdf will display to the resolution of your printer. Gifs, pngs and the like often default to 72 dpi, but you can work around this by making the graphic bigger than it needs to be, then scaling it down within the appropriate block (just make sure to do it proportionately, or the graphic may sometimes disappear). Or, just use svg, and you're working in high-resolution all the time. jw -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Monday, October 15, 2001 5:27 PM To: [EMAIL PROTECTED] Subject: dpi Is it possible to change the default dpi from 72 to 600 (say)? Thanks, --Panos - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
RE: dpi
Thanks. What about background colours which do not use svg? So if you do Extensible Markup Language (XML) 1.0 does the blue colour also print at the printer resolution? -Original Message- From: Jim Wright [mailto:[EMAIL PROTECTED]] Sent: Monday, October 15, 2001 3:39 PM To: [EMAIL PROTECTED] Subject: RE: dpi Change it with what? I assume you mean graphics... A pdf will display to the resolution of your printer. Gifs, pngs and the like often default to 72 dpi, but you can work around this by making the graphic bigger than it needs to be, then scaling it down within the appropriate block (just make sure to do it proportionately, or the graphic may sometimes disappear). Or, just use svg, and you're working in high-resolution all the time. jw -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Monday, October 15, 2001 5:27 PM To: [EMAIL PROTECTED] Subject: dpi Is it possible to change the default dpi from 72 to 600 (say)? Thanks, --Panos - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
RE: dpi
Change it with what? I assume you mean graphics... A pdf will display to the resolution of your printer. Gifs, pngs and the like often default to 72 dpi, but you can work around this by making the graphic bigger than it needs to be, then scaling it down within the appropriate block (just make sure to do it proportionately, or the graphic may sometimes disappear). Or, just use svg, and you're working in high-resolution all the time. jw -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Monday, October 15, 2001 5:27 PM To: [EMAIL PROTECTED] Subject: dpi Is it possible to change the default dpi from 72 to 600 (say)? Thanks, --Panos - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
dpi
Is it possible to change the default dpi from 72 to 600 (say)? Thanks, --Panos - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]