Using the sample file copied below: The file has a viewbox of width 352 and height 416. The svg elements width and height is set to 100%. So (if my understanding is correct) the image should scale itself to any dimension. But when i try to rasterize it by supplying width value as 352 and height value as 416 -- i get an image (of size 352 and 416) in which the svg content does not occupy the entire area of the canvas --the image occupies 310x366 pixels on the top left and the rest (in right and bottom of the image) is shown transparent. The problem does not happen if the image is rastererized to a different size say 352x500. ================================================================ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd"> <svg baseProfile="tiny" height="100%" preserveAspectRatio="xMidYMid meet" version="1.0" viewBox="0 0 352 416" width="100%" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" zoomAndPan="magnify"> <switch> <foreignObject content="structured text" height="1" requiredExtensions="http://ns.adobe.com/AdobeIllustrator/10.0/" width="1" x="0" y="0"/> <g> <g> <radialGradient cx="176" cy="208" fx="176" fy="208" gradientUnits="userSpaceOnUse" id="XMLID_1_" r="192.6655"> <stop offset="0" style="stop-color:#EFF60B"/> <stop offset="1" style="stop-color:#EF0003"/> </radialGradient> <path d="M352,416H0V0h352V416z" fill="url(#XMLID_1_)"/> </g> </g> </switch> </svg> ================================================================
I should add that it even works for 352x417
Checking further i see that this problem is happening only with files having gradients defined in it.
This works for me. How are you rasterizing the file? Can you test: ./build.sh svgrasterizer -w 352 -h 416 test.svg
(In reply to comment #3) > This works for me. > How are you rasterizing the file? > Can you test: > > ./build.sh svgrasterizer -w 352 -h 416 test.svg I use the command line as below C:\software\batik\batik-1.6>java -jar batik-rasterizer.jar -w 352 -h 416 test.svg The version details are: 1) java ->"1.5.0_02" 2) batik ->1.5.1 and 1.6 (from the release zip files)
(In reply to comment #3) > This works for me. > How are you rasterizing the file? > Can you test: > > ./build.sh svgrasterizer -w 352 -h 416 test.svg I tested with the command C:\software\batik\xml-batik>build.bat svgrasterizer -w 352 -h 416 test.svg I still have the problem -- could it be anything to do with the OS (seeing ur batch file ending with .sh -- the only difference i could think of is that - i am trying it on windows 2000 and u are on linux/mac/unix machine.
I use cygwin on Windows so we are both on the same OS. The problem turned out to be the JDK version, with JDK 1.3.1 you don't get the problem with 1.4.2 & 1.5 you do. I'll look into it now that I can reproduce it.
This is now fixed in CVS.