Package org.nuxeo.ecm.platform.pdf
Class PDFLinks
- java.lang.Object
-
- org.nuxeo.ecm.platform.pdf.PDFLinks
-
public class PDFLinks extends Object
Extract links as list ofLinkInfo
from a PDF.In this first version, extracts only the links of type PDActionRemoteGoTo and PDActionLaunch (typically, when a PDF has a relative link to an external PDF).
If the PDF is encrypted, a call to
setPassword
must be done before any attempt to get the links.IMPORTANT
Because we can parse the documents several times to get different links, we don't close it after every call (optimization), it is the caller responsibility to explicitly close it to avoid leaks.
- Since:
- 8.10
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
To avoid opening/parsing several times the same document, we don't close it after a get...Link() call.List<LinkInfo>
getLaunchLinks()
Return all links of type "Launch" (PDActionLaunch.SUB_TYPE
).List<LinkInfo>
getRemoteGoToLinks()
Return all links of type "GoToR" (PDActionRemoteGoTo.SUB_TYPE
).List<LinkInfo>
getURILinks()
Return all links of type "URI" (PDActionURI.SUB_TYPE
).void
setPassword(String password)
-
-
-
Method Detail
-
close
public void close()
To avoid opening/parsing several times the same document, we don't close it after a get...Link() call. It is important that the caller explcitly closes it.
-
getRemoteGoToLinks
public List<LinkInfo> getRemoteGoToLinks() throws IOException
Return all links of type "GoToR" (PDActionRemoteGoTo.SUB_TYPE
).- Throws:
IOException
-
getLaunchLinks
public List<LinkInfo> getLaunchLinks() throws IOException
Return all links of type "Launch" (PDActionLaunch.SUB_TYPE
).- Throws:
IOException
-
getURILinks
public List<LinkInfo> getURILinks() throws IOException
Return all links of type "URI" (PDActionURI.SUB_TYPE
).- Throws:
IOException
-
setPassword
public void setPassword(String password)
-
-