How to generate the external link as action to a bookmark in the pdf using Direct to PDF option

I need the external link as an action to a bookmark in the pdf. I am able to achieve it by using <:pdfs;GEN....> xymacro but this macro is not supported in Direct to PDF. Can anybody help me to generate the external link as an action to a bookmark in the pdf using Direct to PDF option.



  • Shahnawaz,

    Currently (XPP V9.3.1) Direct PDF only supports only 'normal' bookmarks.
    Normal bookmarks just link to the location in the PDF where the coding for generating the bookmark occurred.

    However this will get extended in the upcoming release V9.4 so you can bookmark to a named destination.
    See the SDL Ideas page:

    The proposed syntax is:

    -xpp-pdf-bookmark: "type=\{book} level={2} state={open} target={dest(attr(name))}"; 

    This is not exactly what you are asking.

    But it could very well be that the following:

    -xpp-pdf-bookmark: "type=\{book} level={2} state={open} target={url(attr(name))}";

    might be supported as well

    If I were you I would open a ticket and ask if the new bookmark feature will support a url target.
    If the answer is yes, then you will have to be a little patient till V9.4 arrives.
    If no, I would request that this possibility gets added to the CSS -xpp-pdf-bookmark feature, since you seem to have a use case for it.
    (support will probably direct you to the ideas page for making the request)

    Good luck


  • As far as I can tell from looking at the code, it looks to me like the following (mentioned by Bart) is already supported in the current XPP 9.3.1 release:

    -xpp-pdf-bookmark: "type={book} ... target={url(attr(name))}";

    Shahnawaz, if that does not do what you want then maybe you should tell us explicitly what is your full <:pdfs;GEN;...> macro expansion that accomplishes with psfmtdrv what you are trying to do with divpdf.

    Jonathan Dagresta
    SDL XPP Engineering

  • Please see below which I am using within <:pdfs;GEN;...>:

    [/Count 0 /Title (The Adobe home page) /Action << /Subtype /URI /URI (>> /OUT pdfmark

  • Did you try the suggested -xpp-pdf-bookmark syntax?

    From what I see in the (XPP 9.3.1) code, it should work.

    Jonathan Dagresta
    SDL XPP Engineering

  • Can you please advise how to call the above syntax through transformation table as I am not using CSS. 



  • You would have to use "CSS", if for nothing else than the ability to specify the -xpp-pdf-bookmark property. There is no other way to do this with Direct to PDF (divpdf). And if not using CSS mode, you would have to at least be using XML mode.

    You can specify with the -pdfmark and -pdfuacss options (XPP 9.3) a CSS file to use to do "bookmarks", even if using XML mode.

    Unfortunately, with the XPP 9.3 release the ability to do "bookmarks" this way is tied to doing PDF/UA (i.e. doing 'divpdf -pdfua ...'). And that means that you would have to craft a CSS file that also does PDF/UA "tagging", meaning that you would have to specify PDF/UA tags for all of your elements.

    However, with the upcoming XPP 9.4 release the ability to do "bookmarks" (only) has been separated from doing PDF/UA (there will be a new -pdfba option, standing for "Bookmarks and Annotations only", and a new -pdfcss option for specifying the name of the CSS file to use).

    Jonathan Dagresta
    SDL XPP Engineering

  • Shahnawaz,

    There is no more need to transform your pdf marks into the incoming data.

    Like Jonathan said, now you can create your pdf bookmarks and links using a supplementary CSS style sheet, even if you are using IF based specs. The only requirement is that the incoming data is XML.
    (see chapter 8 of the "PDF support in XPP" manual)
    I can tell you from personal experience that this new method is a lot easier that using pdf marks.

    And yes, you have to set the -pdfua and -pdfuacss options at output time.
    The -pdfmark option is optional just in case you still have some other traditional pdf marks in your file.
    I do not think that you can mix traditional based pdf marks creating bookmarks with CSS based bookmarks.(but I could be wrong).

    You do not have to worry about "tagging" all your elements as Jonathan told you to do.
    It simply works without the need to provide PDF/UA tags for all your elements.
    I think that XPP will just put an open and close Document PDF tag around everything.
    (of course the result will not be a valid tagged PDF)

    Just give it a try...good luck.
    (maybe you want to start experimenting with something small to avoid conflicts with existing PDF marks that you are already using)

  • Thanks Jonathan and Bart. I will try and will let you know my result.

  • Thank you very much Jonathan and Bart. I am able to generate the external link in bookmark section using CSS.