Top Inners Fields Constructors Methods
com.openhtmltopdf.pdfboxout

public Class PdfBoxFastLinkManager

extends Object
Class Inheritance
Imports
com.openhtmltopdf.extend.NamespaceHandler, .ReplacedElement, com.openhtmltopdf.layout.SharedContext, com.openhtmltopdf.outputdevice.helper.ExternalResourceType, com.openhtmltopdf.pdfboxout.PdfBoxLinkManager.IPdfBoxElementWithShapedLinks, com.openhtmltopdf.pdfboxout.quads.KongAlgo, .Triangle, com.openhtmltopdf.render.BlockBox, .Box, .RenderingContext, com.openhtmltopdf.render.displaylist.PagedBoxCollector, com.openhtmltopdf.util.LogMessageId, .XRLog, org.apache.pdfbox.cos.COSArray, .COSName, org.apache.pdfbox.pdmodel.PDPage, .PDResources, org.apache.pdfbox.pdmodel.common.PDRectangle, org.apache.pdfbox.pdmodel.common.filespecification.PDComplexFileSpecification, .PDEmbeddedFile, org.apache.pdfbox.pdmodel.interactive.action.PDAction, .PDActionGoTo, .PDActionJavaScript, .PDActionURI, org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotation, .PDAnnotationFileAttachment, .PDAnnotationLink, .PDAppearanceDictionary, .PDAppearanceStream, .PDBorderStyleDictionary, org.apache.pdfbox.pdmodel.interactive.documentnavigation.destination.PDPageXYZDestination, org.w3c.dom.Element, java.awt.*, java.awt.geom.*, java.io.ByteArrayInputStream, .IOException, java.net.URI, java.util.*, .List, .Map.Entry, java.util.logging.Level

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
pack-priv static class

Field Summary

Modifier and TypeField and Description
private final float
private PDAppearanceDictionary
_embeddedFileAppearance

The lazily created appearance dict for emedded files.

private final Map<String, PDComplexFileSpecification>
_embeddedFiles

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 Map<PDPage, Set<String>>
private final PdfBoxFastOutputDevice
private PdfBoxAccessibilityHelper
private final Box
private final SharedContext

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private Rectangle2D
private void
addLinkToPage(PDPage page, AnnotationContainer annot, Box anchor, Box target)

private Rectangle2D
calcTotalLinkArea(RenderingContext c, Box box, float pageHeight, AffineTransform transform)

private Rectangle2D
checkLinkArea(PDPage page, RenderingContext c, Box box, float pageHeight, AffineTransform transform, Shape linkShape)

private PDPageXYZDestination
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 PDAppearanceDictionary
createFileEmbedLinkAppearance()

Create an empty appearance stream to hide the pin icon used by various pdf reader for signaling an embedded file

private String
createRectKey(Rectangle2D rect, Shape linkShape, AffineTransform transform)

public static Rectangle2D
createTargetArea(RenderingContext c, Box box, float pageHeight, AffineTransform transform, Box _root, PdfBoxOutputDevice _od)

private static boolean
private static boolean
pack-priv static PdfBoxFastLinkManager.QuadPointShape
mapShapeToQuadPoints(AffineTransform transform, Shape linkShape, Rectangle2D targetArea)

private boolean
placeAnnotation(AffineTransform transform, Shape linkShape, Rectangle2D targetArea, AnnotationContainer annot)

public void
processLinkLater(RenderingContext c, Box box, PDPage page, float pageHeight, AffineTransform transform)

private static void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_dotsPerPointback to summary
private final float _dotsPerPoint
_embeddedFileAppearanceback to summary
private PDAppearanceDictionary _embeddedFileAppearance

The lazily created appearance dict for emedded files.

_embeddedFilesback to summary
private final Map<String, PDComplexFileSpecification> _embeddedFiles

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).

