Hello Markus and Dean,
thanks for your replies. Based on your feedback I was able to find my issue.
It seems that the path is relative to the Apache Ant build.xml I'm using and
to the .fo file which is processed by the build.xml file.
If I put the graphics relativ to the build.xml (which I keep separated from
the content) everything works.
The Ant File I'm currently using is:
---------------
<target name="build-pdf" depends="clean, copybookimage, xinclude"
description="Generates pdf files from DocBook XML">
<!-- Convert DocBook Files into FO -->
<xslt style="${fo.stylesheet}" extension=".fo" basedir="${outputtmp.dir}"
destdir="${fobtmp.dir}">
<include name="**/*/article.xml" />
<param name="section.autolabel" expression="1" />
<param name="page.margin.inner" expression="1cm" />
<param name="page.margin.outer" expression="1cm" />
<param name="body.start.indent" expression="0mm" />
<param name="double-sided" expression="1" />
<param name="paper.type" expression="A4" />
</xslt>
<!-- Convert FO Files into pdf -->
<fop format="application/pdf" outdir="${pdf.dir}">
<fileset dir="${fobtmp.dir}">
<include name="**/*.fo" />
</fileset>
</fop>
</target>
--------------
Is there a way to tell the fop Ant Task to use a path relativ to the .fo
file is processes?
Best regards, Lars
2011/10/1 <[email protected]>
> **
> Lars,
>
> Setting the "image.src.path" parameter would eliminate a need to prefix the
> path on all images. However, that doesn't seem to be your problem.
> Everything you stated/done should be working. The FO code looks right and it
> does seem to fit the file structure.
>
> I am assuming that you are under a Linux/Unix OS. That said, I would look
> at the upper/lower case filenames located in your images directory and make
> sure they correspond with how you called them in the XML code.. My users are
> Windows and Linux and we constantly run in to case issues that show up under
> Linux but not Windows.
>
> As you can tell, we are now "reaching" a bit for the solution for you.
> Maybe the exact error from FOP would help?
>
> Regards,
> Dean Nelson
>
> In a message dated 9/30/2011 3:31:58 P.M. Pacific Daylight Time,
> [email protected] writes:
>
> Hi,
>
> my directory setup is usually as follows (somewhat simplified):
>
> ~/mydoc/mydoc.xml
> ~/mydoc/Makefile
> ~/mydoc/images/myimage.png
>
> mydoc.xml then uses relative paths to specify the image:
>
> <imagedata align="center" scale="50" format="PNG"
> fileref="images/myimage.png"/>
>
> Makefile is set up to invoke xsltproc and fop as needed. In order to
> transform this document, I cd to ~/mydoc and run make pdf. That's
> about it.
>
> regards,
> Markus
>
> Quoting Lars Vogel <[email protected]>:
>
> > Hi Chris,
> >
> > thanks for the answer unfortunately this also does not work.
> >
> > In which directory should the image be?
> >
> > Best regards, Lars
> >
> > 2011/9/30 Køi¹tof ®elechovski <[email protected]>
> >
> >> Dnia pi±tek, 30 wrze¶nia 2011 o 12:29:29 Lars Vogel napisa³(a):
>
> >> > Hello,
> >> >
> >> > I'm trying to create PDF from my Docbook output via the corresponding
> >> > stylesheets but FOP cannot find the image. I read Bobs description and
> I
> >> > believe the path of the image is correctly setup.
> >> >
> >> > http://www.sagehill.net/docbookxsl/GraphicsLocations.html
> >> > http://www.sagehill.net/docbookxsl/ModularDoc.html#XIncludeGraphics
> >> >
> >> > The generated FO source look like the following:
> >> >
> >> > <fo:block id="d0e101"><fo:external-graphic
> >> > src="url(content/images/DojoFolder10.gif)" width="auto" height="auto"
> >> > content-width="auto" content-height="auto"/></fo:block>
> >>
> >> That looks like relative path.
> >>
> >> >
> >> > and files are in the following structure:
> >> >
> >> > article.fo
> >> > /content/images/DojoFolder10.gif
> >> >
> >>
> >> Did you try setting src="url(/content/images/DojoFolder10.gif)"?
> >>
> >> Chris
> >> >
> >>
> >
> >
> >
> > --
> > Lars
> > http://www.vogella.de - Eclipse, Android and Java Tutorials
> > http://www.twitter.com/vogella - Lars on Twitter
>
>
> --
> Markus Hoenicka
> http://www.mhoenicka.de
> AQ score 38
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
--
Lars
http://www.vogella.de - Eclipse, Android and Java Tutorials
http://www.twitter.com/vogella - Lars on Twitter