ICEpdf
  1. ICEpdf
  2. PDF-162

Links to external files no longer working

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.0.1
    • Fix Version/s: 4.0.1
    • Component/s: Core/Parsing
    • Labels:
      None
    • Environment:
      -

      Description

      Note from customer:

      The external links can either be a web address or a link to another file; I am attaching two files, where TI-NspireCASHelp_EN.pdf is the file to be opened in the embedded ICEpdf Viewer, and the TI-NspireCAS_ReferenceGuide_EN.pdf file (which is saved in the same location that the Help file) should be opened in the default pdf viewer of the system when the link in the Help file is clicked on.
      1. TI-NspireCASHelp_EN.PDF
        2.86 MB
        Tyler Johnson
      2. TI-NspireCAS_ReferenceGuide_EN.pdf
        4.77 MB
        Tyler Johnson

        Activity

        Hide
        Tyler Johnson added a comment -

        Clicking on the link produces the following output:

        00018513 <D> <class org.icepdf.ri.common.MyAnnotationCallback> Annotation ANNOTA
        TION= {A=3879 0R,Border=[0, 0, 0],Type=Annot,Rect=[3.09277, 136.186, 206.443, 15
        3.97],BS=

        {W=0, Type=Border, S=S}

        ,H=I,Subtype=Link,} 3878 0R
        00018513 <D> <class org.icepdf.ri.common.MyAnnotationCallback> Action: org.ic
        epdf.core.pobjects.actions.LaunchAction=

        {S=Launch, F=3882 0R, NewWindow=true}

        Show
        Tyler Johnson added a comment - Clicking on the link produces the following output: 00018513 <D> <class org.icepdf.ri.common.MyAnnotationCallback> Annotation ANNOTA TION= {A=3879 0R,Border= [0, 0, 0] ,Type=Annot,Rect=[3.09277, 136.186, 206.443, 15 3.97],BS= {W=0, Type=Border, S=S} ,H=I,Subtype=Link,} 3878 0R 00018513 <D> <class org.icepdf.ri.common.MyAnnotationCallback> Action: org.ic epdf.core.pobjects.actions.LaunchAction= {S=Launch, F=3882 0R, NewWindow=true}
        Hide
        Patrick Corless added a comment -

        It's actually not a bug. The Annotation callback can be implemented/extended to handle this type of annotation action. We've avoided adding this feature as it could potentially create a security hole in the viewer.

        Show
        Patrick Corless added a comment - It's actually not a bug. The Annotation callback can be implemented/extended to handle this type of annotation action. We've avoided adding this feature as it could potentially create a security hole in the viewer.
        Hide
        Patrick Corless added a comment -

        I did a little testing in and around this request and it appears the BareBonesBrowserLaunch handles this well for us on Windows, not sure about other OS's. If worse came to worse we could write a BareBonesFileLauncher for opening files with the native OS's file association.

        Around line 105 of the MyAnnotationCallback the stub for the LaunchAction instance of check would look like this.

        else if (action instanceof LaunchAction)

        { LaunchAction launchAction = (LaunchAction) action; String file = launchAction.getExternalFile(); String location = documentViewController.getDocument().getDocumentLocation(); location = location.substring(0, location.lastIndexOf(File.separator)+1); BareBonesBrowserLaunch.openURL(location+file); }
        Show
        Patrick Corless added a comment - I did a little testing in and around this request and it appears the BareBonesBrowserLaunch handles this well for us on Windows, not sure about other OS's. If worse came to worse we could write a BareBonesFileLauncher for opening files with the native OS's file association. Around line 105 of the MyAnnotationCallback the stub for the LaunchAction instance of check would look like this. else if (action instanceof LaunchAction) { LaunchAction launchAction = (LaunchAction) action; String file = launchAction.getExternalFile(); String location = documentViewController.getDocument().getDocumentLocation(); location = location.substring(0, location.lastIndexOf(File.separator)+1); BareBonesBrowserLaunch.openURL(location+file); }
        Hide
        Patrick Corless added a comment -

        Update the barebones launcher to handle file paths as well as urls. Now when a luanch action is clicked on the default annotation callback will launch the specified file using the os's default program for the file extension in question.

        Show
        Patrick Corless added a comment - Update the barebones launcher to handle file paths as well as urls. Now when a luanch action is clicked on the default annotation callback will launch the specified file using the os's default program for the file extension in question.

          People

          • Assignee:
            Patrick Corless
            Reporter:
            Tyler Johnson
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: