pdf_document 5.1.1
pdf_document: ^5.1.1 copied to clipboard
Document-level PDF semantics: page tree, annotations, AcroForm filling, digital signatures, and an incremental-save editor. Pure Dart, web-ready.
Changelog #
5.1.1 #
- Version bump to track the 5.1.1 suite.
5.1.0 #
- Stop page edits dropping pages from a page tree whose intermediate /Count
is too small. The /Count-trusting lookup repeated some leaves and skipped
others, and
removePage,movePage,insertBlankPageandappendPagesFromrebuilt the tree from that list on a cold page cache. They now take the true leaf order. - Make whole-document page loops linear on flat page trees. Page operations,
form reads, attachment listing, takeoff summaries, annotation naming and the
compressor walk
PdfDocument.pagesonce instead of callingpage(i)for every index, and apage(i)lookup caches the leaf siblings after the page it finds, so a forward loop resolves each page about once. On a 3,000-page file after an annotation edit,movePagegoes from 720 to 2.4 ms and a form fill from 718 to 0.8 ms. - Memoise signature validation within a revision, and let a caller reuse the
expensive part across revisions.
validateandvalidateOnlinetakecores:(aPdfSignatureCoreResolver) that supplies aPdfSignatureCryptoCore- digest, CMS/PKCS#1/RFC 3161 verification, certificates, signing time - for the signature and every document timestamp;PdfSignature.cryptoCore()computes one andhasSignableByteRangesays whether one can exist. A PAdES document timestamp reuses its own row's validation instead of hashing again. Theproblemsandcertificateslists of a validation are now unmodifiable, since results are shared. With pdf_cos's P-521 fix, P-521 signatures validate. - Add
PdfDocument.rollbackTo(length), wrappingCosDocument.rollbackToand dropping the page-tree caches. PdfDocument.openAppendedaccepts an earlier revision's prefix and takes apasswordfor a revision whose /Encrypt differs.PdfAcroForm.oftakes anonFieldshook, called once with the field list the first time anything reads it.- Add
pdfFallbackDocumentId, the SHA-256 identitypdfPermanentDocumentIdfalls back to for a file without a trailer /ID, so callers can take the free /ID first and hash only when they need to. - Decode PNG images through pdf_cos's tolerant
inflateZlib, so trailing bytes after the zlib stream no longer empty them on the web.
5.0.0 #
Breaking changes #
PdfFormFilling.setTextValuenow truncates the value to the field's /MaxLen (by code point), then re-runs the form's recognised AF* calculate scripts in /CO order, rewriting the /V of calculated fields - read-only totals included. Appearances apply recognised AF* formats, draw password fields as asterisks and lay comb fields out one character per cell; /V itself stays the raw value. Callers that compared a field's appearance text to the value they set, or relied on calculated fields keeping a stale /V, will see different results.- Every fill setter (and
flattenForm) now removes/AcroForm /XFAand the catalog's/NeedsRenderingthrough the newPdfEditor.removeXfa, so an XFA-aware viewer reads the AcroForm values rather than stale XFA data. A hybrid form's XFA packet no longer survives a fill. - List-box appearances now draw every option row, with the selected rows highlighted, instead of only the chosen value - single-select list boxes too. Pixel baselines of filled list boxes change.
PdfSignature.validate()setschainTrustedto false when revocation data embedded in the document's /DSS says a certificate in the chain is revoked, even without a trust store (unless a verified timestamp predates the revocation).embeddedRevocationnow requires the issuer to have verified the signer and an OCSP response to match the full CertID, so some documents that used to report embedded revocation data no longer do.PdfTrustStore.addCertificateandaddDergained an optional named{String? source}parameter. Subclasses that override them must add it.
Changes #
-
Run the built-in Acrobat AF* helpers that most real forms use, without a JavaScript engine (#930):
AFSimple_Calculateand simplified field notation (re-run in /CO order after every fill, or on demand withPdfEditor.recalculateFields),AFNumber/AFPercent/AFDate/AFTime/AFSpecialformat and keystroke, andAFRange_Validate. The newPdfEditor.enterTextValueis the user-entry path: it normalises a value (1.234,50in a comma-decimal field stores1234.50) or throwsPdfFieldInputExceptionwith the helper's message.setTextValuestays the unchecked programmatic setter. Arbitrary scripts never run; they are reported, with a reason, onPdfFormField.scripts. -
Honour comb fields, /MaxLen and password masking (#931).
PdfFormField.maxLengthreads the inheritable /MaxLen andisCombthe comb flag (with the newfileSelectFlag/combFlagconstants).PdfFormFilling.setPasswordValuekeeps a password out of the file (ISO 32000 12.7.4.3): it removes /V, draws a fixed-length mask so the file does not reveal the length, and writes a trailer /ID when the file has none.pdfPermanentDocumentId/pdfTrailerPermanentIdreturn the identity such a value is filed under. -
Detect XFA forms (#929):
PdfAcroForm.hasXfa,xfaNeedsRenderingandisDynamicXfa. -
Sign encrypted (password-protected) PDFs (#935). Every signing path used to refuse them; the signature's /Contents is now written unencrypted and patched after the rest of the revision is encrypted, and
validate()reads the raw CMS, which also fixes validating encrypted files signed by other tools. PAdES B-LT/B-LTA andaddDocumentTimestampreopen their intermediate revisions with the newPdfDocument.openAppended, which reuses the authenticated keys instead of the password. pyHanko validates the encrypted B-LTA output for RC4-40/128, AES-128 and AES-256. -
Add form tab order (#932):
PdfFormTabOrder,PdfTabOrderandPdfPage.tabOrderfollow each page's /Tabs (row, column or structure order), fall back to /Annots order, and skip read-only, hidden, push-button and signature fields. -
fetchAatldownloads Adobe's Approved Trust List through a host transport, verifies it chains to Adobe Root CA G2 and was signed within a year (PdfAatl.maxAge), and returns a PEM-serializable snapshot.PdfTrustStore.sourceOfnames the list an anchor came from. -
Check signer-chain revocation.
validate()now reports a verdict for the signer and each intermediate from the document's /DSS (PdfSignatureValidation.revocation,revocationStatus), and the newvalidateOnline(revocationClient:)adds live OCSP-then-CRL checks through the injectedPdfRevocationClient. A revoked certificate makes the chain untrusted unless a verified timestamp predates the revocation.pdfOnlineRevocationClientturns a host HTTP function into a client. -
Add
package:pdf_document/trust_lists.dart, opt-in trust anchors with no bundled data: fetch and XML-signature-verify the EU trusted lists (fetchEuTrustedLists,PdfTrustLists.eutl), or load an Adobe Approved Trust List file you supply (parseAatlSecuritySettings).tool/refresh_trust_lists.dartwrites verified PEM snapshots. -
Fill multi-select list boxes (#933).
PdfFormFieldgainsisMultiSelect(/Ff bit 22),values(a /V string or array as a list;valuestill returns the first entry),selectedIndices(/I, falling back to /V when /I is missing or stale) andtopIndex(/TI).PdfEditor.setChoiceValueswrites /V as an array of export values in option order (a plain string for exactly one, removed for none), /I as sorted indices, and scrolls /TI to the first selection. List-box appearances now draw every option row with the selected rows highlighted, for single-select list boxes too, instead of showing only the chosen value. -
Author every AcroForm field type, not only text, check box and push button (#934).
PdfFormAdmingainsaddRadioGroup(one parent field, a kid widget per on-state with generated /AP /N and /D states) andaddRadioButtonto grow a group later,addComboBoxField/addListBoxField(/Opt as export/display pairs, Edit and MultiSelect flags) plussetChoiceOptions, andaddSignatureField- an unsigned /FT /Sig widget (with /SigFlags 1) thatsaveSigned(fieldName:)and the PAdES/self-signed paths fill later.changeFieldTypenow converts to all of them, carrying options between choice kinds and on-states into radio groups and choice options; it refuses to retype a signed signature. Authored choice fields are drawn by the same renderer filling uses, so a new list box shows every option row (selection highlighted) and a combo box its value.PdfFormFieldgains thenoToggleToOffFlagconstant. -
Stop the visible signature box clipping its detail lines. On a short, wide "sign on this line" placement the top of the first line and the bottom of the last were sliced off: the box's flat 4pt inner margin took over 40% of a ~20pt-tall box, the auto-fit loop gave up at a hard 4pt floor while the text block was still taller than the room left, and centring that overflow ran it past the clip at both ends at once. The margin is now proportional on small boxes (never more than a tenth of the shorter side), the loop shrinks to 2pt before giving up, and a block that still overflows is top-anchored so the clip can only take the tail. A signature graphic also gets the reclaimed room, so it no longer floats small in a short box.
4.5.0 #
- Measure and declare the whole WinAnsi range (codes 32-255) for base-14
fonts.
PdfStandardFontwidths stopped at code 126 and every emitter wrote/LastChar 126, so accented text in signature boxes, free-text appearances and the OCR text layer laid out with the wrong advances or stacked. - Refuse to sign a document certified with
/DocMDP /P 1(no changes permitted):saveSigned,saveSignedEcdsa,saveSignedExternaland the PAdES paths throwCertifiedNoChangesExceptioninstead of producing a file every viewer reports as tampered with./P 2and/P 3and document timestamps are unaffected.
4.4.0 #
- Add persistent vertical alignment for text form fields.
PdfFormFieldcarries the alignment,form_editorregenerates appearances with it, and it survives a round trip through the document.
4.3.0 #
- Add
PdfVectorSnapshot.toPdfBytesandfromPdfBytesfor detached, single-page PDF interchange with embedded resources and baked page rotation. - Add rectangular and polygonal page-content deletion with glyph-level text slicing. Preserve font encodings, kerning, spacing, surviving glyph positions, and path clipping state; concave lassos can erase disjoint text spans. Clip crossing vectors, images, and Form XObjects at the erase boundary, retaining their outside portions and vector curves, strokes, and dashes.
- Add
PdfCompressor.optimizeand expandPdfEditor.compresswith independent lossless cleanup, resource deduplication, TrueType/CFF font subsetting, and opt-in DPI/JPEG image optimisation. Include presets and exact per-pass size reports; preserve unsupported content and never return a larger file. - Refuse incomplete/encrypted sources and require explicit signature invalidation when optimising a signed copy.
- Add
PdfMerger.mergefor bytes-only merging with per-input passwords. - Preserve imported AcroForm fields, default font resources, named destinations, and outline hierarchies; rename collisions and remap internal page targets.
- Add
PdfSplitter.split,splitRange, andsplitExpressionfor bytes-only PDF splitting, with validatedPdfPageRangebatches and one-based range parsing.PdfDocument.extractPageRangesreuses an already-open document. - Document splitting examples and the extraction semantics.
- Accept
populatedRangesinPdfDocument.openso copied progressive buffers keep treating unfetched objects as missing.
4.2.0 #
- Add
PdfAnnotation.appearanceRotation, the rotation an annotation's normal appearance carries in page space. This is the annotation's own rotation, so unlike a view-space measurement it is unaffected by the page's display/Rotate. - Align dependency constraints with the dart-pdf 4.2.0 package suite.
4.1.0 #
- Add document-level content movement between positions and pages, retaining resource references and clipping the moved content to its destination page.
- Preserve reusable annotation snapshots and digital-signature removal through incremental edits.
- Align dependency constraints with the dart-pdf 4.1.0 package suite and
update
archiveto 4.2.0.
4.0.0 #
- Allow
flattenAnnotationsto target a supplied annotation selection and expose embedded-font descent metrics for accurate free-text box fitting. - Flatten empty text, choice, and button widgets without dropping their annotation appearance or blocking the rest of a form.
- Lockstep major release for the dart-pdf 4.0.0 package suite. The
pdf_documentpublic API changes in this release are additive.
3.8.0 #
- Add the lazily materialized
PdfDocument.pagesview and keep document caches coherent throughCosDocument.revision. - Add
PdfEditImpact.pageOrderOnlyand reconcile page-order-only incremental edits without rebuilding unchanged page objects. - Reduce repeated page-tree and annotation work during large-document startup, structural edits, undo, and redo.
3.7.0 #
- Add
SimpleFont, the simple-font counterpart toType0Font: one place that resolves a character code to text the way the renderer does (/ToUnicode,/Encoding/Differences, the built-in Symbol and ZapfDingbats encodings, then the base encoding), plus the reverse table for re-encoding replacements and the/Widthslookup. - Fix content editing against fonts that remap their codes.
PdfPageElementsdecoded a simple font's show string as Latin-1, so a subsetted font reported text such as-=>-/>?-?@for a page reading05/08/2026, and replacements were written back as raw code units. Element text, both run codecs, the'and"operators, and paragraph reflow now all go through the font's own encoding. - Restrict a replacement to codes the font actually declares - a glyph name
from the base encoding or
/Differences, or a/ToUnicodeentry - so a subset that dropped a character declines the edit instead of drawing notdef. Decoding keeps its lenient Latin-1 fallback. A named base encoding declares printable ASCII (0x20-0x7E) per Annex D. - Move the Adobe glyph-name tables down from
pdf_graphicstosrc/fonts/encodings.dartand export them, so the content editor and the font engine share one copy.
3.6.0 #
- Read Bluebeam FreeText paragraph styling from
/DSand rich-text/RCwhen standard PDF entries are absent, preserving alignment, leading, character spacing, horizontal scale, and underline when editing or regenerating an appearance. - Let FreeText annotations participate in opacity restyling, write opacity on creation, and rebuild their appearances without losing the selected alpha.
3.5.1 #
- Lockstep patch release for the scanned-page rendering fixes in
pdf_cos,pdf_graphics, anddart_pdf_editor. No public document API changes.
3.5.0 #
- Let
PdfDocument.openSourceexpose its requested first-paint page count as a temporary page-count hint when the source deliberately omits the rest of the page-tree walk. The full document opened during progressive handoff remains authoritative, while sparse page-one previews avoid recovery-scanning every intentionally absent leaf reference.
3.4.0 #
- Preserve the unresolved vector template on authored stamp annotations and
expose it through
PdfAnnotation.stampTemplate, allowing a placed stamp to return to a reusable collection without losing dynamic fields (#651).
3.3.1 #
- Fix annotation property edits duplicating the annotation when a page stores
its
/Annotsarray indirectly (#638). - Preserve embedded font resources when changing FreeText colour, so restyled text continues to use the original embedded typeface (#641).
3.3.0 #
- Add lightweight diagnostics to
PdfDiskCachefor hits, misses, writes, oversize rejections, evictions, and byte totals, withresetStats()and a one-linedebugStatssummary. Manifest writes are coalesced across bursts so persistent page-raster caches do not rewrite an O(n) manifest for every entry (#615).
3.2.0 #
- Improve FreeText callout interoperability: recognize third-party callouts
from their
/CLgeometry when/ITis missing or private, and clamp malformed or negative/RDinsets to a usable callout text box (#621).
3.1.1 #
- Lockstep patch release to align the dart-pdf package suite at 3.1.1. No
public
pdf_documentAPI changes since 3.1.0.
3.1.0 #
- Add
PdfEditor.compress()/PdfCompressionResult: lossless file-size compaction on save. A whole-graph reachability pass drops the dead objects incremental edits accumulate, non-stream objects pack into object streams, and uncompressed streams are re-deflated (kept only when smaller). Never returns a larger file, includes pending edits, and refuses encrypted documents. Decoded stream content is preserved bit-for-bit (#368). - Hyperlink authoring:
addLinkToUri/addLinkToDestination/addLinkToPage, mirroring the text-markup creators' quad shape so a text selection turns into a link. /Rect bounds the quads, each quad becomes an active /QuadPoints region, /Border is suppressed by default, and an underline or border decoration bakes an /AP (#500). - Crop placed images: the image-stamp appearance bakes a normalized crop
rect, read back via
PdfAnnotation.imageStampCrop; opacity restyles and resizes preserve the crop (#504). - Render digital-signature boxes in the signer's local timezone (#570).
- Add
PdfAnnotation.isPrint(§12.5.3 print-vs-screen visibility) (#546).
3.0.0 #
Lockstep major release (a breaking change in dart_pdf_editor moves the whole
suite to 3.0.0). pdf_document's own public API is additive.
- Add
PdfEditor.saveSignedExternal: delegates the RSA operation to aPdfExternalSignercallback so the private key can stay in a hardware keystore (Android KeyStore, iOS Keychain).PdfSignatureAppearancegains overridablesignedByLabel/dateLabel/reasonLabel/locationLabel, and the visible/Mand signature-box date now preserve a non-UTCsigningTime's offset (UTC input unchanged) (#507). - Fix signature appearance detail text being clipped at the top of the signature box (#468).
2.1.0 #
- Cache
PdfPageinstances instead of rebuilding them per access, resolving inherited attributes live: a page holds only ancestor-derived values and reads its own/Rotate,/MediaBox,/CropBox, and/Resourcesfrom the dictionary, so the cache cannot serve a stale value after an edit (#418). - Resolve
pageIndexOfin O(1) through an identity map rather than walking the page tree (#397). - Resolve a form widget to its page in O(1), cache the widget list, and hoist
the
/Widthslookup out of the per-glyph loop (#406). - Reuse the caller's element snapshot on a targeted edit instead of re-enumerating the page's elements (#402).
- Support the incremental append save path (
CosUpdater.saveTail()), so an incremental revision costs the size of the change (#413).
2.0.0 #
- Major version bump for the 2.0.0 package suite (breaking change in
dart_pdf_editor; the document API is source-compatible with 1.4.7). - Open documents from an asynchronous
PdfByteSourceso a remote or large local PDF can be rendered progressively as bytes arrive, rather than after the whole file is in memory (#328). - One-tap self-signed signing identities:
PdfSigningIdentity.generate(P-256 keygen + X.509 v3 self-signed cert) withtoPem/fromPempersistence,PdfEditor.saveSelfSigned/saveSignedEcdsa/saveSelfSignedPades(ECDSA CMS), a default TSA (PdfDefaultTimestampAuthority) for trusted B-T time, and org-CA mode (PdfSigningIdentity.generateCa+ca.issue(...)) so members chain to a shared CA (#337). - Sigstore/Fulcio keyless signing (Tier 3):
fulcioSigningIdentitymints an ephemeral P-256 key, proves possession, requests a short-lived certificate from a Fulcio v2 authority (transport injected like the TSA), and wraps the chain in aPdfSigningIdentityto sign B-T (#322, #355). - Internal refactors with no public API change: consolidate the composite-font
path into one
Type0Fontmodule and one sharedTextRunRewriter, and route text-box appearance generation through a single shared builder.
1.4.7 #
- Add a visible signature box for
saveSigned/saveSignedPades:PdfSignatureAppearancedescribes the widget's page/rect, optional handwritten-signature or logo graphic, detail-line show flags, and background/border/text colours, rendered into the /AP /N form (name or graphic on the left, "Digitally signed by / Date / Reason / Location" auto-sized on the right). Output is byte-identical when no box is requested; document timestamps never get an appearance (#298). - Round the corners of /Square annotations:
ContentWriter.roundedRectbakes the radius into the /AP, persisted in /Border (§12.5.4) so it survives resize;restyleAnnotation(cornerRadius:)rounds or re-squares a placed rectangle in place (#297). - Separate cloud/dash pattern scale from stroke width: the multiplier
persists on /BE /I (
PdfAnnotation.cloudBorderScale) andrestyleAnnotation(cloudScale:)reproduces it across restyle and reshape; a cloud's /Rect is re-derived from the padded footprint so growing scallops no longer clip (#300). - Recolour captured vector snapshots:
PdfVectorSnapshotEditinggainsisVectorSnapshotStampandrecolorVectorSnapshot, which forces every fill/stroke colour operator in the captured Form XObject to a target ink (recursing into nested forms, forking a private /Cap copy so other pastes keep their colours) while leaving geometry and images untouched; paste marks the stamp (DartPdfVectorSnapshot) (#301). - Curl revision-cloud scallops inward with a trailing-foot lean for the hand-drawn look, keeping the outward apex extent (and BBox) unchanged (#295).
- Fill cloudy /Polygon annotations along the scalloped cloud path (fill+stroke in one pass) so the interior colour reaches the cloud edges (#287).
- Free-text appearances support line spacing, character spacing (Tc),
horizontal glyph scaling (Tz), and underline (per box and per rich run),
round-tripping through the annotation dictionary and
/RC. - Regenerate embedded-font and rich free-text boxes on resize (re-wrapping in the recovered face and preserving per-run styling) instead of falling back to the appearance stretch.
1.4.6 #
- Add operation-scoped page-content text replacement and expose the active font resource on text element snapshots for selection-driven editing.
1.4.5 #
- Version bump to keep the dart-pdf package suite aligned at 1.4.5. No document API changes since 1.4.4.
1.4.4 #
- Version bump to keep the dart-pdf package suite aligned at 1.4.4. No document API changes since 1.4.3.
1.4.3 #
- Add
PdfBlankDocument.createfor building standalone PDFs with one or more empty pages in a chosen standard or custom page size. - Keep AcroForm text, button, and image appearances upright when fields are authored, filled, resized, or regenerated on rotated pages.
1.4.2 #
- Version bump to keep the dart-pdf package suite aligned at 1.4.2. No document API changes since 1.4.1.
1.4.1 #
- Add callout annotation authoring and editing, and correct cloudy polygon geometry and appearance generation.
- Add rich-text styling for in-place content text edits while preserving the surrounding PDF content structure.
- Centralize annotation capability policy and mutation impact tracking so editing operations invalidate only the document surfaces they change.
- Improve annotation, form, outline, page, redaction, reflow, and content editing robustness through the shared transaction path.
1.4.0 #
- Add document color-processing APIs that discover paint colors, replace multiple source colors in one pass, support page ranges, tolerance, and transparent replacements.
- Add cloudy polygon annotation appearance generation and resizing support for cloud-style shape markups.
- Improve annotation/page editing support used by the editor UI, including page-range extraction and more robust annotation duplication workflows.
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.