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 2005/04/15 17:11:29 UTC

Batik rasterizer and PDF

Hi all,

I have a couple questions about batik-rasterizer and PDF.

The rasterizer works fine using raster files as output, such as PNG, but 
I have problems with the PDF output. For some reasons it stops rendering 
my map layer at a certain stage. Unfortunately, batik-rasterizer does 
not output any error messages to give me a hint what is going wrong. I 
have an example at 
http://www.carto.net/neumann/temp/batik_rasterizer_pdf_problem.zip  - 
the archive contains the source SVG (which can be displayed by Batik 
1.6), a linked SVG font file, a rasterized PNG output by 
batik-rasterizer and a PDF output by batik-rasterizer. If you open both 
output files you can see that the hydrology and road layers are missing 
in the PDF and that the white background text-elements (halo) are also 
missing. I don't know  - maybe the problem is with FOP?

My test environment:
Win2K, Java 1.5.0_02

my CLASSPATH:-
C:\Program Files\batik-1.6;C:\Program Files\batik-1.6\lib;C:\Program 
Files\Altova\FOP\build;C:\Program Files\Altova\FOP\lib;
FOP is in version 0.20.5, Batik in version 1.6

my command:
java -Xmx512M -jar batik-rasterizer.jar -w 4096 -h 3072 -m 
application/pdf -d yos.pdf yosemite.svg

--------------------

The other question is about the collaboration of Batik and FOP. As I 
understand it, batik-rasterizer need FOP to generate PDFs. Is there 
anythink I need to pay attention to, regarding FOP? Do I need to 
configure anything in FOP? I understand that I have to add fonts, if I 
want text output instead of curves. Anything else?

---------------------

My last question is regarding opacity: is it true that the current 
Batik/FOP combination rasterizes elements that have a opacity attribute? 
E.g. if I have a landcover vector layer with an opacity above a 
shaded-relief, the landcover vector layer would be rasterized (as in my 
example)?

Thanks for the help with my problem and all the best,
Andreas

---------------------------------------------------------------------
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 PDF

Posted by Andreas Neumann <ne...@karto.baug.ethz.ch>.
>   Actually I think the problem lies with Acrobat Reader and the
> coordinate system involved.  If I just move the rendered area to a
> "more reasonable" part of the coordinate system (eg
> 271410,-4180575 to 1410,-0575, just dropping the leading 10's of
> thousands) the strokes magically appear.  I would guess that the
> stroking code is somehow limited to a fairly small display area
> (just guessing something in the -32k->+32K range).


ah - thanks, you are right. I upgraded to Acrobat Reader 7 and it worked 
as well, like in the MacOSX PDF Viewer. If it is a problem for older 
Acrobat viewers I can shift the coordinate system. It is all db-driven 
anyway, so I can just transform the data.

>    The white halo appears to be a white stroke on the text.

hm - yes. I use a use-element of the original text element, place it 
behind the original object and a white stroke to achieve that halo. Do 
you have a better idea on how to achieve that that is also compatible 
with the PDF generated by Batik/FOP?

>    I hope that helps even if it really isn't what you want to hear. ;)

no, it helps a lot. I know a lot more now and can adopt my code to 
generate Acrobat conform output.

Thanks a lot,
Andreas


---------------------------------------------------------------------
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 PDF

Posted by Thomas DeWeese <Th...@Kodak.com>.
Hi Andreas,

Andreas Neumann wrote:

> I have a couple questions about batik-rasterizer and PDF.
> 
> The rasterizer works fine using raster files as output, such as PNG, but 
> I have problems with the PDF output. For some reasons it stops rendering 
> my map layer at a certain stage. Unfortunately, batik-rasterizer does 
> not output any error messages to give me a hint what is going wrong. 

   Actually I think the problem lies with Acrobat Reader and the
coordinate system involved.  If I just move the rendered area to a
"more reasonable" part of the coordinate system (eg
271410,-4180575 to 1410,-0575, just dropping the leading 10's of
thousands) the strokes magically appear.  I would guess that the
stroking code is somehow limited to a fairly small display area
(just guessing something in the -32k->+32K range).

    In fact if you open your PDF in the Mac 'Preview' PDF viewing
application all the stroked objects appear although there is a
fairly significant 'alignment' issue.

    In an ideal world the transcoder would notice when the content
exceeded this range and rescale it for you, but obviously we don't
right now...

    The white halo appears to be a white stroke on the text.

    I hope that helps even if it really isn't what you want to hear. ;)


---------------------------------------------------------------------
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 PDF

Posted by James Shaw <he...@btopenworld.com>.
Andreas Neumann wrote:
> My last question is regarding opacity: is it true that the current 
> Batik/FOP combination rasterizes elements that have a opacity attribute? 
> E.g. if I have a landcover vector layer with an opacity above a 
> shaded-relief, the landcover vector layer would be rasterized (as in my 
> example)?
> 
 From my (limited) experience of opacity and FOP, I believe the 
semitransparent objects are rendered with opacity of 100%.  Rasterizing 
such areas would be desirable, but I'm not aware that this is performed.

Hope that helps
James Shaw

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