FOP
  1. FOP
  2. FOP-1510

implement show-destination for fo:basic-link

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Resolution: Unresolved
    • Affects Version/s: 0.93
    • Fix Version/s: None
    • Component/s: renderer/pdf
    • Labels:
      None
    • Environment:
      Operating System: Windows XP
      Platform: PC
    • External issue ID:
      44634

      Description

      Hi
      Please help on this,

      I would really like to insert a hyperlink to pdf output, I wish this link will be opened in a new browser window?

      I knew that show-destination attribute of <fo:basic-link> tag was not supported jet. Could you please tell me another workaround to satisfy

      I'm using Adobe 8 and IE 7
      Thanks
      Luong To

      1. Bugzilla_44634.patch
        26 kB
        Andreas L. Delmelle

        Activity

        Hide
        Glenn Adams added a comment -

        change status from ASSIGNED to NEW for consistency

        Show
        Glenn Adams added a comment - change status from ASSIGNED to NEW for consistency
        Hide
        Glenn Adams added a comment -

        resetting P2 open bugs to P3 pending further review

        Show
        Glenn Adams added a comment - resetting P2 open bugs to P3 pending further review
        Hide
        Andreas L. Delmelle added a comment -

        Changes applied to FOP Trunk.

        see http://svn.apache.org/viewvc?rev=651575&view=rev

        For the moment, I'm leaving the bug open, given the limitations of the added implementation...

        Show
        Andreas L. Delmelle added a comment - Changes applied to FOP Trunk. see http://svn.apache.org/viewvc?rev=651575&view=rev For the moment, I'm leaving the bug open, given the limitations of the added implementation...
        Hide
        Andreas L. Delmelle added a comment -

        (In reply to comment #7)
        > Good stuff, Andreas (only a quick glance taken). The only thing that is
        > probably missing is a parse method for the intermediate format.

        Right. I'll have to adapt AreaTreeParser.setTraits() as well, since the external-link Trait is no longer a simple String.

        >
        > I guess if the Acrobat plug-in does not handle the "NewWindow" flag properly,
        > there's not much we can do. It probably needs to be considered a bug in Adobe's
        > code.
        >

        A bug or a missing feature, indeed. It is also not possible, AFAICT, to open a different destination in the same document in a new window. Still, if I interpret correctly, this is the expected behavior for show-destination="new", no matter whether the destination is internal or external.

        [Chris:]
        > I'm not sure that behaviour is a bug. Undesirable maybe. My understanding is
        > that Adobe Reader plugin uses the option "Display PDF in Browser" under
        > Edit\Preferences menu (Internet Tab) to decide whether to open a separate
        > window for PDF links or not.

        Not exactly. The above option controls whether the plugin is used altogether if you enter a PDF address in the browser's address bar or click a hyperlink targeting a PDF. If you disable it, then Adobe Reader or Acrobat is always used standalone to view PDFs. There is another option that also relates to the /NewWindow flag. On the General Tab, I have the possibility to disable "Open cross-document links in the same window". This determines what happens if no explicit value for the /NewWindow flag is specified. Only, this option does not influence the behavior in the plugin; only relevant for standalone mode.

        Show
        Andreas L. Delmelle added a comment - (In reply to comment #7) > Good stuff, Andreas (only a quick glance taken). The only thing that is > probably missing is a parse method for the intermediate format. Right. I'll have to adapt AreaTreeParser.setTraits() as well, since the external-link Trait is no longer a simple String. > > I guess if the Acrobat plug-in does not handle the "NewWindow" flag properly, > there's not much we can do. It probably needs to be considered a bug in Adobe's > code. > A bug or a missing feature, indeed. It is also not possible, AFAICT, to open a different destination in the same document in a new window. Still, if I interpret correctly, this is the expected behavior for show-destination="new", no matter whether the destination is internal or external. [Chris:] > I'm not sure that behaviour is a bug. Undesirable maybe. My understanding is > that Adobe Reader plugin uses the option "Display PDF in Browser" under > Edit\Preferences menu (Internet Tab) to decide whether to open a separate > window for PDF links or not. Not exactly. The above option controls whether the plugin is used altogether if you enter a PDF address in the browser's address bar or click a hyperlink targeting a PDF. If you disable it, then Adobe Reader or Acrobat is always used standalone to view PDFs. There is another option that also relates to the /NewWindow flag. On the General Tab, I have the possibility to disable "Open cross-document links in the same window". This determines what happens if no explicit value for the /NewWindow flag is specified. Only, this option does not influence the behavior in the plugin; only relevant for standalone mode.
        Hide
        Chris Bowditch added a comment -

        <quote>
        I guess if the Acrobat plug-in does not handle the "NewWindow" flag properly,
        there's not much we can do. It probably needs to be considered a bug in Adobe's
        code.
        </quote>

        I'm not sure that behaviour is a bug. Undesirable maybe. My understanding is that Adobe Reader plugin uses the option "Display PDF in Browser" under Edit\Preferences menu (Internet Tab) to decide whether to open a separate window for PDF links or not.

        Show
        Chris Bowditch added a comment - <quote> I guess if the Acrobat plug-in does not handle the "NewWindow" flag properly, there's not much we can do. It probably needs to be considered a bug in Adobe's code. </quote> I'm not sure that behaviour is a bug. Undesirable maybe. My understanding is that Adobe Reader plugin uses the option "Display PDF in Browser" under Edit\Preferences menu (Internet Tab) to decide whether to open a separate window for PDF links or not.
        Hide
        Jeremias Maerki added a comment -

        Good stuff, Andreas (only a quick glance taken). The only thing that is probably missing is a parse method for the intermediate format.

        I guess if the Acrobat plug-in does not handle the "NewWindow" flag properly, there's not much we can do. It probably needs to be considered a bug in Adobe's code.

        Show
        Jeremias Maerki added a comment - Good stuff, Andreas (only a quick glance taken). The only thing that is probably missing is a parse method for the intermediate format. I guess if the Acrobat plug-in does not handle the "NewWindow" flag properly, there's not much we can do. It probably needs to be considered a bug in Adobe's code.
        Hide
        Andreas L. Delmelle added a comment -

        Additional reservations:
        The patch only adds show-destination functionality for links with an external-destination. Internal links are converted to destinations or local /GoTo actions, and there does not seem to be a way of forcing these to open in a new window.
        I have checked the behavior of Adobe Reader standalone and the web-browser plugin.
        The /NewWindow flag works as expected in standalone mode, but the plugin seems to happily ignore it.
        For external-links to non-PDF content (PDF: /URI action), the target obviously opens in a new web-browser window when clicked from Adobe Reader standalone. When viewed with the browser-plugin, the link always seems to target the current tab/window.

        Unless I'm missing something, implementing this in a way that is 100% compliant with the XSL-FO Rec, is not possible...?

        Show
        Andreas L. Delmelle added a comment - Additional reservations: The patch only adds show-destination functionality for links with an external-destination. Internal links are converted to destinations or local /GoTo actions, and there does not seem to be a way of forcing these to open in a new window. I have checked the behavior of Adobe Reader standalone and the web-browser plugin. The /NewWindow flag works as expected in standalone mode, but the plugin seems to happily ignore it. For external-links to non-PDF content (PDF: /URI action), the target obviously opens in a new web-browser window when clicked from Adobe Reader standalone. When viewed with the browser-plugin, the link always seems to target the current tab/window. Unless I'm missing something, implementing this in a way that is 100% compliant with the XSL-FO Rec, is not possible...?
        Hide
        Andreas L. Delmelle added a comment -

        Attachment Bugzilla_44634.patch has been added with description: patch for the implementation

        Show
        Andreas L. Delmelle added a comment - Attachment Bugzilla_44634.patch has been added with description: patch for the implementation
        Hide
        Andreas L. Delmelle added a comment -

        Been looking into this, and I think I got it working (see patch in attach)

        The only thing that's keeping me from committing ATM is that I'm unsure how to test for it...

        Show
        Andreas L. Delmelle added a comment - Been looking into this, and I think I got it working (see patch in attach) The only thing that's keeping me from committing ATM is that I'm unsure how to test for it...
        Hide
        Jeremias Maerki added a comment -

        (In reply to comment #2)
        > How can I hard-code for links will be opened in new window?
        >
        > Thanks much

        You're still looking for a work-around. I told you, there's none. Someone needs to implement this properly. There's no way around that. If you absolutely want a work-around, you can try inserting that "NewWindow" flag using a third-party PDF library (like PDFBox or iText). No guarantees that it'll work.

        Show
        Jeremias Maerki added a comment - (In reply to comment #2) > How can I hard-code for links will be opened in new window? > > Thanks much You're still looking for a work-around. I told you, there's none. Someone needs to implement this properly. There's no way around that. If you absolutely want a work-around, you can try inserting that "NewWindow" flag using a third-party PDF library (like PDFBox or iText). No guarantees that it'll work.
        Hide
        Luong To added a comment -

        How can I hard-code for links will be opened in new window?

        Thanks much

        Show
        Luong To added a comment - How can I hard-code for links will be opened in new window? Thanks much
        Hide
        Jeremias Maerki added a comment -

        I don't think there is a work-around. "show-destination" on basic-link simply has to be implemented. In PDFGoToRemote, the "NewWindow" entry has to be implemented, too, and the two things have to be connected via the PDFRenderer. Patches are welcome.

        Show
        Jeremias Maerki added a comment - I don't think there is a work-around. "show-destination" on basic-link simply has to be implemented. In PDFGoToRemote, the "NewWindow" entry has to be implemented, too, and the two things have to be connected via the PDFRenderer. Patches are welcome.

          People

          • Assignee:
            Unassigned
            Reporter:
            Luong To
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:

              Development