You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by Thomas DeWeese <Th...@Kodak.com> on 2003/11/04 14:23:33 UTC
[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.
Re: [PATCH] Fix DPI for PDF Transcoder.
Posted by Glen Mazza <gr...@yahoo.com>.
--- Thomas DeWeese <Th...@Kodak.com> 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.
Posted by Thomas DeWeese <Th...@Kodak.com>.
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 <Th...@Kodak.com> 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.
Posted by Glen Mazza <gr...@yahoo.com>.
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 <Th...@Kodak.com> 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.
Posted by Glen Mazza <gr...@yahoo.com>.
Thanks, Thomas--I'll get to this tonight or tomorrow
night.
Glen
--- Thomas DeWeese <Th...@Kodak.com> 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 -0000 1.7
> +++ src/java/org/apache/fop/svg/PDFTranscoder.java 2
> Nov 2003 18:12:10 -0000
> @@ -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