You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Hans Chicoine <hc...@cmtek.com> on 2003/06/09 22:30:16 UTC

How do pixels(px) compare to points(pt) or inches in XSL-FO/FOP ?

The context :

-I have a HTML document, a newsletter, formatted a bit like a newspaper's frontpage : blocks of text with arbitrary dimensions in arbitrary positions on the page.
-Block dimensions are fixed (independant of text content) and specified in pixels. Texts in the blocks have there font sizes given in points (pt = 1/72). 
-I'm attempting the reproduce the same document in PDF using FOP. 
 I'd like everything in the PDF to be identical (at least proportional) to what it is in the HTML document. 

The Problem :

In my XSL-FO stylesheet I've kept the same units : block dimensions in pixels(px) and font size in points(pt) ... BUT it is quite obvious in the rendered PDF that the ratios between block areas and the space taken up by the texts  ARE NOT the same in the HTML and in the PDF (typically more space is taken by the text in the PDF).

The question :

Would anyone know how to calculate a correction coefficient that reestablish the correct proportionality ? 
I suppose that that implies knowing how points are translated in pixels in a browser and how pixels are translated in absolute dimensions (eg. inches) in a xsl-fo renderer.


PS : I suppose I could specify block dimensions in inches in my HTML document ... but given the choice, I'd rather not do that.


Hope I'm Clear !

Hans

Re: How do pixels(px) compare to points(pt) or inches in XSL-FO/FOP ?

Posted by Hans Chicoine <hc...@cmtek.com>.
Thanks for the quick answer Clay

Would you also known what does FOP do with FOs that have dimensions in
pixels ?

Are those dimensions converted in inches unsing  some magical constant ratio
?

Maybe there's something in FOP docs or W3C's spec but I haven't found it ...

Having the two infos : i) dpi (or dots per pt) for a screen and ii)  inches
per pixel  for fop...

... I could then calculated a correction coefficient

Hans

----- Original Message -----
From: "Clay Leeds" <cl...@medata.com>
To: <fo...@xml.apache.org>
Sent: Monday, June 09, 2003 5:04 PM
Subject: Re: How do pixels(px) compare to points(pt) or inches in XSL-FO/FOP
?


> On 6/9/2003 1:30 PM, Hans Chicoine wrote:
> > The context :   -I have a HTML document, a newsletter, formatted a bit
> > like a newspaper's frontpage : blocks of text with arbitrary dimensions
> > in arbitrary positions on the page. -Block dimensions are fixed
> > (independant of text content) and specified in pixels. Texts in the
> > blocks have there font sizes given in points (pt = 1/72). -I'm
> > attempting the reproduce the same document in PDF using FOP.  I'd like
> > everything in the PDF to be identical (at least proportional) to what it
> > is in the HTML document.   The Problem :   In my XSL-FO stylesheet I've
> > kept the same units : block dimensions in pixels(px) and font size in
> > points(pt) ... BUT it is quite obvious in the rendered PDF
> > that the ratios between block areas and the space taken up by the
> > texts  ARE NOT the same in the HTML and in the PDF (typically more space
> > is taken by the text in the PDF).   The question :   Would anyone know
> > how to calculate a correction coefficient that reestablish the correct
> > proportionality ? I suppose that that implies knowing how points are
> > translated in pixels in a browser and how pixels are translated in
> > absolute dimensions (eg. inches) in a xsl-fo renderer.     PS : I
> > suppose I could specify block dimensions in inches in my HTML document
> > ... but given the choice, I'd rather not do that.     Hope I'm Clear !
> > Hans
>
> I think part of this depends on the resolution (measured in dpi--dots
> per inch) being displayed on the monitor. IIRC, when Microsoft Internet
> Explorer 5.x first shipped on the Mac, Web Developers complained that it
> shipped with a default dpi of 96 (the default for PCs), whereas most
> designers were accustomed to the Mac's 72dpi default. This meant that
> pages designed at 72 dpi looked really small when viewed with Mac MSIE.
> To make up for the discrepancy, Mac MSIE defaulted to 16pt font. I don't
> know if/how this will help, but it might...
>
> Here're a few resources that will hopefully help:
>
> http://msdn.microsoft.com/workshop/author/dhtml/overview/highdpi.asp
>
> http://reviews.macnn.com/reviews/ie5/ie5.shtml
>
> Hope this helps!
>
> Web Maestro Clay
> --
> Clay Leeds - cleeds@medata.com
> Web Developer - Medata, Inc. - http://www.medata.com
> PGP Public Key: https://mail.medata.com/pgp/cleeds.asc
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: fop-user-help@xml.apache.org
>


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


Re: How do pixels(px) compare to points(pt) or inches in XSL-FO/FOP ?

Posted by Clay Leeds <cl...@medata.com>.
On 6/9/2003 1:30 PM, Hans Chicoine wrote:
> The context :   -I have a HTML document, a newsletter, formatted a bit 
> like a newspaper's frontpage : blocks of text with arbitrary dimensions 
> in arbitrary positions on the page. -Block dimensions are fixed 
> (independant of text content) and specified in pixels. Texts in the 
> blocks have there font sizes given in points (pt = 1/72). -I'm 
> attempting the reproduce the same document in PDF using FOP.  I'd like 
> everything in the PDF to be identical (at least proportional) to what it 
> is in the HTML document.   The Problem :   In my XSL-FO stylesheet I've 
> kept the same units : block dimensions in pixels(px) and font size in 
> points(pt) ... BUT it is quite obvious in the rendered PDF 
> that the ratios between block areas and the space taken up by the 
> texts  ARE NOT the same in the HTML and in the PDF (typically more space 
> is taken by the text in the PDF).   The question :   Would anyone know 
> how to calculate a correction coefficient that reestablish the correct 
> proportionality ? I suppose that that implies knowing how points are 
> translated in pixels in a browser and how pixels are translated in 
> absolute dimensions (eg. inches) in a xsl-fo renderer.     PS : I 
> suppose I could specify block dimensions in inches in my HTML document 
> ... but given the choice, I'd rather not do that.     Hope I'm Clear !   
> Hans

I think part of this depends on the resolution (measured in dpi--dots 
per inch) being displayed on the monitor. IIRC, when Microsoft Internet 
Explorer 5.x first shipped on the Mac, Web Developers complained that it 
shipped with a default dpi of 96 (the default for PCs), whereas most 
designers were accustomed to the Mac's 72dpi default. This meant that 
pages designed at 72 dpi looked really small when viewed with Mac MSIE. 
To make up for the discrepancy, Mac MSIE defaulted to 16pt font. I don't 
know if/how this will help, but it might...

Here're a few resources that will hopefully help:

http://msdn.microsoft.com/workshop/author/dhtml/overview/highdpi.asp

http://reviews.macnn.com/reviews/ie5/ie5.shtml

Hope this helps!

Web Maestro Clay
-- 
Clay Leeds - cleeds@medata.com
Web Developer - Medata, Inc. - http://www.medata.com
PGP Public Key: https://mail.medata.com/pgp/cleeds.asc


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