Dear Genies, Currently I am in R&D and doing some research in PDF and SVG. Especially I am trying to find a solution to convert SVG into PDF. When I did a research on the Web I came across that one module of Batik is also doing the same thing (Rasterizer). Q1) In SVG to PDF Conversion, is that the end result a print ready PDF ? Q2) When converting the SVG into PDF, the Batik is uncompressing the image data and creating the PDF with that raw data. So it is increasing the PDF's size by many times. For example 8 kb SVG converted to 1.8 meg PDF. Any idea to compress the images in the output pdf when converting the SVG into PDF. Q3) When converting SVG to PDF, the Tiff-CMYK and JPEG-CMYK are not supported by Batik. I had one SVG which is containing an image as I shown below. ------------------------------------------------------------------------ ---------------------------------------------- <g transform="matrix(0.0000 -108.0025 -95.0422 0.0000 560.9800 563.2600)">
<image height="1" width="1" xlink:href="someCMYK.jpg" /> </g> ------------------------------------------------------------------------ ---------------------------------------------- If I open this SVG in any SVG Viewer I can't see this image because SVG spec is not supporting CMYK colour modal. But if I convert this SVG to PDF it should create a PDF with this image in it. But batik failed to do so. ------------------------------------------------------------------------ ------------------------------------------------------------------------ -------------------- Converting vertright.svg to jpegtest\vertright.pdf ... sun.awt.image.ImageFormat Exception: Unsupported colour conversion request at sun.awt.image.JPEGImageDecoder.readImage(Native Method) at sun.awt.image.JPEGImageDecoder.produceImage(JPEGImageDecoder.java:144 ) at sun.awt.image.InputStreamImageSource.doFetch(InputStreamImageSource.j ava:257) at sun.awt.image.ImageFetcher.fetchloop(ImageFetcher.java:168) at sun.awt.image.ImageFetcher.run(ImageFetcher.java:136) ------------------------------------------------------------------------ ------------------------------------------------------------------------ -------------------- Then I have tried with one Tiff-CMYK image. ------------------------------------------------------------------------ ------------------------------------------------------------------------ -------------------- <g transform="matrix(0.0000 -108.0025 -95.0422 0.0000 560.9800 563.2600)"> <image height="1" width="1" xlink:href="1-Tiff-CMYK-CMYK.tif" /> </g> ------------------------------------------------------------------------ ------------------------------------------------------------------------ -------------------- and I got the error, please see the attachment for error message. To do all these tests I am using the command line java -jar batik-rasterizer.jar -m application/pd vertright.svg Thanks for your help so far. Shan
Converting vertright.svg to tifftest\vertright.pdf ... java.lang.IllegalArgument Exception: Raster ByteInterleavedRaster: width = 225 height = 225 #numDataElemen ts 4 dataOff[0] = 0 is incompatible with ColorModel ColorModel: #pixelBits = 8 n umComponents = 1 color space = [EMAIL PROTECTED] transparenc y = 1 has alpha = false isAlphaPre = false at java.awt.image.BufferedImage.<init>(BufferedImage.java:549) at org.apache.batik.ext.awt.image.rendered.Any2sRGBRed.copyData(Unknown Source) at org.apache.batik.ext.awt.image.rendered.AbstractRed.getData(Unknown S ource) at org.apache.batik.ext.awt.image.rendered.AffineRed.genRect(Unknown Sou rce) at org.apache.batik.ext.awt.image.rendered.AffineRed.copyData(Unknown So urce) at org.apache.batik.ext.awt.image.rendered.FormatRed.copyData(Unknown So urce) at org.apache.batik.ext.awt.image.rendered.AbstractRed.getData(Unknown S ource) at org.apache.batik.ext.awt.image.GraphicsUtil.drawImage(Unknown Source) at org.apache.batik.ext.awt.image.GraphicsUtil.drawImage(Unknown Source) at org.apache.batik.gvt.RasterImageNode.primitivePaint(Unknown Source) at org.apache.batik.gvt.AbstractGraphicsNode.paint(Unknown Source) at org.apache.batik.gvt.CompositeGraphicsNode.primitivePaint(Unknown Sou rce) at org.apache.batik.gvt.AbstractGraphicsNode.paint(Unknown Source) at org.apache.batik.gvt.ImageNode.paint(Unknown Source) at org.apache.batik.gvt.CompositeGraphicsNode.primitivePaint(Unknown Sou rce) at org.apache.batik.gvt.AbstractGraphicsNode.paint(Unknown Source) at org.apache.batik.gvt.CompositeGraphicsNode.primitivePaint(Unknown Sou rce) at org.apache.batik.gvt.AbstractGraphicsNode.paint(Unknown Source) at org.apache.batik.gvt.CompositeGraphicsNode.primitivePaint(Unknown Sou rce) at org.apache.batik.gvt.AbstractGraphicsNode.paint(Unknown Source) at org.apache.batik.gvt.CompositeGraphicsNode.primitivePaint(Unknown Sou rce) at org.apache.batik.gvt.CanvasGraphicsNode.primitivePaint(Unknown Source ) at org.apache.batik.gvt.AbstractGraphicsNode.paint(Unknown Source) at org.apache.batik.gvt.CompositeGraphicsNode.primitivePaint(Unknown Sou rce) at org.apache.batik.gvt.AbstractGraphicsNode.paint(Unknown Source) at org.apache.fop.svg.PDFTranscoder.transcode(PDFTranscoder.java:287) at org.apache.batik.transcoder.XMLAbstractTranscoder.transcode(Unknown S ource) at org.apache.batik.apps.rasterizer.SVGConverter.transcode(Unknown Sourc e) at org.apache.batik.apps.rasterizer.SVGConverter.execute(Unknown Source) at org.apache.batik.apps.rasterizer.Main.execute(Unknown Source) at org.apache.batik.apps.rasterizer.Main.main(Unknown Source) ... error (SVGConverter.error.while.rasterizing.file)
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]