Skip to main content
1-Visitor
February 17, 2010
Question

PE Config Question - Lost Graphics

  • February 17, 2010
  • 3 replies
  • 936 views

If I Print Composed to a PDF driver, I get graphics.

If I Compose to a PDF File, I don't - none in any graphic format.

Sound familiar?

And thanks for those with more data on PE and huge docs!

John T. Jarrett
BAE Systems | Arbortext version 5.4 | LOGSA XSL-FO v 1.5

    3 replies

    18-Opal
    February 17, 2010
    Hi John-



    I think you said in previous messages that you're using XSL-FO, is that
    right? Are you using PE to publish?



    In that case, the problem may have to do with a special thing you have
    to do with XSL-FO composition on PE for graphics. I'll paste a summary I
    wrote up in response to a similar question a while back that should
    explain things below. This is sketchily documented in the Arbortext help
    (see e.g. the help topic for "set pegraphicpi"), but it took me some
    experimentation to figure out just how to make it work.



    --Clay



    PE has a special way of handling graphics, so that Editor can send local
    graphic files with the document to the server and the server can do the
    right thing with them. This is done using processing instructions, which
    FOSI and Styler grok automatically, but which need a little extra work
    with XSL-FO. Basically, you have to make sure your XSL-FO stylesheet
    copies the PI's from the input to the FO
    output in order for PE to be able to find the uploaded graphics and use
    them. There will be one PI for each graphic, and it should be copied to
    appear *immediately after* the corresponding <fo:external-graphic> in
    the output tree.



    The good thing about this is that you don't have to worry about graphic
    paths at all-if Editor can find the graphics, it will insert all the
    necessary info into the _graphic_data PI for you, and upload the actual
    graphic when you publish on PE. In fact, when you use this approach, the
    contents of the src attribute on <fo:external-graphic> are ignored in
    favor of the info in the PI. (But, oddly, even though it's ignored, you
    do have to have *some* value for the src attribute-if you just leave it
    empty or omit it, the graphic won't appear.)



    If you don't use the _graphic_data PI's (by turning the set pegraphicpi
    option to "off", or by just not copying them in your XSL-FO stylesheet),
    then you do have to worry about getting the path right for the
    1-Visitor
    February 18, 2010
    Thanks Clay - appreciate the insight.

    We are using an XSL-FO (unfortunately).

    pegraphicpi on or off doesn't seem to make a difference. Looking at the source code, neither inserts graphic pi's in the document's source. I've even tried it from the server's PE Interactive editor so everything is as local as I could get it. I had "dontCopyGraphics" turned on a while ago, but I turned it back off a month back - and I don't recall if it was copying graphics before that or not.

    Is that something I can set in the doctype.dcf to try to force and make sure? Or maybe a map to the drive with the graphics somehow?

    Something that may not help is all the graphics are referenced to a mapped drive on the server, but from the server it is just a local directory.

    I still can't find the FO output to see what the tag actually looks like. I've got save-temp turned on, have re-routed the temp output to someplace I can get to, but can not find the composed output that actually goes to the PDF.

    John T. Jarrett CDT
    Tech Writer II, Tech Pubs, ILS, Land & Armaments/Global Tactical Systems

    T 832.673.2147 ext 1147 | M 512.736.7031 | -<">mailto:->
    BAE Systems, 5000 I-10 West, Sealy, Texas USA 77474
    www.baesystems.com
    18-Opal
    February 18, 2010
    Hi John-



    The trick is to add a template to your stylesheet to copy the PI over
    into the output XSL-FO instance. For every place in your stylesheet
    where you generate and <fo:external-grapic> element, you also need to
    add a line to copy the PI, something like this:



    <xsl:template match="graphic">

    <fo:external-graphic src="{@fileref}" &quot;="/>

    <xsl:copy-of<br/>select="following-sibling::processing-instruction('Pub')[contains(.,'gra
    phic_data')][1]"/>

    </xsl:template>



    Try this approach, with pegraphicpi=on, and see if that fixes you up.



    FWIW, this happens because the PI's are added to your source XML when it
    is sent to PE for composition, but the XSL-FO rendering adds another
    transformation layer. By default, XSL transformations don't copy PI's.
    So, if your XSL stylesheet doesn't explicitly copy the PI's from the
    source to the FO instance, they disappear.



    --Clay