jQuery in Action, 3rd edition
The moose likes XML and Related Technologies and the fly likes XSL-FO hyperlinks in PDF Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "XSL-FO hyperlinks in PDF" Watch "XSL-FO hyperlinks in PDF" New topic

XSL-FO hyperlinks in PDF

Guy A. Buyle

Joined: Nov 07, 2002
Posts: 14
I have a PDF-document generated with Apache FOP. The PDF document contains a hyperlink. When I open the PDF-document, after generation, in the browser and I click on the hyperlink in the PDF-document. The hyperlink will be opened in the same window as the PDF-document. So I am losing my generated PDF-document, and I need to regerate.
While I am looking in my generated XSL file, I find the following :

<fo:basic-link show-destination="new"><xsl:attribute name="external-destination"><xsl:value-of select="URL"/></xsl:attribute><xsl:value-of select="FR"/></fo:basic-link>

I think normally the link should be opened in a new window?
If someone has a sollution to solve this problem it would be very helpful.

William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13037
According to my copy of the FOP 0.20.5 compliance document, it does not support the "show-destination" attribute (an extended XSL property).
I am just using basic-link with external-destination.
Guy A. Buyle

Joined: Nov 07, 2002
Posts: 14
When I save first the generated PDF-document and open this document with the Acrobat Reader. Clicking on the hyperlink opens the link in a new Window. So this works but I can't save the PDF document because I don't known the PC-configuration of my clients. So if I can send a byte stream (my generated PDF doucment) to the Acrobat Reader it should solve the problem but I don't know if this is possible.

Runtime.getRuntime().exec(C:\\Program Files\\Adobe\\Acrobat 6.0\\Reader\\AcroRd32.exe pdfFileStream);

If someone knows the parameters how to do it it would be very helpfully.
I agree. Here's the link: http://aspose.com/file-tools
subject: XSL-FO hyperlinks in PDF
It's not a secret anymore!