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 Phillip Rhodes <sp...@rhoderunner.com> on 2003/09/10 18:34:59 UTC

pixels vs. centimeters?

I am having problems trying to bridge between the pixel unit of measure
that SVG outputs, and the centimeter unit of measure that the print media
uses...

I am using batik to output svg using the SVGRaphics2D class.  When the SVG
document is created, all the units of measure are in pixels.

I am using the svg file in fo, with all the pages defined in terms of
centimeters.  If my page is 11cm long, I want my svg graphic to be 11cm
long...

I have been playing with the pixel values (by setting the length and width
attributes of the dimension objects that I use), but it feels like a
guessing game...

Pixels are device dependent (arbitrary), whereas centimeters are real
world units...

Is there a reliable way to figure out how many pixels are in 11cm?

I did google for a couple of hours, but can not find the answer to my
question.

Thanks!



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


Re: pixels vs. centimeters?

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Phillip Rhodes wrote:
> I am using the svg file in fo, with all the pages defined in terms of
> centimeters.  If my page is 11cm long, I want my svg graphic to be 11cm
> long...

FOP uses a hardcoded resolution of 72dpi, this means
  28.34... pixels are a centimeter
  1 pixel is 0.0352... centimeter

> I did google for a couple of hours, but can not find the answer to my
> question.

This is an issue left to processor implementors bz the spec. There
is no general answer.

J.Pietschmann


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


Re: pixels vs. centimeters?

Posted by "G. Wade Johnson" <wa...@abbnm.com>.
As I recall, lengths may be specified in cm if you choose.

If your output is more likely to be used for print, maybe lengths in
cm would make more sense than lengths in pixels.

One quick warning. Since the viewBox attribute scales sizes, it may
cause unintended changes in your "absolute" lengths.

G. Wade

Phillip Rhodes wrote:
> 
> I am having problems trying to bridge between the pixel unit of measure
> that SVG outputs, and the centimeter unit of measure that the print media
> uses...
> 
> I am using batik to output svg using the SVGRaphics2D class.  When the SVG
> document is created, all the units of measure are in pixels.
> 
> I am using the svg file in fo, with all the pages defined in terms of
> centimeters.  If my page is 11cm long, I want my svg graphic to be 11cm
> long...
> 
> I have been playing with the pixel values (by setting the length and width
> attributes of the dimension objects that I use), but it feels like a
> guessing game...
> 
> Pixels are device dependent (arbitrary), whereas centimeters are real
> world units...
> 
> Is there a reliable way to figure out how many pixels are in 11cm?
> 
> I did google for a couple of hours, but can not find the answer to my
> question.
> 
> Thanks!
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org

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