You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Andreas Neumann <ne...@karto.baug.ethz.ch> on 2006/03/27 16:49:00 UTC

batik-rasterizer and invalid url problem

Hi,

I am trying to render a SVG to PDF using Batik-rasterizer on the command 
line but get an error message:
-----------
Error while converting files:
  Error: invalid url 
(http://www.carto.net/williams/yosemite/unstable/printMap.psvg?paperWidth=210&paperHeight=297&mapTitle=Yosemite&xmin=270762.25&xmax=279262.25&ymin=4174203.5&ymax=4186053.5&mapLayers=hydrology,transportation,landcover,elevation&relief=true&ortho=false&scale=50000)
------------

The URL is rather complicated since I pass parameters into a serverside 
script.

My command was as follows:
-------------
java -Xmx512M -jar batik-rasterizer.jar -d test.pdf -m application/pdf 
-dpi 300 -onload 
http://www.carto.net/williams/yosemite/unstable/printMap.psvg?paperWidth=210\&paperHeight=297\&mapTitle=Yosemite\&xmin=270762.25\&xmax=279262.25\&ymin=4174203.5\&ymax=4186053.5\&mapLayers=hydrology,transportation,landcover,elevation\&relief=true\&ortho=false\&scale=50000
----------

I tested with both Batik SVN and Batik 1.6 on Linux (bash).

The URL works fine in Squiggle or other browsers. I escaped the "&" 
(ampersand) signs since he previously cutted the URL off at the "&" sign 
and would also report "invalid url".

I also tried using quotes around the ULR.

Anyone knows where the problem is? It would help me a lot.

Thanks,
Andreas

-- 
----------------------------------------------
Andreas Neumann - Institute of Cartography
Swiss Federal Institute of Technology (ETH)
ETH Hoenggerberg
CH-8093  Zurich, Switzerland
Phone: ++41-1-633 3031, Fax: ++41-1-633 1153
e-mail: neumann@karto.baug.ethz.ch
www: http://www.carto.net/neumann/
SVG.Open: http://www.svgopen.org/
Carto.net: http://www.carto.net/

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: batik-rasterizer and invalid url problem

Posted by Andreas Neumann <ne...@karto.baug.ethz.ch>.
Hi Thomas,

Thank you very much for the very quick answer. The dummy hack works fine!

This hack works fine for me. I don't mind the filename issue. I convert 
single files and can use the -d filename.pdf flag.

Thanks again,
Andreas

thomas.deweese@kodak.com wrote:
> Hi Andreas,
> 
> Andreas Neumann <ne...@karto.baug.ethz.ch> wrote on 03/27/2006 09:49:00 
> AM:
> 
>> I am trying to render a SVG to PDF using Batik-rasterizer on the command 
> 
>> line but get an error message:
>> -----------
>> Error while converting files:
>>   Error: invalid url 
> 
>    The code wants the input to end in either '.svg' or '.svgz' (so it can
> replace it with '.pdf').  So you can use the old IE hack and add 
> "&dummy=.svg" on the end.
> 
>    You will still get a pretty ugly file name from the Rasterizer (it
> will have all of the args in it).  If you know a little bit of Java and
> Java Servlets it's pretty easy to write a wrapper around the PDFTranscoder 
> that
> will do this on the server... 
> 

-- 
----------------------------------------------
Andreas Neumann - Institute of Cartography
Swiss Federal Institute of Technology (ETH)
ETH Hoenggerberg
CH-8093  Zurich, Switzerland
Phone: ++41-1-633 3031, Fax: ++41-1-633 1153
e-mail: neumann@karto.baug.ethz.ch
www: http://www.carto.net/neumann/
SVG.Open: http://www.svgopen.org/
Carto.net: http://www.carto.net/

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: batik-rasterizer and invalid url problem

Posted by th...@kodak.com.
Hi Andreas,

Andreas Neumann <ne...@karto.baug.ethz.ch> wrote on 03/27/2006 09:49:00 
AM:

> I am trying to render a SVG to PDF using Batik-rasterizer on the command 

> line but get an error message:
> -----------
> Error while converting files:
>   Error: invalid url 

   The code wants the input to end in either '.svg' or '.svgz' (so it can
replace it with '.pdf').  So you can use the old IE hack and add 
"&dummy=.svg" on the end.

   You will still get a pretty ugly file name from the Rasterizer (it
will have all of the args in it).  If you know a little bit of Java and
Java Servlets it's pretty easy to write a wrapper around the PDFTranscoder 
that
will do this on the server... 

> (http://www.carto.net/williams/yosemite/unstable/printMap.psvg?
> 
paperWidth=210&paperHeight=297&mapTitle=Yosemite&xmin=270762.25&xmax=279262.
> 
25&ymin=4174203.5&ymax=4186053.5&mapLayers=hydrology,transportation,landcover,
> elevation&relief=true&ortho=false&scale=50000)
> ------------
> 
> The URL is rather complicated since I pass parameters into a serverside 
> script.
> 
> My command was as follows:
> -------------
> java -Xmx512M -jar batik-rasterizer.jar -d test.pdf -m application/pdf 
> -dpi 300 -onload 
> http://www.carto.net/williams/yosemite/unstable/printMap.psvg?
> paperWidth=210\&paperHeight=297\&mapTitle=Yosemite\&xmin=270762.
> 25\&xmax=279262.25\&ymin=4174203.5\&ymax=4186053.5\&mapLayers=hydrology,
> 
transportation,landcover,elevation\&relief=true\&ortho=false\&scale=50000
> ----------
> 
> I tested with both Batik SVN and Batik 1.6 on Linux (bash).
> 
> The URL works fine in Squiggle or other browsers. I escaped the "&" 
> (ampersand) signs since he previously cutted the URL off at the "&" sign 

> and would also report "invalid url".
> 
> I also tried using quotes around the ULR.
> 
> Anyone knows where the problem is? It would help me a lot.
> 
> Thanks,
> Andreas
> 
> -- 
> ----------------------------------------------
> Andreas Neumann - Institute of Cartography
> Swiss Federal Institute of Technology (ETH)
> ETH Hoenggerberg
> CH-8093  Zurich, Switzerland
> Phone: ++41-1-633 3031, Fax: ++41-1-633 1153
> e-mail: neumann@karto.baug.ethz.ch
> www: http://www.carto.net/neumann/
> SVG.Open: http://www.svgopen.org/
> Carto.net: http://www.carto.net/
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org