PDF Links using Basic-Link

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

PDF Links using Basic-Link

Bjkyavuz
Hi guys,

I am using FOP 2.1 to generate a PDF file with external hyperlinks. Even with this simple syntax, I end up with just a text in the PDF that cannot be clicked:

<fo:basic-link color="blue" external-destination="url(http://www.lipsum.com/)">Lorem Ipsum</fo:basic-link>

Any clues as to what areas I could be digging deeper into to figure this out?

Thanks for the help,
Yavuz
Reply | Threaded
Open this post in threaded view
|

Re: PDF Links using Basic-Link

kibukj
Your example appears to work for me.

What are you using to view the PDF? Could it be the PDF viewer you
are using does not support hyperlinks, or requires an extra key like
Ctrl+Left Click to activate a link?

Here is the complete minimal working example I tried:

<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
  <fo:layout-master-set>
    <fo:simple-page-master master-name="Page">
      <fo:region-body/>
    </fo:simple-page-master>
  </fo:layout-master-set>
  <fo:page-sequence master-reference="Page">
    <fo:flow flow-name="xsl-region-body">
      <fo:block>
        <fo:basic-link color="blue" external-destination="url(http://www.lipsum.com/)">Lorem ipsum</fo:basic-link>
      </fo:block>
    </fo:flow>
  </fo:page-sequence>
</fo:root>

And here is the PDF that produces:
http://khzae.net/9/uploads/2019-01-23/test.pdf

Try opening that in the same PDF viewer, and see if the link works
for you.

Bjkyavuz <[hidden email]> wrote:

> Hi guys,
> I am using FOP 2.1 to generate a PDF file with external hyperlinks. Even with this simple syntax, I end up with just a text in the PDF that cannot be clicked:
> <fo:basic-link color="blue" external-destination="url(http://www.lipsum.com/)">Lorem Ipsum</fo:basic-link>
>
> Any clues as to what areas I could be digging deeper into to figure this out?
> Thanks for the help,Yavuz

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: PDF Links using Basic-Link

Simon Steiner
In reply to this post by Bjkyavuz

Hi,

 

Example is to use:

<fo:block>

  <fo:basic-link external-destination="url('http://www.paulmccartney.com')" >Paul McCartney</fo:basic-link>

</fo:block>

 

Thanks

 

From: Bjkyavuz <[hidden email]>
Sent: 24 January 2019 00:59
To: [hidden email]
Subject: PDF Links using Basic-Link

 

Hi guys,

 

I am using FOP 2.1 to generate a PDF file with external hyperlinks. Even with this simple syntax, I end up with just a text in the PDF that cannot be clicked:

 

<fo:basic-link color="blue" external-destination="url(http://www.lipsum.com/)">Lorem Ipsum</fo:basic-link>

 

Any clues as to what areas I could be digging deeper into to figure this out?

 

Thanks for the help,

Yavuz

Reply | Threaded
Open this post in threaded view
|

RE: PDF Links using Basic-Link

Simon Steiner

Hi,

 

My example is the same as yours, I misread the example you sent.

 

Thanks

 

From: Simon Steiner <[hidden email]>
Sent: 24 January 2019 08:28
To: [hidden email]
Subject: RE: PDF Links using Basic-Link

 

Hi,

 

Example is to use:

<fo:block>

  <fo:basic-link external-destination="url('http://www.paulmccartney.com')" >Paul McCartney</fo:basic-link>

</fo:block>

 

Thanks

 

From: Bjkyavuz <[hidden email]>
Sent: 24 January 2019 00:59
To: [hidden email]
Subject: PDF Links using Basic-Link

 

Hi guys,

 

I am using FOP 2.1 to generate a PDF file with external hyperlinks. Even with this simple syntax, I end up with just a text in the PDF that cannot be clicked:

 

<fo:basic-link color="blue" external-destination="url(http://www.lipsum.com/)">Lorem Ipsum</fo:basic-link>

 

Any clues as to what areas I could be digging deeper into to figure this out?

 

Thanks for the help,

Yavuz

Reply | Threaded
Open this post in threaded view
|

Re: PDF Links using Basic-Link

Bjkyavuz
In reply to this post by kibukj
Thank you very much for this. It was extremely helpful in debugging. It turns out that FOP was doing its job just fine, but the generated PDFs were post processed and merged by iText which dropped the links and other annotations. (Rewriting that method to use PdfCopy instead of PdfWriter resolved the issue.)

Thanks,
Yavuz


-----Original Message-----
From: kibukj <[hidden email]>
To: fop-users <[hidden email]>
Sent: Wed, Jan 23, 2019 8:24 pm
Subject: Re: PDF Links using Basic-Link

Your example appears to work for me.

What are you using to view the PDF? Could it be the PDF viewer you
are using does not support hyperlinks, or requires an extra key like
Ctrl+Left Click to activate a link?

Here is the complete minimal working example I tried:

<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
  <fo:layout-master-set>
    <fo:simple-page-master master-name="Page">
      <fo:region-body/>
    </fo:simple-page-master>
  </fo:layout-master-set>
  <fo:page-sequence master-reference="Page">
    <fo:flow flow-name="xsl-region-body">
      <fo:block>
        <fo:basic-link color="blue" external-destination="url(http://www.lipsum.com/)">Lorem ipsum</fo:basic-link>
      </fo:block>
    </fo:flow>
  </fo:page-sequence>
</fo:root>

And here is the PDF that produces:
http://khzae.net/9/uploads/2019-01-23/test.pdf

Try opening that in the same PDF viewer, and see if the link works
for you.

Bjkyavuz <[hidden email]> wrote:

> Hi guys,
> I am using FOP 2.1 to generate a PDF file with external hyperlinks. Even with this simple syntax, I end up with just a text in the PDF that cannot be clicked:
> <fo:basic-link color="blue" external-destination="url(http://www.lipsum.com/)">Lorem Ipsum</fo:basic-link>
>
> Any clues as to what areas I could be digging deeper into to figure this out?
> Thanks for the help,Yavuz


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]