pdf_document 1.3.2
pdf_document: ^1.3.2 copied to clipboard
Document-level PDF semantics: page tree, annotations, AcroForm filling, digital signatures, and an incremental-save editor. Pure Dart, web-ready.
Changelog #
1.3.2 #
- Add vector stamp templates (
PdfStampTemplateandPdfStampTemplateComponent) with text, shapes, images, and saved-signature components.PdfEditor.addTemplateStampwrites them as normal stamp annotations with generated appearance streams. - Stamp annotations can carry metadata (
stampTypeandstampTags) and resolve dynamic{{field}}placeholders at placement time. - Note and stamp appearances now account for page rotation when authored, so oriented pages receive counter-rotated annotation appearances.
1.3.1 #
- Annotation editing now handles malformed or indirect page
/Annotsentries consistently when adding, removing, reordering, flattening, signing, form editing, redacting, and pasting annotations. Invalid indirect/Annotsvalues are left untouched and replaced by a valid page-owned array. - Content rewriting, redaction, and structure-tagging paths now share the COS content-stream serializer, including inline-image round-tripping.
1.2.3 #
- Free-text annotations carry a horizontal alignment (left/center/right)
through the
/Qquadding:addFreeTextandaddFreeTextRichtake analignargument,PdfFreeTextStyle.alignmentreads it back, and resizing or re-editing a box preserves it. Omittingalignkeeps the previous behaviour — left for LTR text, right for RTL. - Fix a free-text box auto-sized to its contents wrapping the last word onto
a new line: the wrapper's strict width test now tolerates the sub-point
floating-point round-off in
(lineWidth + 2*pad) - 2*pad.
1.2.2 #
- Embeddable fonts:
PdfEmbeddedFont.parsereads a TrueType (.ttf) or OpenType (.otf) file andaddFreeTextcan now author text in it, embedding the font as a full-Unicode Type0/CIDFontType2 (Identity-H) composite with a/ToUnicodeCMap — so authored text can use any font, not just the base-14 faces, and stays selectable, searchable, and portable.PdfEmbeddedFont.fromFreeTextrecovers the font from a box's own appearance for lossless re-editing. - Fix non-Latin characters rendering as
??in free-text annotation appearances. - Fix free-text annotation appearances rendering sideways on rotated pages.
- Right-to-left text direction support in free-text annotations and AcroForm field appearances.
- Faster batch annotation deletion.
1.2.1 #
- Add a package example for pub.dev scoring.
1.2.0 #
- OCR text-layer injection is now used by the standalone app's downloadable on-device OCR flow.
- Version bump to keep the dart-pdf package suite aligned at 1.2.0.
1.1.0 #
- Page rotation:
PdfEditor.rotatePages(indices, degrees)turns the named pages clockwise by a multiple of 90° (negative for counterclockwise), accumulating onto each page's current/Rotate. - Vector snapshots:
PdfEditor.captureVectorSnapshotcaptures a page region as detached vector graphics (PdfVectorSnapshot) andpasteVectorSnapshotre-materializes it onto any page as a /Stamp annotation whose appearance draws the captured content, so a snapshot pasted back into the PDF stays vector (crisp at any zoom), Bluebeam-style. - Count tool:
PdfEditor.addCheckMarkplaces a Bluebeam-style check-mark stamp annotation (withPdfAnnotation.isCheckMark/iconName). It is the building block for a running on-page tally. - Fix: JPEG 2000 tile-part desynchronization, and indexed Lab color palettes now decode correctly.
1.0.0 #
First stable release. Changes since 0.1.0:
- Line/PolyLine/Polygon annotations: reading and authoring with the full PDF Table 176 line-ending vocabulary, plus reshaping.
- Measurement annotations (§12.9):
PdfMeasure/PdfNumberFormat, scale calibration (setMeasurementScale), andaddMeasurementfor distance/perimeter/area with a/Measuredictionary and a baked-in formatted caption. - True redaction: mark
/Redactregions and burn the underlying content irreversibly. - Image stamps:
PdfEditor.addImageStampplaces a PNG/JPEG as a stamp annotation; dashed (/D) stroke patterns for all shape subtypes; and annotation flip when a resize handle is dragged past the zero point. - Form widgets:
resizeFormWidgetrewrites a field's/Rectand regenerates its appearance at the new size. - Page assembly:
PdfEditor.insertBlankPageadds a new empty page at any position (sized to request, default US Letter), andPdfDocument.extractPageRangeexports a contiguous span of pages as a standalone PDF alongside the existingappendPagesFrom(insert pages from another document) andextractPages(arbitrary subset). - OCR text-layer injection:
PdfEditor.injectTextLayerwrites recognizedPdfOcrSpans onto a page as invisible (render mode 3) text, sized and horizontally scaled to sit over each word. A scanned, image-only page becomes selectable, searchable, and extractable without changing how it looks.applyOcr(with a pluggable engine) lives indart_pdf_editor. PdfImageDocument: assemble a brand-new PDF from a list of PNG/JPEG images, one page per image. This is the pure-Dart half of image/Office ingestion (multi-page TIFF, scans, camera shots).PdfImportSource: a host-provided seam for converting foreign formats (DOCX/XLSX/PPTX, …) to PDF bytes. Interface only; dart-pdf does not implement OOXML→PDF layout.
0.1.0 #
Initial release.
PdfDocument: page tree with inherited attributes, metadata, outlines, text-page lookup.PdfEditor: incremental-save editing. Annotation authoring (highlight, ink with pressure, shapes, free text, notes, stamps), flattening, page manipulation (reorder, remove, append across documents, extract), content stamping/deletion/text replacement.- Annotations: appearance generation, resize/rotate/restyle, slicing eraser, clipboard snapshots, /NM-keyed diff + replay for sync.
- Measurements (§12.9):
PdfMeasure/PdfNumberFormat(parse/emit/format), scale calibration (setMeasurementScale), andaddMeasurementfor distance/perimeter/area annotations with a /Measure dictionary, a formatted /Contents, and a caption baked into the appearance (PdfAnnotation.measure/measurementText). - AcroForm: field model, filling with regenerated appearances, field administration (add/rename/remove/retype/flatten), button images.
- Digital signatures:
PdfSignature.validate()with optional trust-store chain validation, and signing viasaveSigned. - Image embedding: JPEG passthrough and full baseline PNG (all bit depths/color types, tRNS, Adam7) with alpha soft masks.