Package com.openhtmltopdf.pdfboxout
Class PdfBoxFastLinkManager
java.lang.Object
com.openhtmltopdf.pdfboxout.PdfBoxFastLinkManager
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
(package private) static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final float
private org.apache.pdfbox.pdmodel.interactive.annotation.PDAppearanceDictionary
The lazily created appearance dict for emedded files.private final Map
<String, org.apache.pdfbox.pdmodel.common.filespecification.PDComplexFileSpecification> A map from uri to embedded file, so we don't embed files twice in case of a split link (example, two link boxes are formed when a link breaks in the middle).private final List
<PdfBoxFastLinkManager.LinkDetails> private final PdfBoxFastOutputDevice
private PdfBoxAccessibilityHelper
private final Box
private final SharedContext
-
Constructor Summary
ConstructorsConstructorDescriptionPdfBoxFastLinkManager
(SharedContext ctx, float dotsPerPoint, Box root, PdfBoxFastOutputDevice od) -
Method Summary
Modifier and TypeMethodDescriptionprivate Rectangle2D
add
(Rectangle2D r1, Rectangle2D r2) private void
addLinkToPage
(org.apache.pdfbox.pdmodel.PDPage page, AnnotationContainer annot, Box anchor, Box target) private void
addUriAsLink
(RenderingContext c, Box box, org.apache.pdfbox.pdmodel.PDPage page, float pageHeight, AffineTransform transform, Element elem, NamespaceHandler handler, String uri, Shape linkShape) private Rectangle2D
calcTotalLinkArea
(RenderingContext c, Box box, float pageHeight, AffineTransform transform) private Rectangle2D
checkLinkArea
(org.apache.pdfbox.pdmodel.PDPage page, RenderingContext c, Box box, float pageHeight, AffineTransform transform, Shape linkShape) private org.apache.pdfbox.pdmodel.interactive.documentnavigation.destination.PDPageXYZDestination
createDestination
(RenderingContext c, Box box) private AnnotationContainer
createFileEmbedLinkAnnotation
(Element elem, String uri) Create a file attachment link, being careful not to embed the same file (as specified by uri) more than once.private org.apache.pdfbox.pdmodel.interactive.annotation.PDAppearanceDictionary
Create an empty appearance stream to hide the pin icon used by various pdf reader for signaling an embedded fileprivate String
createRectKey
(Rectangle2D rect, Shape linkShape, AffineTransform transform) static Rectangle2D
createTargetArea
(RenderingContext c, Box box, float pageHeight, AffineTransform transform, Box _root, PdfBoxOutputDevice _od) private static boolean
isPointEqual
(Point2D.Float p1, Point2D.Float p2) private static boolean
(package private) static PdfBoxFastLinkManager.QuadPointShape
mapShapeToQuadPoints
(AffineTransform transform, Shape linkShape, Rectangle2D targetArea) private boolean
placeAnnotation
(AffineTransform transform, Shape linkShape, Rectangle2D targetArea, AnnotationContainer annot) private void
processLink
(RenderingContext c, Box box, org.apache.pdfbox.pdmodel.PDPage page, float pageHeight, AffineTransform transform) void
processLinkLater
(RenderingContext c, Box box, org.apache.pdfbox.pdmodel.PDPage page, float pageHeight, AffineTransform transform) void
private static void
removeDoublicatePoints
(List<Point2D.Float> points)
-
Field Details
-
_linkTargetAreas
-
_dotsPerPoint
private final float _dotsPerPoint -
_root
-
_od
-
_links
-
_pdfUa
-
_embeddedFiles
private final Map<String,org.apache.pdfbox.pdmodel.common.filespecification.PDComplexFileSpecification> _embeddedFilesA map from uri to embedded file, so we don't embed files twice in case of a split link (example, two link boxes are formed when a link breaks in the middle). -
_embeddedFileAppearance
private org.apache.pdfbox.pdmodel.interactive.annotation.PDAppearanceDictionary _embeddedFileAppearanceThe lazily created appearance dict for emedded files.
-
-
Constructor Details
-
Method Details
-
calcTotalLinkArea
private Rectangle2D calcTotalLinkArea(RenderingContext c, Box box, float pageHeight, AffineTransform transform) -
add
-
createRectKey
-
checkLinkArea
private Rectangle2D checkLinkArea(org.apache.pdfbox.pdmodel.PDPage page, RenderingContext c, Box box, float pageHeight, AffineTransform transform, Shape linkShape) -
processLink
private void processLink(RenderingContext c, Box box, org.apache.pdfbox.pdmodel.PDPage page, float pageHeight, AffineTransform transform) -
isPointEqual
-
removeDoublicatePoints
-
addUriAsLink
private void addUriAsLink(RenderingContext c, Box box, org.apache.pdfbox.pdmodel.PDPage page, float pageHeight, AffineTransform transform, Element elem, NamespaceHandler handler, String uri, Shape linkShape) -
createFileEmbedLinkAnnotation
Create a file attachment link, being careful not to embed the same file (as specified by uri) more than once. The element should have the following attributes: download="embedded-filename.ext", data-content-type="file-mime-type" which defaults to "application/octet-stream", relationship (required for PDF/A3), one of: "Source", "Supplement", "Data", "Alternative", "Unspecified", title="file description" (recommended for PDF/A3). -
createFileEmbedLinkAppearance
private org.apache.pdfbox.pdmodel.interactive.annotation.PDAppearanceDictionary createFileEmbedLinkAppearance()Create an empty appearance stream to hide the pin icon used by various pdf reader for signaling an embedded file -
isURI
-
placeAnnotation
private boolean placeAnnotation(AffineTransform transform, Shape linkShape, Rectangle2D targetArea, AnnotationContainer annot) -
mapShapeToQuadPoints
static PdfBoxFastLinkManager.QuadPointShape mapShapeToQuadPoints(AffineTransform transform, Shape linkShape, Rectangle2D targetArea) -
addLinkToPage
private void addLinkToPage(org.apache.pdfbox.pdmodel.PDPage page, AnnotationContainer annot, Box anchor, Box target) -
createDestination
private org.apache.pdfbox.pdmodel.interactive.documentnavigation.destination.PDPageXYZDestination createDestination(RenderingContext c, Box box) -
createTargetArea
public static Rectangle2D createTargetArea(RenderingContext c, Box box, float pageHeight, AffineTransform transform, Box _root, PdfBoxOutputDevice _od) -
processLinkLater
public void processLinkLater(RenderingContext c, Box box, org.apache.pdfbox.pdmodel.PDPage page, float pageHeight, AffineTransform transform) -
processLinks
-