Jump to content
Changes to the Jaspersoft community edition download ×
  • Hyperlink in PDF report does not work when running in Chrome


    Jim W
    • Features: Exporters Version: v7, v6, v5 Product: JasperReports® Server

    Issue Description:

    You are running a report from the JasperReports Server Repository in Chrome.

    When you export it to PDF by clicking Export -> As PDF, the hyperlink in the report does not work.  If you run the report in IE and Firefox the same way, the hyperlink in the PDF report works fine.

    That is most likely because the default is set to Chrome's built-in PDF Reader.  You can disable the Chrome PDF Reader.  See below.


    Resolution:

    • Type chrome:plugins in the address bar
    • click Disable in the entry for “Chrome PDF Viewer.”

    The Adobe Reader plug-in will automatically be enabled, if you have it installed already.  Otherwise, it will ask you to install it.  After it is installed, next time you export the report to PDF, Chrome will invoke the Adobe Reader instead.  The hyperlink will work in this case.

    UPDATE for later versions of Chrome:

    In later versions of Chrome, you can no longer access plugins as described above. To turn off in-line PDF viewing in Chrome you need to:

    • Type chrome:settings in the address bar
    • Under Privacy and Security, click on Site Settings (or search for "PDF" in the settings search bar)
    • Click on PDF Documents
    • Turn on the Download PDF files instead of automatically opening them in Chrome option

    This will cause any PDF file to automatically save to your computer instead of using Chrome's inline PDF viewer.


    Ref. Case #00031800

    MJB 05/06/20


    User Feedback

    Recommended Comments

    Chrome's built-in PDF reader supports links. They work fine in pdfs that aren't generated using Jasper. Here's an example. Chrome has over 60% of the browser market worldwide, and out of the box uses this pdf viewer. Can you please reopen this issue?

    EDIT: For anyone that ends up here searching, the problem is in using hyperlinkTarget="Blank". By removing that (or by setting it to "self" in the UI) links seem to work fine in Chrome.

    Breaks:  <textField evaluationTime="Report" hyperlinkType="Reference" hyperlinkTarget="Blank">

    Works fine:   <textField evaluationTime="Report" hyperlinkType="Reference">

    Link to comment
    Share on other sites

    I have the exact same issue with links in my report. The proposed solution in the comment seems to work. Just that the for links that spread over more than one line there are a couple of pixels between the line where either the link is not clickable or the link is opened so that a part of the link is cut off so it does not work.

    When I look at PDF generated by other software (i.e LibreOffice) they seem to reserve a whole box around the hyperlink, so to ensure that the whole area close to the text is clickable. Is there a possibility for something like this in Jasperreports as well?

    Link to comment
    Share on other sites



    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

×
×
  • Create New...