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 Aaron Optimizer Digulla <di...@hepe.com> on 2001/02/07 10:07:13 UTC

[BUG] image is too small

The attached image doesn't render correctly; it is way too
small. Can you fix that in the current release, please ?
Or direct my to some hints what might be going on ?

-- 
==============================================
Sowatec AG,       CH-8330 Pf�ffikon (ZH)
Witzbergstr. 7,   http://www.sowatec.com
Tel: +41-(0)1-952 55 55
Fax: +41-(0)1-952 55 66
----------------------------------------------
Aaron "Optimizer" Digulla, digulla@sowatec.com
==============================================

Re: [fop-dev] Re: [BUG] image is too small

Posted by Aaron Optimizer Digulla <di...@hepe.com>.
On Thu, Feb 08, 2001 at 09:04:37PM +1000, Keiron Liddle wrote:

> Aaron Optimizer Digulla wrote:
> 
> > Just a question: Since my images are > 10pt, how can the decimal places
> > have any impact on the size ?? This sounds like FOP is truncating/rounding
> > at the wrong place. Truncating/rounding should only happen when the
> > figures are written to the PDF file and not before ?
> 
> Aaron,
> 
> The problem is in the "scale(0.04,0.04)", it seems to be making it far too
> small.

The image has a size of 1372*1931 (see the viewBoxi); after scaling it should be
55*77 units (I don't know how many mm a rect with width="55" and height="77"
is, anyone ?) but that should be larger than 4cm.

> When I took out the pdfNumber.doubleOut() in the applyTransform the size changed
> (this is not the correct solution since it can end up with invalid pdf ie. 1E-5
> would be written out but it should really be 0.00001).

When something like this happens, I use code like this:

    int out = int (value * 10000f);
    printf ("%d.%05d", out/10000, out%10000);

In C, you could of course use %.5f but not in Java.

-- 
==============================================
Sowatec AG,       CH-8330 Pfäffikon (ZH)
Witzbergstr. 7,   http://www.sowatec.com
Tel: +41-(0)1-952 55 55
Fax: +41-(0)1-952 55 66
----------------------------------------------
Aaron "Optimizer" Digulla, digulla@sowatec.com
==============================================

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


Re: [fop-dev] [BUG] image is too small

Posted by Keiron Liddle <ke...@aftexsw.com>.
Aaron Optimizer Digulla wrote:

> Just a question: Since my images are > 10pt, how can the decimal places
> have any impact on the size ?? This sounds like FOP is truncating/rounding
> at the wrong place. Truncating/rounding should only happen when the
> figures are written to the PDF file and not before ?

Aaron,

The problem is in the "scale(0.04,0.04)", it seems to be making it far too
small.

When I took out the pdfNumber.doubleOut() in the applyTransform the size changed
(this is not the correct solution since it can end up with invalid pdf ie. 1E-5
would be written out but it should really be 0.00001).


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


Re: [fop-dev] Re: [BUG] image is too small

Posted by Aaron Optimizer Digulla <di...@hepe.com>.
On Thu, Feb 08, 2001 at 01:16:56PM +1000, Keiron Liddle wrote:

> Aaron Optimizer Digulla wrote:
> 
> > The attached image doesn't render correctly; it is way too
> > small. Can you fix that in the current release, please ?
> > Or direct my to some hints what might be going on ?
> > 
> 
> Obviously you didn't read my previous reply .
> 
> The image is too small because the scaling turns the object into zero size.
> This is due to the rounding of when the scaling number is truncated for 
> placement in the pdf document.
> 
> To have this problem fixed:
> 
> you will need to tell me how many decimal places are valid in pdf

In the PDFReference, there is no hint how many places are valid.
I'd suggest to use 3 digits (= 1/1000th point resolution) which
should be enough for current typesetting hardware to produce the
best possible result.

> I can change where the numbers are truncated and get a suitable accuracy 
> for transforms

Just a question: Since my images are > 10pt, how can the decimal places
have any impact on the size ?? This sounds like FOP is truncating/rounding
at the wrong place. Truncating/rounding should only happen when the
figures are written to the PDF file and not before ?

-- 
==============================================
Sowatec AG,       CH-8330 Pfäffikon (ZH)
Witzbergstr. 7,   http://www.sowatec.com
Tel: +41-(0)1-952 55 55
Fax: +41-(0)1-952 55 66
----------------------------------------------
Aaron "Optimizer" Digulla, digulla@sowatec.com
==============================================

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


Re: [BUG] image is too small

Posted by Fotis Jannidis <fo...@lrz.uni-muenchen.de>.
> you will need to tell me how many decimal places are valid in pdf

According to the PDF reference appendix C.1:

5 

significant number of decimal digits of precision in fractional part 
(approx.)

Fotis

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


Re: [BUG] image is too small

Posted by Keiron Liddle <ke...@aftexsw.com>.
Aaron Optimizer Digulla wrote:

> The attached image doesn't render correctly; it is way too
> small. Can you fix that in the current release, please ?
> Or direct my to some hints what might be going on ?
> 

Obviously you didn't read my previous reply .

The image is too small because the scaling turns the object into zero size.
This is due to the rounding of when the scaling number is truncated for 
placement in the pdf document.

To have this problem fixed:

you will need to tell me how many decimal places are valid in pdf

then

I can change where the numbers are truncated and get a suitable accuracy 
for transforms


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