Class Link
- java.lang.Object
-
- com.pdftools.toolbox.internal.NativeBase
-
- com.pdftools.toolbox.internal.NativeObject
-
- com.pdftools.toolbox.pdf.navigation.Link
-
- Direct Known Subclasses:
EmbeddedPdfLink
,InternalLink
,WebLink
public abstract class Link extends NativeObject
A link
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Link
copy(Document targetDocument, Link link)
Copy a link from an input document to a output document.QuadrilateralList
getActiveArea()
The link area (Getter)Rectangle
getBoundingBox()
The location on the page (Getter)boolean
getHidden()
The link's visibility (Getter)boolean
getNoPrint()
The link's visibility when printing (Getter)void
setBorderStyle(Stroke value)
The link's border (Setter)-
Methods inherited from class com.pdftools.toolbox.internal.NativeObject
equals, hashCode
-
-
-
-
Method Detail
-
copy
public static Link copy(Document targetDocument, Link link) throws java.io.IOException, ConformanceException
Copy a link from an input document to a output document.
- Parameters:
targetDocument
- the output document with which the returned object is associatedlink
- the link to be copied to thetargetDocument
- Returns:
- the copied link, associated with the
targetDocument
- Throws:
java.lang.IllegalArgumentException
- if thetargetDocument
has already been closedjava.lang.IllegalArgumentException
- if thetargetDocument
is read-onlyjava.lang.IllegalArgumentException
- if thelink
is not associated with an input documentjava.lang.IllegalArgumentException
- if the document associated with thelink
object has already been closedConformanceException
- The conformance level of the input document is not compatible with the conformance level of thetargetDocument
.java.io.IOException
- Error reading from the input document or writing to the output documentjava.lang.IllegalArgumentException
- iftargetDocument
isnull
java.lang.IllegalArgumentException
- iflink
isnull
-
getActiveArea
public QuadrilateralList getActiveArea() throws CorruptException
The link area (Getter)
The link is activated when a mouse click falls within the area defined by this list oftoolbox.geometry.real.Quadrilateral
s.- Throws:
java.lang.IllegalStateException
- if the object has already been closedCorruptException
- if the PDF is corrupt
-
getBoundingBox
public Rectangle getBoundingBox() throws CorruptException
The location on the page (Getter)
- Throws:
java.lang.IllegalStateException
- if the object has already been closedCorruptException
- if the PDF is corrupt
-
getHidden
public boolean getHidden()
The link's visibility (Getter)
Iftrue
then the link is present, but is invisible and not available for user interaction. Depending on thegetNoPrint()
property it will, however, still be visible when printing.- Throws:
java.lang.IllegalStateException
- if the object has already been closed
-
getNoPrint
public boolean getNoPrint()
The link's visibility when printing (Getter)
Iftrue
then the link is not present in a print output of the document.- Throws:
java.lang.IllegalStateException
- if the object has already been closed
-
setBorderStyle
public void setBorderStyle(Stroke value) throws UnsupportedFeatureException
The link's border (Setter)
This property defines if and how a rectangular border is drawn for the link.- Throws:
java.lang.IllegalStateException
- if the object has already been closedjava.lang.UnsupportedOperationException
- if the document is read-onlyjava.lang.IllegalArgumentException
- the giventoolbox.pdf.content.Stroke
object is associated with a different documentjava.lang.IllegalArgumentException
- the giventoolbox.pdf.content.Stroke
object has atoolbox.pdf.content.Stroke.getDashPhase
differing from 0java.lang.IllegalArgumentException
- the giventoolbox.pdf.content.Stroke
object has atoolbox.pdf.content.Stroke.getMiterLimit
differing from 10java.lang.IllegalArgumentException
- the giventoolbox.pdf.content.Stroke
object has atoolbox.pdf.content.Stroke.getLineCapStyle
other thantoolbox.pdf.content.LineCapStyle.BUTT
java.lang.IllegalArgumentException
- the giventoolbox.pdf.content.Stroke
object has atoolbox.pdf.content.Stroke.getLineJoinStyle
other thantoolbox.pdf.content.LineJoinStyle.MITER
java.lang.IllegalArgumentException
- the giventoolbox.pdf.content.Stroke
object'stoolbox.pdf.content.Stroke.getPaint
has a color space other than a device color space, or a calibrated color space.UnsupportedFeatureException
- the giventoolbox.pdf.content.Stroke
object'stoolbox.pdf.content.Stroke.getPaint
has a DeviceGray, DeviceCMYK, or CalGray color space.
-
-