|
SVG problem.: msg#00083java.lib.itext.general
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.
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Images in Tables, Christopher Anderson |
|---|---|
| Next by Date: | Re: SVG problem., Paulo Soares |
| Previous by Thread: | Images in Tables, Christopher Anderson |
| Next by Thread: | Re: SVG problem., Paulo Soares |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |