Summary: | implement show-destination for fo:basic-link | ||
---|---|---|---|
Product: | Fop - Now in Jira | Reporter: | Luong To <lto> |
Component: | Assignee: | fop-dev | |
Status: | NEW --- | ||
Severity: | enhancement | ||
Priority: | P3 | ||
Version: | 0.93 | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Attachments: | patch for the implementation |
Description
Luong To
2008-03-19 08:44:40 UTC
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. How can I hard-code for links will be opened in new window? Thanks much (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. 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... Created attachment 21738 [details]
patch for the implementation
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...? 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. <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. (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. 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... resetting P2 open bugs to P3 pending further review change status from ASSIGNED to NEW for consistency |