DITA and XMetaL Discussion

XMetaL Community Forum DITA and XMetaL Discussion How to include an image in a pdf header

  • s. anderson

    How to include an image in a pdf header

    Participants 14
    Replies 15
    Last Activity 8 years, 6 months ago

    Hi,

    I'm trying to include an image in the pdf header with no luck. I'm not exactly sure how to go about this. I've read the documentation for XMetal 8 over and over and can't find what I'm looking for — or even something that suggests how to do this.

    Can anyone help?

    Note: I'm using XMetal Author v8.0.1, without the TopLeaf plugin. And I'm rendering with XMetal Enhanced PDF via renderX XEP.

    Thanks

    Edit: I know I need to modify the custom.xsl in AppData/Whatevs/xmfo/yaddayadda. I've tried doing that. At this point I've tried modifying the header template and the header attribute without luck. It seems that the engine just ignores what I did, making me believe that I've screwed up major. So instead of slamming my head against this wall for another 3 hours, I figured I'd post this question. Hopefully y'alls are nicer and more understanding than most developer forums.

    Reply

    severin.foreman

    Reply to: How to include an image in a pdf header

    Hi Sandra,

    You would need to customize the DITA Open Toolkit that is included with XMetaL to do that. Someone has likely asked a similar question on the DITA Users group.
    https://groups.yahoo.com/neo/groups/dita-users/info

    Also, this document has a section on updating headers and footers that might help get you started.
    http://www.scriptorium.com/whitepapers/ditaotpdf/DITA-PDF-tweaks.pdf

    Regards,
    Severin

    Reply

    s. anderson

    Reply to: How to include an image in a pdf header

    Hi Severin,

    The reason I'm posting this is because I haven't found an answer online. I've been working on this for upward three hours, trying out fo code, and I've decided that instead of continuing, I'd just ask if anyone knew how to do this.

    Thanks
    Sandra

    Reply

    severin.foreman

    Reply to: How to include an image in a pdf header

    I see. Well the short answer is that you need to modify the static-content.xsl file in the directory where the open toolkit is installed. The actual answer is a bit more involved with that, which I why I referred you to the Scriptorium PDF. However, if you are willing to buy a book, there are some very good resources out there that will help you all the way through the process. XML Press has books by Eliot Kimber and Leigh White that contain all the information you need.

    I searched DITA users and found at least one post about someone wanting to add an image to the document footer, which would be the same process as adding an image to the header.

    Regards,
    Severin

    Reply

    s. anderson

    Reply to: How to include an image in a pdf header

    Thanks.

    Reply

    s. anderson

    Reply to: How to include an image in a pdf header

    Let me try this again:

    Anytime I make a change to the header or footer — even using the code in the XMetal doc — it doesn't affect my pdf output.

    I'm modifying AppDataRoamingSoftQuadXMetaL SharedDITA_OTpluginsxmfoCustomizationfoattrscustom.xsl just like the doc (almost) says (I say “almost” because the v8 doc is out-of-date and still refers to the deprecated demo directory).

    So if I try:



    right
    10pt
    10pt
    italic


    bold
    red
    normal

    It does nothing. The page number does not render in red. Nothing is in italics. Which makes me wonder what I am doing wrong.

    I don't think a book will help with this, IMHO.

    Thanks

    Reply

    severin.foreman

    Reply to: How to include an image in a pdf header

    Assuming you are using the XMetaL Enhanced PDF deliverable type, then your modifications should have some type of effect. I wonder if the attrscustom.xsl file you are modifying is being used by the output transforms. You can test that by attempting to break the output generation process by saving some malformed XML in the .xsl file. For example, I omitted the closing angle bracket on the attribute-set tag below.

    right
    10pt
    10pt
    italic

    If the .xsl is being used, it will cause a fatal error when you build output. If there's no fatal error, then you need to look elsewhere.

    Regards,
    Severin

    Reply

    s. anderson

    Reply to: How to include an image in a pdf header

    I am (see my original post for what I'm using).

    I know that that file is being used because I made a change on the title page to use a background image, and that took.  I also purposely made an error (as you suggested), and the generation failed.

    It's just the header and footer modifications that don't seem to be taking.

    Reply

    severin.foreman

    Reply to: How to include an image in a pdf header

    If you want to add an image, you'll need to do it in the static-content.xsl. As for why your changes are not taking effect, you might want to look at the stage3.xml file in the temp directory. There you can see all the fo objects that are applied to your text. Perhaps your changes are being applied, but are being overridden by another attribute set.

    Severin

    Reply

    IF

    Reply to: How to include an image in a pdf header

    My recommendation is to get Leigh White's book Dita for Print. She has an example to do exactly that and it works perfectly. It's an excellent book well worth the $ and time investment.

    Regarding the attribute sets for headers that don't seem to be used, you could try to create separate attribute files and importing them into the custom.xsl file, e.g.,:
    ….
     

       
     
    ….

    And this is inside my OPMANUAL_headers.xsl file:

            20pt
          solid
            orange
         

    Reply

    s. anderson

    Reply to: How to include an image in a pdf header

    My recommendation is to get Leigh White's book Dita for Print. She has an example to do exactly that and it works perfectly. It's an excellent book well worth the $ and time investment.

    Given that I need to do this sooner rather than later, and that you apparently know that this actually works, can you by any chance tell me how to do this?

    Thanks

    Reply

    s. anderson

    Reply to: How to include an image in a pdf header

    If you want to add an image, you'll need to do it in the static-content.xsl. As for why your changes are not taking effect, you might want to look at the stage3.xml file in the temp directory. There you can see all the fo objects that are applied to your text. Perhaps your changes are being applied, but are being overridden by another attribute set.

    I did it in custom.xsl because the XMetal doc specifically says to modify that doc rather than the other xsl files. In fact, the attribute where the background image is added is in static-content.xsl, but the override is located in custom.xsl, and it gets picked up perfectly well. If I make an error in custom.xsl, then the entire thing goes south. So I know custom.xsl is being read and used.

    I tried checking for Stage3.xml, and there was none. I have stage1.xml, but stage3.fo. Maybe this is the issue?

    Reply

    severin.foreman

    Reply to: How to include an image in a pdf header

    Sorry, I meant stage3.fo. That is the second to the last file in the processing chain and will show you almost exactly what it being passed to RenderX. If you look in that file, you can check for the color and font-style properties on your static content sections.

    And you are right to make your changes in custom.xsl. My team has so many customizations our custom.xsl file is used only to import other custom stylesheets.

    Reply

    s. anderson

    Reply to: How to include an image in a pdf header

    After looking at the xsl files, it looks like the default header should show the product name and the page number. This isn't happening. I've eliminated all customizations and the doc has no header (it never had a header).

    I think something must be broken in my installation.

    Reply

    shepPettibone

    Reply to: How to include an image in a pdf header

    It seems like no chance to me to do so when it was the 8, they did a lot of improvements on that in the 10th release. Back then, I tried to do this and that for several times ended up with the soft turned to garbage 3 days after. So I called it a day and edited that PDF through this tool [url=https://w9.pdffiller.com]https://w9.pdffiller.com[/url] just because I don't know, you upload it, put your media where you want and it's done

    Reply

  • You must be logged in to reply to this topic.

Lost Your Password?

Products
Downloads
Support