_linkTargetAreasback to summary
private final Map<PDPage, Set<String>> _linkTargetAreas
_odback to summary
private final PdfBoxFastOutputDevice _od
_pdfUaback to summary
private PdfBoxAccessibilityHelper _pdfUa
_rootback to summary
private final Box _root
_sharedContextback to summary
private final SharedContext _sharedContext

Constructor Detail

PdfBoxFastLinkManagerback to summary
public PdfBoxFastLinkManager(SharedContext ctx, float dotsPerPoint, Box root, PdfBoxFastOutputDevice od)

Method Detail

addback to summary
private Rectangle2D add(Rectangle2D r1, Rectangle2D r2)
addLinkToPageback to summary
private void addLinkToPage(PDPage page, AnnotationContainer annot, Box anchor, Box target)
calcTotalLinkAreaback to summary
private Rectangle2D calcTotalLinkArea(RenderingContext c, Box box, float pageHeight, AffineTransform transform)
checkLinkAreaback to summary
private Rectangle2D checkLinkArea(PDPage page, RenderingContext c, Box box, float pageHeight, AffineTransform transform, Shape linkShape)
createDestinationback to summary
private PDPageXYZDestination createDestination(RenderingContext c, Box box)
createFileEmbedLinkAnnotationback to summary
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. 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).

createFileEmbedLinkAppearanceback to summary
private PDAppearanceDictionary createFileEmbedLinkAppearance()

Create an empty appearance stream to hide the pin icon used by various pdf reader for signaling an embedded file

createRectKeyback to summary
private String createRectKey(Rectangle2D rect, Shape linkShape, AffineTransform transform)
createTargetAreaback to summary
public static Rectangle2D createTargetArea(RenderingContext c, Box box, float pageHeight, AffineTransform transform, Box _root, PdfBoxOutputDevice _od)
isPointEqualback to summary
private static boolean isPointEqual(Point2D.Float p1, Point2D.Float p2)
isURIback to summary
private static boolean isURI(String uri)
mapShapeToQuadPointsback to summary
pack-priv static PdfBoxFastLinkManager.QuadPointShape mapShapeToQuadPoints(AffineTransform transform, Shape linkShape, Rectangle2D targetArea)
placeAnnotationback to summary
private boolean placeAnnotation(AffineTransform transform, Shape linkShape, Rectangle2D targetArea, AnnotationContainer annot)
Annotations
@SuppressWarnings:BooleanMethodIsAlwaysInverted
processLinkLaterback to summary
public void processLinkLater(RenderingContext c, Box box, PDPage page, float pageHeight, AffineTransform transform)
removeDoublicatePointsback to summary
private static void removeDoublicatePoints(List<Point2D.Float> points)
com.openhtmltopdf.pdfboxout back to summary

private Class PdfBoxFastLinkManager.LinkDetails

extends Object
Class Inheritance
  • java.lang.Object
  • com.openhtmltopdf.pdfboxout.PdfBoxFastLinkManager.LinkDetails

Field Summary

Modifier and TypeField and Description
pack-priv Box
pack-priv RenderingContext
c

pack-priv PDPage
pack-priv float
pack-priv AffineTransform

Constructor Summary

AccessConstructor and Description
private

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

boxback to summary
pack-priv Box box
cback to summary
pack-priv RenderingContext c
pageback to summary
pack-priv PDPage page
pageHeightback to summary
pack-priv float pageHeight
transformback to summary
pack-priv AffineTransform transform

Constructor Detail

LinkDetailsback to summary
private LinkDetails()
com.openhtmltopdf.pdfboxout back to summary

pack-priv Class PdfBoxFastLinkManager.QuadPointShape

extends Object
Class Inheritance
  • java.lang.Object
  • com.openhtmltopdf.pdfboxout.PdfBoxFastLinkManager.QuadPointShape

Field Summary

Modifier and TypeField and Description
pack-priv Rectangle2D
pack-priv float[]

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

boundingBoxback to summary
pack-priv Rectangle2D boundingBox
quadPointsback to summary
pack-priv float[] quadPoints

Constructor Detail

QuadPointShapeback to summary
pack-priv QuadPointShape()