Relative path in fo:external-graphic for cover image?

675 views
Skip to first unread message

Greg Wait

unread,
Jul 13, 2016, 3:36:32 PM7/13/16
to DITA-OT Users
I have a working custom PDF plugin that I'm starting to roll out to teammates. Unfortunately, the resulting PDF lacks cover images (which appear perfectly on my machine) because the src is an absolute path:

<fo:external-graphic src="url('file:/C:/Users/greg.wait/Documents/SENSUS/dita-ot-2.2.2/plugins/com.sensus-techpubs.pdf/cfg/common/artwork/checkerboard.png')"  content-height="5.0in"/>

I've tried every iteration of a relative version of this path that I can think of, with no luck. 

The folder structure is as follows:

com.sensus-techpubs.pdf
 - cfg
    - common
        - artwork      <- graphics are here
 - xsl
    - fo                   <- stp_front-matter.xsl which references the graphics is here

The folder structure from the dita-ot-2.2.2 folder on down is identical. How do I create a relative src path for these images so that when I install the dita-ot-2.2.2 folder on someone else's machine the image paths are valid?

Thanks in advance... - G

Julio Vazquez

unread,
Jul 14, 2016, 7:02:06 AM7/14/16
to DITA-OT Users
Hi,

You need to add an ANT target to copy the graphic to the temp directory or a resource only reference to the image.

Julio Vazquez

Julio Vazquez

unread,
Jul 14, 2016, 7:02:08 AM7/14/16
to DITA-OT Users

mrob

unread,
Jul 14, 2016, 8:08:14 AM7/14/16
to DITA-OT Users
Hi,

I haven't tried to upgrade to DITA-OT-2.2.2 yet, but here's what works for me in 1.8:

<fo:external-graphic src="url(Customization/OpenTopic/common/artwork/Logo.svg)" />

The artwork is in C:\DITA-OT1.8\plugins\com.mycompany.mypdf\cfg\common\artwork

HTH,

mrob

Greg Wait

unread,
Jul 15, 2016, 11:36:19 AM7/15/16
to DITA-OT Users
That worked! Thanks! - G
Reply all
Reply to author
Forward
0 new messages