Hello,
since i needed svg-scaling for embedding Logos in my PDF i took
a look in the sources (0.20.5rc3a). When i figured out where the svg's are 
rendered i could implement this feature with very small changes. 
My question now is: if it is that simple, why wasn't it implemented already. 
As far es i have tested my solution works fine. May i missed something or my 
solution is against some specigication issue.

Here my changes made in org.apache.fop.render.pdf.PDFRenderer:

Expand the parameterlist of renderSVGDocument
protected void renderSVGDocument(
                Document doc, int x, int y, 
                int width, int height,
                FontState fs)

Assign width and heigth to w and h.
        // get the 'width' and 'height' attributes of the SVG document
//        float w = (float) ctx.getDocumentSize().getWidth() * 1000f;
//        float h = (float) ctx.getDocumentSize().getHeight() * 1000f;
        float w = (float) width ;
        float h = (float) height ;

Then i've changed the calls to renderSVGDocument and i got wonderful scaled 
Logos using the width and height attributes in fo:external-graphic.

Pretty simple... But maybe there is i Problem i can't see. I don't change it 
in the cvs-version because it creates completely destroyed PDF so i can't use 
it.

I dont't want to create my own fop-Version because of upgrade-compatibility. 
Would be nice if the next Version get this feature.
So long
Martin


-- 
Dievision GmbH | Kriegerstrasse 44 | 30161 Hannover
Telefon: (0511) 288791-0 | Telefax: (0511) 288791-99
http://www.dievision.de | mailto:[EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to