[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Docbook pdf generation - copying png images to build directory?

From: Clifford Yapp
Subject: Docbook pdf generation - copying png images to build directory?
Date: Thu, 12 Nov 2009 16:10:50 -0500

I have a situation where I need to copy png images from a source
directory to the build directory prior to running other build rules,
and I am having some trouble formulating a rule to do the job.

Docbook files are converted to pdf format by using Apache FOP, but
when converting an xml file that references images using relative
paths the images MUST be present at the expected path locations to
correctly generate the pdf.  Unlike html generation from Docbook, this
means the png images must be present in the build tree at the time of
pdf building.  This works with an in-directory build, but building out
of directory the relative links in the xml files no longer properly
identify the image locations to fop.

To work around this build rules must be created that get the png files
into the build directory before the fop build rules are called, but so
far this has proven difficult.  Any rules of the form:

             mkdir -p `dirname address@hidden
             cp $? $@

fail (apparently, although I could be wrong) because the source file
already exists as a .png file and therefore the rule is satisfied.
Script based solutions are possible but somewhat cumbersome and they
impose a maintenance burden.  The current hack I'm using is to rename
the png files to have a .docpng extension and then define a copy rule:

             mkdir -p `dirname address@hidden
             cp $? $@

but this is suboptimal in that it requires the author to rename all of
their images prior to uploading a document.

Can anybody point me to the "correct" way to copy image files to the
build directory as the first step in a make process?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]