pdf_document library
Document-level PDF semantics on top of the COS layer: page tree, inherited attributes, and metadata.
Classes
- ContentWriter
- Builds content-stream bytes operator by operator.
- JpegInfo
- PdfAcroForm
- The document's interactive form (§12.7.2): the catalog's /AcroForm dictionary plus the field tree hanging off /Fields.
- PdfAction
- An action dictionary (§12.6). Unrecognized types parse as PdfUnknownAction with the raw dictionary attached, so apps can still inspect /Launch, /GoToR, /SubmitForm, ... themselves.
- PdfAnnotation
- An entry in a page's /Annots array (§12.5).
- PdfAnnotationChange
- One entry of an annotation diff (pdfDiffAnnotations): the unit a sync layer stores and replays.
- PdfAnnotationSnapshot
- A self-contained copy of one annotation: its dictionary with every referenced object - appearance streams included - resolved and copied inline, detached from the document it came from.
- PdfAttachments
-
Reads embedded files (attachments) from a document: both the
document-level
/Names → /EmbeddedFilesname tree (§7.11.4) and/FileAttachmentannotations (§12.5.6.15). - PdfCacheStore
- A pluggable key → bytes store backing the on-disk caches (PdfDiskCache and everything layered on it).
- PdfComment
- One comment in a thread: an annotation with text plus its direct replies and the state history recorded against it (§12.5.6.x).
- PdfCommentThread
- A reply thread rooted at one markup annotation (§12.5.6.x), with its replies linked by /IRT and its review state recorded as state replies.
- PdfConformanceIssue
- One finding against a conformance profile.
- PdfConformanceReport
- The result of validating a document against a conformance profile.
- PdfContentColor
- A device color found in page-content color operators.
- PdfContentElement
- One deletable drawing on a page: a contiguous run of content-stream operations together with what they paint and roughly where.
- PdfDestination
- An explicit destination (§12.3.2.2): a target page plus how to fit it.
- PdfDiskCache
- A size-bounded, persistent LRU on top of a PdfCacheStore.
- PdfDocument
- A PDF document with page-level semantics on top of the COS layer.
- PdfDss
- The /DSS Document Security Store (PDF 2.0 §12.8.4.3): the certificates, OCSP responses, and CRLs a document carries for long-term validation.
- PdfEditor
- High-level editing session over a PdfDocument.
- PdfEmbeddableImage
- A raster image parsed and ready to embed as a PDF image XObject.
- PdfEmbeddedFile
- One embedded file: its names, metadata, and (lazily decoded) bytes.
- PdfEmbeddedFont
- A TrueType/OpenType font program, parsed and ready to embed in a PDF as a full-Unicode composite (Type0) font.
- PdfExplicitDestination
- An explicit destination to author (§12.3.2.2): a page plus a view fit.
- PdfFormField
- One terminal field of the form: a value plus the widget annotations that display it on pages.
- PdfFormFieldInfo
- Persistable metadata for one terminal field - what a template editor stores about a form without reading values (see PdfAcroForm.describeFields).
- PdfFreeTextRun
- One styled run inside a rich free-text annotation.
- PdfFreeTextStyle
- A free-text annotation's text and box styling, as recoverable from its dictionary (see PdfAnnotation.freeTextStyle). Colors are 0xRRGGBB.
- PdfGoToAction
- /GoTo: jump to a destination in this document.
-
A repeating header or footer: up to three text slots (left, centre,
right) drawn in Helvetica. Each slot is a template that may contain the
dynamic tokens
{page}(1-based page number),{pages}(page count),{label}(the logical page label when the document carries/PageLabels, else the page number), and{date}(the stamp date asYYYY-MM-DD). - PdfImageAlign
-
Where the image sits inside the page's content box, as fractions of the
leftover space:
xruns −1 (left) → 0 (centre) → 1 (right),yruns −1 (bottom) → 0 (centre) → 1 (top). Only matters when the scaled image is smaller than the content box (PdfImageFit.contain / PdfImageFit.none); PdfImageFit.cover and PdfImageFit.fill leave no slack. - PdfImageDocument
- Assembles a brand-new PDF from a list of raster images - one page per image.
- PdfImportSource
- A host-provided converter from a non-PDF document format into PDF bytes.
- PdfJavaScriptAction
- /JavaScript: the script is surfaced verbatim - there is deliberately no JS engine here. Apps that author their own PDFs can pattern-match the source; everything else should be ignored.
- PdfLinkAnnotation
- A /Link annotation: a clickable region with an action (§12.5.6.5).
- PdfLoopbackSyncHub
-
An in-memory hub that wires PdfSyncTransport endpoints together - the
reference transport for tests and local multi-view demos. It is pure
Dart (no
dart:io, no sockets): connect returns an endpoint, and asendfans out to every other connected endpoint on a microtask, so two PdfSyncSessions sharing one hub exchange changes and converge. - PdfMarkedContentRef
- Where a structure element's content lives: a marked-content sequence on a page (a /MCID, §14.7.4.3) or an integer /K referencing one.
- PdfMeasure
- A measurement dictionary (§12.9.2): the scale and unit formats that turn a measurement annotation's page-space geometry into a real-world distance, perimeter, or area.
- PdfMeasurementResult
- A computed takeoff measurement: the kind, the real-world numeric value in unit, the formatted display text, and the count of items this entry represents (1 for everything but a count marker, which may bundle several). Returned by PdfAnnotation.measurementResult.
- PdfMemoryCacheStore
- An in-memory PdfCacheStore - the zero-dependency default that works on every platform.
- PdfNamedAction
- /Named: a viewer-defined action (NextPage, PrevPage, FirstPage, LastPage are the standard four).
- PdfNumberFormat
- A number-format dictionary (§12.9.2, Table 22.7): how one component of a measured value is converted and displayed.
- PdfObjectRef
- A reference from a structure element to a whole object - typically an annotation or form field - rather than a marked-content sequence (/OBJR, §14.7.4.3).
- PdfOcrSpan
- A single fragment of recognized text positioned in PDF user space - the unit an OCR engine returns and PdfOcrEditing.injectTextLayer writes onto a page.
- PdfOfficeConverter
-
A pluggable office-to-PDF converter - the seam for
.docx/.xlsx/etc. ingestion, mirroring how`PdfOcrEngine`plugs OCR in. - PdfOfficeDocument
- A source office document handed to a PdfOfficeConverter.
- PdfOutline
- A read-only view of the document outline (bookmarks) tree.
- PdfOutlineItem
- A single outline (bookmark) entry.
- PdfPage
- A single page, with inheritable attributes already resolved.
- PdfPageElements
- The drawable elements of one page's content stream, in paint order.
- PdfPageLabelRange
- One range of the page-label number tree: from startPage (inclusive, zero-based) until the next range begins.
- PdfPageLabels
-
Reads the
/PageLabelsnumber tree and computes logical page labels. - PdfPageSize
- A page size in PDF points (1 pt = 1/72 inch) for PdfImageDocument.
- PdfRect
- A rectangle in PDF user space (origin bottom-left, y grows upward).
- PdfReviewStateEntry
- One state change recorded in a thread: a reply annotation carrying a /State + /StateModel (§12.5.6.2). The current state of a comment is the newest entry by at.
- PdfRevocationMaterial
-
Revocation and certificate material gathered for a signature's chain,
ready to embed in a /DSS for LTV. All blobs are DER: OCSP responses are
OCSPResponsestructures, CRLs areCertificateLists, and certificates are extra X.509 certificates (intermediates, responder certs) the verifier may need offline. - PdfSignature
- A signed signature field: the /V signature dictionary of an AcroForm field with /FT /Sig (§12.8).
- PdfSignatureValidation
- Outcome of validating one signature.
- PdfStamp
- Drawing surface handed to PdfContentEditing.stampPage: high-level helpers plus the raw content writer for anything else. Coordinates are PDF user space (origin bottom-left).
- PdfStampTemplate
- Editable vector template for a reusable rubber stamp.
- PdfStampTemplateComponent
- PdfStructElement
- One element of the logical structure tree (/StructElem, §14.7.2).
- PdfStructParentTree
- The /ParentTree (a number tree, §14.7.4.4) mapping each page's /StructParents key - and each object's /StructParent key - back to the structure element(s) that tag it. Built lazily; lets a reader go from a marked-content id on a page to its owning structure element.
- PdfStructSpec
-
Author-side description of one structure element to write - the input to
PdfEditor.writeStructTree. Build a tree of these, attach the marked-content ids (mcids, on page pageIndex) and object references (objects) each element tags, then hand the roots to the editor. - PdfStructTree
- The document structure tree root (catalog /StructTreeRoot, §14.7.2).
- PdfSyncMessage
-
One annotation change wrapped with the metadata the merge layer needs:
who produced it (origin) and a logical clock timestamp. The pair
(clock, origin)is the total order a PdfSyncSession uses for last-writer-wins conflict resolution, keyed on the change's /NM. - PdfSyncSession
- A transport-agnostic collaborative editing session over one document's annotations, built on the snapshot + diff primitives (pdfDiffAnnotations, PdfAnnotationSnapshot, PdfAnnotationSyncEditing.upsertAnnotation).
- PdfSyncTransport
- The transport seam a PdfSyncSession talks through - the same shape of injectable dependency as the OCR engine: the library defines the interface and a loopback reference (PdfLoopbackSyncHub); the host supplies the real one (a WebSocket, WebRTC data channel, or backend fan-out). No networking lives in this package.
- PdfTakeoffData
- The takeoff metadata an annotation carries beyond the standard /Measure and geometry: which PdfMeasurementKind it represents, plus the extra inputs the kind needs (a depth for volume, holes for a net-area cutout) and a label used to group it into a running total.
- PdfTakeoffGroup
- One bucket in a PdfTakeoffSummary: every measurement of the same kind and unit sharing a label, with the running total and item count. The bucket of count markers reports its tally in count and mirrors it in total.
- PdfTakeoffSummary
- Per-kind running totals over a document's measurement annotations - the data behind the takeoff tool's tallies and (later) the markups list.
- PdfTextFont
-
The common contract the free-text appearance generator needs from a
font, whether it is one of the base-14 PdfStandardFont faces or an
embedded
PdfEmbeddedFont: a resource name for /DA and the /Font dict, an ascent for baseline placement, and text measurement for wrapping. - PdfTimestampInfo
- A validated RFC 3161 timestamp embedded in a signature or document timestamp.
- PdfTrustStore
- Trust anchors for certificate-chain validation: the root (and any directly trusted) certificates the verifier chooses to rely on. The library ships no built-in roots - supply your platform's or your organization's.
- PdfUnicodeFont
- A lightweight Type0 font that maps Unicode code points directly as glyph IDs with Identity-H encoding, without embedding any font program.
- PdfUnknownAction
- Any /S type without a dedicated class yet.
- PdfUriAction
- /URI: open a (possibly app-defined) URI. The conventional bridge for "a button in the PDF drives the host app": author links with a custom scheme and dispatch on it in the viewer's action callback.
- PdfVectorSnapshot
- A detached, vector copy of a rectangular region of a page - the page content and resources under the region, resolved and copied inline so the snapshot survives edits, undo, and even closing the source document.
- PdfWidgetAnnotation
- A /Widget annotation: the visible incarnation of an AcroForm field (§12.5.6.19). Push buttons carry actions; other field kinds will grow value accessors when form filling lands.
- UnsupportedPdfOfficeConverter
- The default PdfOfficeConverter: it supports nothing and throws on every call, so an unwired host fails loudly with guidance toward a real converter rather than silently doing nothing.
Enums
- PdfAlignment
- How a set of annotation rectangles should be lined up or spread out relative to one another. The first six values align an edge or centre line of every rect to a shared reference taken from the group's overall bounding box; the last two spread the rects so the gaps between them are equal.
- PdfAnnotationChangeKind
- What happened to one annotation between two document states.
- PdfConformanceSeverity
- How serious a conformance finding is.
- PdfElementKind
- What a content element draws.
- PdfFieldType
- What kind of input a form field accepts, derived from /FT plus the discriminating /Ff bits (§12.7.4).
- PdfImageFit
- How an image is scaled to fill its page when a fixed PdfPageSize is chosen. Ignored when the page is sized to the image (the default).
- PdfLineEnding
-
Line ending styles (§12.5.6.7, Table 176) drawn at a /Line or
/PolyLine endpoint by
PdfEditor.addLine/PdfEditor.addPolyLine. - PdfMeasurementKind
- The kind of measurement PdfAnnotationEditing.addMeasurement creates.
- PdfOfficeFormat
- An office document format that a PdfOfficeConverter may know how to render to PDF.
- PdfPadesLevel
- The PAdES baseline levels, in increasing order of long-term assurance.
- PdfPageLabelStyle
- Numbering style of a page-label range (§12.4.2).
- PdfReviewModel
- The two /StateModel families (§12.5.6.2).
- PdfReviewState
- A review or marked state an annotation can be put in (§12.5.6.2, Tables 178–179). Each value names both the /State string and the /StateModel family it belongs to.
- PdfRevocationStatus
- The revocation verdict for a certificate, from embedded LTV material.
- PdfStampTemplateComponentType
- PdfStandardFont
- The standard one-byte fonts the editors write text with - the bold, italic, and bold-italic variants of a sans-serif, serif, and monospace pick from the PDF base-14 set, which every viewer renders without embedding.
- PdfStandardFontFamily
- The three base-14 type families the editors write text with - a sans-serif, serif, and monospace pick that every viewer renders without embedding. The bold/italic variants of each are individual PdfStandardFont values; this is the axis the UI's family picker selects, orthogonal to the bold/italic toggles.
- PdfTextAlign
- Horizontal alignment of the lines inside a free-text box, mapped to the /Q quadding value (§12.7.4.3): 0 left, 1 centered, 2 right.
- PdfTextDirection
- Logical text direction for text appearances authored by this package.
Extensions
- PdfAnnotationClipboard on PdfEditor
- Pasting captured annotations (PdfAnnotationSnapshot) into a page.
- PdfAnnotationEditing on PdfEditor
- Annotation authoring (§12.5): each method creates an annotation with a generated appearance stream (/AP → /N), so the result displays the same in this renderer and in other viewers.
- PdfAnnotationSyncEditing on PdfEditor
- Name-keyed annotation editing: the replay half of a sync layer.
- PdfAttachmentEditing on PdfEditor
-
Authoring of embedded files (attachments): the document-level
/Names → /EmbeddedFilesname tree (§7.11.4) and/FileAttachmentannotations (§12.5.6.15). Each embedded file becomes a proper/EmbeddedFilestream with/Paramscarrying its size and MD5 checksum, optionally Flate-compressed. - PdfColorProcessing on PdfEditor
- Page-content color processing: find a device color and replace it with another across content streams.
- PdfCommentEditing on PdfEditor
- Authoring reply threads on markup annotations (§12.5.6.x): replies linked by /IRT, and review/marked state recorded as state replies (§12.5.6.2). Regenerated so other readers (Acrobat) show the same thread.
- PdfContentEditing on PdfEditor
- Content editing tiers: stamping new content, deleting elements, and replacing text runs.
- PdfFormAdmin on PdfEditor
- AcroForm structure editing: creating, renaming, retyping, and removing fields, plus flattening the whole form into page content.
- PdfFormFilling on PdfEditor
- AcroForm filling (§12.7): setters write the field /V and regenerate each widget's appearance stream, so the filled value displays the same in this renderer and in other viewers without /NeedAppearances.
- PdfFormStyling on PdfEditor
- AcroForm text-field appearance styling (§12.7.3.3): changing a text field's font, size, colour, alignment, auto-size, and multiline, then regenerating its appearance so it looks identical here and in other viewers (no /NeedAppearances dependency).
- Stamps repeating headers and footers across a page range, building on PdfContentEditing.stampPage.
- PdfImportSourceDocument on PdfImportSource
- Opening the result of a PdfImportSource directly as a PdfDocument.
- PdfOcrEditing on PdfEditor
- Writing an OCR text layer onto a page.
- PdfOutlineEditing on PdfEditor
-
Authoring of the document outline (bookmarks): the
/Outlinestree (§12.3.3). Every mutation keeps the First/Last/Next/Prev/Parent linkage and the/Countinvariants consistent, and stages only the objects it touches so PdfEditor.save appends them as one incremental update. - PdfPadesSigning on PdfEditor
- PAdES (ETSI EN 319 142) signing: the enterprise signature tier on top of PdfSigning.saveSigned. Adds the CAdES baseline signed attributes (signing-certificate-v2), RFC 3161 signature timestamps, a /DSS Document Security Store for long-term validation, and a renewable document timestamp.
- PdfPageExtraction on PdfDocument
- Building a new document from a subset of this one's pages.
- PdfPageLabelEditing on PdfEditor
-
Authoring of the
/PageLabelsnumber tree (§12.4.2): a flat, key-sorted/Numsarray mapping the first page of each range to its label dictionary. - PdfPageOperations on PdfEditor
- Structural page operations: reordering, removal, and merging pages in from other documents. All of them rewrite the page tree as a single flat /Pages node, materializing inherited attributes onto each leaf first so nothing is lost when intermediate nodes drop out.
- PdfParagraphReflow on PdfEditor
- Tier 4 - paragraph reflow. Where PdfContentEditing.replaceText corrects text within a line (holding everything after it put), this re-wraps a whole paragraph: the replacement may make the paragraph grow or shrink by lines, the paragraph's lines are re-broken at its right margin, and the lines that follow it cascade up or down so nothing overlaps.
- PdfRedactionApply on PdfEditor
- Applying (burning) redaction marks created by PdfAnnotationEditing.addRedaction.
- PdfSigning on PdfEditor
- Signing: writes the pending edits plus a new signature as one incremental update, then fills in the byte range and CMS container.
- PdfTaggingAndArchival on PdfEditor
- Authoring and auto-tagging for the logical structure tree (§14.7) - the write half of Tagged PDF - plus PDF/A conversion. Grouped in one extension because PDF/A conversion reuses the XMP/metadata helpers below (Dart extension members are not callable across separate extensions).
- PdfTextDirectionResolution on PdfTextDirection
- PdfVectorSnapshotEditing on PdfEditor
-
Capturing and pasting vector regions (PdfVectorSnapshot) - the vector
half of the Snapshot tool, complementing the raster capture in
dart_pdf_editor.
Constants
-
helveticaBoldWidths
→ const List<
int> - AFM advance widths for Helvetica-Bold, characters 32–126.
-
helveticaWidths
→ const List<
int> - AFM advance widths for Helvetica, characters 32–126, in thousandths of an em (Adobe base-14 metrics).
-
kStandardStructureTypes
→ const Set<
String> - Standard structure types (PDF 1.7 Table 333). Any other type must be mapped onto one of these through the structure tree's /RoleMap.
-
timesBoldItalicWidths
→ const List<
int> - AFM advance widths for Times-BoldItalic, characters 32–126.
-
timesBoldWidths
→ const List<
int> - AFM advance widths for Times-Bold, characters 32–126.
-
timesItalicWidths
→ const List<
int> - AFM advance widths for Times-Italic, characters 32–126.
-
timesRomanWidths
→ const List<
int> - AFM advance widths for Times-Roman, characters 32–126.
Functions
-
alignmentOffsets(
List< PdfRect> rects, PdfAlignment alignment) → List<({double dx, double dy})> -
Computes the translation to apply to each rect in
rectsto satisfyalignment, returned as(dx, dy)offsets in PDF user space, parallel to (and in the same order as)rects. -
buildXmpPacket(
{String? title, String? author, String? subject, String? creatorTool, String? producer, String? createDate, String? modifyDate, int? pdfaPart, String? pdfaConformance, int? pdfUaPart}) → Uint8List - Builds an XMP packet with the Dublin Core, XMP Basic, PDF, and (when requested) the PDF/A and PDF/UA identification schemas.
-
measureHelvetica(
String text, double fontSize, {bool bold = false}) → double -
Measures
textin points atfontSize, using base-14 Helvetica metrics. Characters outside 32–126 count as an average width. -
measureStandardText(
String text, double fontSize, {PdfStandardFont font = PdfStandardFont.helvetica}) → double -
Measures
textin points atfontSizewithfont's base-14 metrics. -
pageStructParentsKey(
PdfPage page) → int? - Convenience: the /StructParents key declared on a page, or null. Pairs with PdfStructParentTree.elementForMcid.
-
pdfAngleDegrees(
(double, double) vertex, (double, double) a, (double, double) b) → double -
The interior angle at
vertex, in degrees, between the arms running toaandb. Returns 0 when either arm has zero length. Shared by angle measurements. -
pdfArcMetrics(
(double, double) start, (double, double) mid, (double, double) end) → ({double length, double radius, double sweep})? -
The metrics of the circular arc through three points: the circle
radius, the swept arclength, and thesweepangle in degrees. Returns null when the points are collinear (no finite circle).startandendare the arc endpoints;midis a point on the arc between them. Shared by arc measurements. -
pdfCanRestyleAnnotation(
PdfAnnotation annotation) → bool -
Whether PdfAnnotationEditing.restyleAnnotation can faithfully
regenerate
annotation's appearance - the gate UI style controls should check before offering to restyle a selection. -
pdfContentKey(
Uint8List bytes) → String - A stable content key for a PDF (or any byte payload), suitable as a cache namespace.
-
pdfDiffAnnotations(
PdfDocument before, PdfDocument after, {Iterable< int> ? pages}) → List<PdfAnnotationChange> - Diffs the annotations of two states of a document, keyed on /NM.
-
pdfFormatDate(
DateTime time) → String -
Formats
timeas a PDF date string (§7.9.4) in UTC - the form the comment editor stamps on /CreationDate and /M, round-tripping through_parsePdfDateand parsing in other readers (Acrobat). -
pdfInkCurveControls(
List< (double, double)> points) → List<((double, double), (double, double))> -
Cubic Bézier control points that smooth a captured polyline into a
Catmull-Rom spline through its points:
result[i]is the(c1, c2)pair for the segmentpoints[i] → points[i+1]. Pointer events sample a stroke once per frame, so a fast stroke leaves long straight segments with visible corners; the spline rounds them while still passing through every sample. Shared by PdfAnnotationEditing.addInk appearances and the live stroke previews so committed ink matches what was drawn. -
pdfInkStrokeWidth(
double strokeWidth, double pressure) → double -
The drawn width of an ink segment at normalized
pressure(0–1) for a basestrokeWidth: 0.4× when barely touching up to 1.6× at full pressure, the base width at 0.5. Shared by PdfAnnotationEditing.addInk appearances and live stroke previews so they look identical. -
pdfIsMarkedTagged(
PdfDocument document) → bool -
Whether
documentdeclares its content tagged (catalog /MarkInfo /Marked true, §14.7.1). A PDF/UA or fully-tagged file must set this. -
pdfLineEndings(
PdfAnnotation annotation) → (PdfLineEnding, PdfLineEnding)? -
The start/end line endings recorded on
annotation's /LE entry, or null when it is not a /Line or /PolyLine. Each defaults to PdfLineEnding.none when absent or unrecognized. Lets UI read the current endings without an editor instance (mirrors pdfCanRestyleAnnotation). -
pdfMeasurementAngle(
List< (double, double)> vertices) → double -
The interior angle, in degrees, of an angle measurement whose three
page-space
verticesare (arm-end, vertex, arm-end). Exposed for the editor's live readout. Returns 0 for fewer than three vertices. -
pdfNetPolygonArea(
List< (double, double)> boundary, Iterable<List< holes) → double(double, double)> > -
The net area of a polygon with
holescut out: the outerboundaryshoelace area minus the shoelace area of every hole. Negative results (holes larger than the boundary) clamp to zero. Used by area-cutout (net area) measurements. -
pdfPolylineLength(
List< (double, double)> points) → double -
The total length of the open polyline through
points, in the same units as the coordinates. Used by perimeter and arc measurements. -
pdfRectFrom(
CosDocument cos, CosObject? value) → PdfRect? -
Reads a COS rectangle array (
[x1 y1 x2 y2]), normalizing the corner order as required for boxes (§7.9.5). Returns null on anything malformed. -
pdfResolveStampTemplateText(
String text, Map< String, String> values) → String -
Resolves
{{field}}placeholders in stamp text fromvalues. -
pdfShoelaceArea(
List< (double, double)> points) → double -
The unsigned shoelace area of the polygon through
points, in the same squared units as the point coordinates. Shared by area measurements and PdfAnnotation.measurementText. -
pdfSliceInkStrokes(
List< List< strokes, List<(double, double)> >List< ? pressures, (double, double) from, (double, double) to, double radius) → ({List<double> ?>List< ? pressures, List<double> ?>List< strokes})?(double, double)> > -
Slices ink
strokeswith one stamp of a circular eraser swept fromfromtoto(a capsule ofradius): every part of a stroke's centerline withinradiusof that segment is removed, splitting strokes where the eraser crosses them.pressures(the PdfEditor addInk convention - one optional list per stroke) travel with their points, interpolated at the cut boundaries. Returns the surviving strokes, or null when the eraser touched nothing. Shared by PdfAnnotationEditing.sliceInk and the editing overlay's live preview so the preview matches the commit exactly. -
pdfSlopeDegrees(
(double, double) a, (double, double) b) → double -
The inclination of the segment from
atobabove the horizontal, in degrees in the range 0–90 (the absolute slope angle). Shared by slope measurements; the rise/run ratio istanof this. Returns 0 for a degenerate segment. -
pdfTextLooksRtl(
String text) → bool -
True when
text's first strong directional character is RTL. -
pdfVisualText(
String text, PdfTextDirection direction) → String - Converts one logical line to the visual order needed by simple PDF text showing operators, which always advance in stream order.
-
readJpegInfo(
Uint8List bytes) → JpegInfo - Reads dimensions from a JPEG's start-of-frame marker.
-
readPdfaConformance(
Uint8List xmp) → String? -
Reads the
pdfaid:conformancevalue (e.g. 'B') from an XMP packet, or null. -
readPdfaPart(
Uint8List xmp) → int? -
Reads the
pdfaid:partvalue from an XMP packet, or null. -
readPdfUaPart(
Uint8List xmp) → int? -
Reads the
pdfuaid:partvalue from an XMP packet's bytes, or null. Lenient substring/regex scan - XMP is RDF/XML but the identifier is unambiguous. -
validatePdfA(
PdfDocument document, {int part = 2, String level = 'B'}) → PdfConformanceReport -
Validates
documentagainst PDF/A-partb (part 1, 2, or 3; level B). -
validatePdfUa(
PdfDocument document) → PdfConformanceReport -
Validates
documentagainst PDF/UA-1.
Typedefs
-
PdfRevocationClient
= Future<
PdfRevocationMaterial> Function(List<X509Certificate> chain) -
Fetches revocation material for the certificate
chain(leaf first) so the editor can embed it in a /DSS. A typical implementation builds an OCSP request per certificate withbuildOcspRequest(POSTing to the cert'sX509Certificate.ocspResponderUrl) and/or downloads the CRL fromX509Certificate.crlDistributionUrls, returning whatever it could gather. Injected by the caller; the library performs no I/O. -
PdfTimestampClient
= Future<
Uint8List> Function(Uint8List timeStampRequest) -
Obtains an RFC 3161 timestamp token for
timeStampRequest- the DERTimeStampReqbuilt bybuildTimeStampRequest. Implementations POST the request to their TSA and return the bareTimeStampToken(the inner ContentInfo, e.g. viatimeStampTokenFromResponse). Injected by the caller so the library stays transport-free.
Exceptions / Errors
- PdfOfficeConversionException
- Thrown when an office document cannot be converted to PDF.