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/08 14:56:53 UTC

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

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