[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: RE: [docbook-apps] Converting SVG to PNG
This doesn't answer your question and may not be an option for you, but
what I do is adjust the printable size of the image to the approximate
desired size as a png. In Inscape, use document properites:
File->Document Properties. Set Page size to Custom and adjust to
something reasonable. Then select everthing and center it and CTRL+drag
a corner to scale it proportionally to the printable size. The batik
gives me a nice png.
David
> -----Original Message-----
> From: Sean Wheller [mailto:sean@inwords.co.za]
> Sent: Wednesday, January 03, 2007 1:40 AM
> To: docbook-apps@lists.oasis-open.org
> Subject: [docbook-apps] Converting SVG to PNG
>
> Hi,
>
> I decided to try batik as a tool for converting images
> created with Inkscape into png.
>
> In my ANT build I am calling batik to raster all PNG files in
> a given directory, like this:
>
> <java jar="${batik.dir}/batik-rasterizer.jar"
> classpathref="project.class.path.batik" output="batik.log"
> fork="true">
> <jvmarg value="-Xmx256m"/>
> <arg line="-d ../build/images"/>
> <arg line="-m image/png"/>
> <arg line="-bg 255.255.255.255"/>
> <arg line="-dpi 300"/>
> <arg line="../images"/>
> </java>
>
> While batik produces great images I have the following problem.
>
> The image created includes the drawing (vectors) and a huge,
> I mean huge, amount of whitespace. So according to the batik
> documentation I need a viewport. So I add
> <arg line="-a 0,0,452,320"/>
> to the command above.
>
> This generates only the image showing in the rectangle
> defined. The problem is that not all pictures are exactly
> this size. Some are larger and some are smaller.
>
> Has anyone found a way of dynamically extracting the size and
> location of the vector image from an Inkscape SVG and passing
> them to batik.
>
> I know this is not directly docbook related, but the
> batik-users list is not giving much since they are not much
> concerned with this type of use case. I am hoping that
> somebody else has experimented with this in content of
> docbook with ant and can help.
>
> Prior to trying to use batik I would use inkscape from the
> command line to look through images and export them to PNG.
> This worked very well, no extra white space or view ports
> needed. I may have to revert back to this system, but it is a
> process executed outside of the ant build.
>
> Many thanks,
>
> --
> Sean Wheller
> Technical Author
> email: sean@inwords.co.za
> im: seanwhe@jabber.org
> skype: seanwhe
> cel: +27-84-854-9408
> web: http://www.inwords.co.za
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
> For additional commands, e-mail:
> docbook-apps-help@lists.oasis-open.org
>
>
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]