|
Hi all, Problem solved, by using the latest version
of Batik (1.5) -------- David -----Mensaje
original----- I’ve tried the same code with a
simple SVG, and it works. Does someone know if scaling and
translation of the input data is done automatically? -------- David -----Mensaje original----- Hi all, I’ve tried this example of Paolo
that I’ve found in the archives to render a SVG file: > There are a lot of misunderstandings here: > > - the last iText version supports all the PNG types in the codec package. > > - you don't have to convert the SVG drawings to raster. iText can read SVG > with batik and maintain the vector and text characteristics of the > original. > Use the following code as a start: > > PdfContentByte cb = writer.getDirectContent(); > Graphics2D g2 = cb.createGraphics(500, 500); > PrintTranscoder prm = new PrintTranscoder(); > TranscoderInput ti = new TranscoderInput("file:///C:/mapWaadt.svg"); > prm.transcode(ti, null); > PageFormat pg = new PageFormat(); > Paper pp= new Paper(); > pp.setSize(500, 500); > pp.setImageableArea(0, 0, 500, 500); > pg.setPaper(pp); > prm.print(g2, pg, 0); > g2.dispose();
|
- RV: [iText-questions] SVG graphics Carmona Perez, David
- RV: [iText-questions] SVG graphics Carmona Perez, David
