What happens with other images? The limits of the canvas in the image may be
too big when compared with the image dimensions.

Best Regards,
Paulo Soares

----- Original Message -----
From: "Xiaohong Yin" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, June 05, 2003 22:03
Subject: [Itext-questions] SVG problem.


> Hey:
>
> I have been trying to solve a problem with inserting a SVG image
> generated
> from batik to the PDF using Graphics2D. The problem is that the image
> seems to shrink for some reason, it does not scale absolutely to the
> sizeand I explicitly set...
>
> Following is the code:
>
>
> PdfContentByte cb = writer.getDirectContent();
> int width = 300;
> int height = 250;
> PdfTemplate template = cb.createTemplate(width, height);
> DefaultFontMapper mapper = new DefaultFontMapper();
> Graphics2D g2 = template.createGraphics(width, height, mapping);
> PrintTranscoder prm = new PrintTranscoder();
> prm.addTranscodingHint(PrintTranscoder.KEY_WIDTH, new Float(width));
> prm.addTranscodingHint(PrintTranscoder.KEY_HEIGHT, new Float(height));
> TranscoderInput ti = new TranscoderInput("file:///C:/mapWaadt.svg");
> prm.transcode(ti, null);
> PageFormat pg = new PageFormat();
> Paper pp= new Paper();
> pp.setSize(width, height);
> pp.setImageableArea(0, 0, width, height);
> pg.setPaper(pp);
> prm.print(g2, pg, 0);
> g2.dispose();
> cb.addTemplate(template, 100, 400);
>
>
> Thanks a lot....
>
>
> Xiaohong
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by:  Etnus, makers of TotalView, The best
> thread debugger on the planet. Designed with thread debugging features
> you've never dreamed of, try TotalView 6 free at www.etnus.com.
> _______________________________________________
> iText-questions mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/itext-questions
>




-------------------------------------------------------
This SF.net email is sponsored by:  Etnus, makers of TotalView, The best
thread debugger on the planet. Designed with thread debugging features
you've never dreamed of, try TotalView 6 free at www.etnus.com.
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to