You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by vyang <vy...@apt-cafm.com> on 2009/06/30 19:41:53 UTC

PDFTranscoder & Paper size

Hello,

I'm using PDFTranscoder to convert an svg to pdf, everything is working
fine, but I'm having trouble with setting the correct paper size.  I set my
paper size of (8.5 x 11 in.) with the following code:

pdfTranscoder.addTranscodingHint(PDFTranscoder.KEY_WIDTH,
                    (float)pageFormat.getWidth());
pdfTranscoder.addTranscodingHint(PDFTranscoder.KEY_HEIGHT,
                    (float)pageFormat.getHeight());

which gives me a paper size of 8.25 x 6.38 in. I also tried:

pdfTranscoder.addTranscodingHint(PDFTranscoder.KEY_WIDTH,
                    (float)pageFormat.getImageableWidth());
pdfTranscoder.addTranscodingHint(PDFTranscoder.KEY_HEIGHT,
                    (float)pageFormat.getImageableHeight());

which gives me a paper size of 6.75 x 4.88 in.  Any help with this is much
appreciated.  Thanks.

vyang
-- 
View this message in context: http://www.nabble.com/PDFTranscoder---Paper-size-tp24276414p24276414.html
Sent from the Batik - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: PDFTranscoder & Paper size

Posted by vyang <vy...@apt-cafm.com>.
Hello Thomas,

What I meant by paper size is what size of paper you are going to use to
print on (ie 8.5 x 11, 11 x 17 etc).  Basically I have a page setup where
the user can set/select paper size.  Now I would pass the paper size to the
transcoder so that when the svg is converted to pdf, pdf would show as it
being/placed on say 8.5 x 11 paper.  When I use 8.5 x 11 size the resultant
pdf shows a paper size of 8.25 x 6.38.

vyang


thomas.deweese wrote:
> 
> Hi Vyang,
> 
> vyang <vy...@apt-cafm.com> wrote on 06/30/2009 01:41:53 PM:
> 
>> I'm using PDFTranscoder to convert an svg to pdf, everything is working
>> fine, but I'm having trouble with setting the correct paper size.  I set 
> my
>> paper size of (8.5 x 11 in.) with the following code:
>> 
>> pdfTranscoder.addTranscodingHint(PDFTranscoder.KEY_WIDTH,
>>                     (float)pageFormat.getWidth());
>> pdfTranscoder.addTranscodingHint(PDFTranscoder.KEY_HEIGHT,
>>                     (float)pageFormat.getHeight());
>> 
>> which gives me a paper size of 8.25 x 6.38 in. I also tried:
> 
>    I'm not sure what you mean by 'paper size', does the
> printer cut the paper for you?  :)
> 
>    Anyway I think the above is caused by the fact that your 
> document has a aspect ratio of ~5 by 4.  The SVG PDF transcoder 
> generally outputs the actual document size, if you need the 
> document placed in an otherwise blank page the simplest route 
> might be to place the SVG document in an FO document and render 
> it with FOP.
> 
>> pdfTranscoder.addTranscodingHint(PDFTranscoder.KEY_WIDTH,
>>                     (float)pageFormat.getImageableWidth());
>> pdfTranscoder.addTranscodingHint(PDFTranscoder.KEY_HEIGHT,
>>                     (float)pageFormat.getImageableHeight());
>> 
>> which gives me a paper size of 6.75 x 4.88 in.  Any help with this is 
> much
>> appreciated.  Thanks.
>> 
>> vyang
>> -- 
>> View this message in context: http://www.nabble.com/PDFTranscoder---
>> Paper-size-tp24276414p24276414.html
>> Sent from the Batik - Users mailing list archive at Nabble.com.
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
>> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/PDFTranscoder---Paper-size-tp24276414p24306758.html
Sent from the Batik - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: PDFTranscoder & Paper size

Posted by th...@kodak.com.
Hi Vyang,

vyang <vy...@apt-cafm.com> wrote on 06/30/2009 01:41:53 PM:

> I'm using PDFTranscoder to convert an svg to pdf, everything is working
> fine, but I'm having trouble with setting the correct paper size.  I set 
my
> paper size of (8.5 x 11 in.) with the following code:
> 
> pdfTranscoder.addTranscodingHint(PDFTranscoder.KEY_WIDTH,
>                     (float)pageFormat.getWidth());
> pdfTranscoder.addTranscodingHint(PDFTranscoder.KEY_HEIGHT,
>                     (float)pageFormat.getHeight());
> 
> which gives me a paper size of 8.25 x 6.38 in. I also tried:

   I'm not sure what you mean by 'paper size', does the
printer cut the paper for you?  :)

   Anyway I think the above is caused by the fact that your 
document has a aspect ratio of ~5 by 4.  The SVG PDF transcoder 
generally outputs the actual document size, if you need the 
document placed in an otherwise blank page the simplest route 
might be to place the SVG document in an FO document and render 
it with FOP.

> pdfTranscoder.addTranscodingHint(PDFTranscoder.KEY_WIDTH,
>                     (float)pageFormat.getImageableWidth());
> pdfTranscoder.addTranscodingHint(PDFTranscoder.KEY_HEIGHT,
>                     (float)pageFormat.getImageableHeight());
> 
> which gives me a paper size of 6.75 x 4.88 in.  Any help with this is 
much
> appreciated.  Thanks.
> 
> vyang
> -- 
> View this message in context: http://www.nabble.com/PDFTranscoder---
> Paper-size-tp24276414p24276414.html
> Sent from the Batik - Users mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
>