PackageTrack
Sign in Get early access

pdf_cos

COS object layer for PDF: tokenizer, parser, filters (incl. CCITT, JBIG2, JPEG 2000), xref machinery, encryption, and serializer. Pure Dart, web-ready.

3.8.0 8.7K downloads/mo #3104 most downloaded on pub.dev ben-milanko/dart-pdf

What this package is like to depend on

Last release today

22 Aug 2026

Ships on a steady schedule

a new release about every 9 days

Nearly every release is documented

notes for 31 of 32 stable releases

Nothing withdrawn

no release was ever pulled

2 months old

32 releases · first in 2026

32 releases in the last 12 months

see the full history below

Release timeline

32 releases · Jun 2026 to Aug 2026
Release Pre-release

Releases

latest 32
  1. 3.8.0 22 Aug 2026
    Release notes
    • Add the public monotonic CosDocument.revision, incremented after every successful incremental update so higher layers can invalidate derived caches without comparing object identity.
    Open source →
  2. 3.7.0 19 Aug 2026
    Release notes
    • Lockstep minor release to align the dart-pdf package suite at 3.7.0. No public pdf_cos API changes since 3.6.0.
    Open source →
  3. 3.6.0 15 Aug 2026
    Release notes
    • Lockstep minor release to align the dart-pdf package suite at 3.6.0. No public pdf_cos API changes since 3.5.1.
    Open source →
  4. 3.5.1 14 Aug 2026
    Release notes
    • Decode JBIG2 refined text symbols, including refinement deltas, offsets, and shared arithmetic contexts, so scanned MRC text layers render correctly.
    Open source →
  5. 3.5.0 13 Aug 2026
    Release notes
    • Add PdfSourceLoadOptions.completeFirstPaintPageTree. Progressive preview callers can stop the initial page-tree walk after firstPaintPages, avoiding one range request per leaf before page one can paint; the default remains the correctness-first complete walk for existing callers.
    • Reduce allocation and cache pressure in byte sources, the lexer, and content parsing while retaining the parser's lenient handling of malformed PDFs.
    Open source →
  6. 3.4.0 09 Aug 2026
    Release notes
    • Lockstep minor release to align the dart-pdf package suite at 3.4.0. No public pdf_cos API changes since 3.3.1.
    Open source →
  7. 3.3.1 02 Aug 2026
    Release notes
    • Lockstep patch release to align the dart-pdf package suite at 3.3.1. No public pdf_cos API changes since 3.3.0.
    Open source →
  8. 3.3.0 02 Aug 2026
    Release notes
    • Lockstep minor release to align the dart-pdf package suite at 3.3.0. No public pdf_cos API changes since 3.2.0.
    Open source →
  9. 3.2.0 29 Jul 2026
    Release notes
    • Lockstep minor release to align the dart-pdf package suite at 3.2.0. No public pdf_cos API changes since 3.1.1.
    Open source →
  10. 3.1.1 26 Jul 2026
    Release notes
    • Lockstep patch release to align the dart-pdf package suite at 3.1.1. No public pdf_cos API changes since 3.1.0.
    Open source →
  11. 3.1.0 26 Jul 2026
    Release notes
    • Lossless structural compaction: new CosCompactor/CosCompactionResult rewrite a document's reachable object graph, packing non-stream objects into compressed object streams behind a PDF 1.5 xref stream and re-deflating streams stored uncompressed (kept only when smaller). CosDocumentBuilder gains an objectStreams: mode (W [1 4 2]). The user-facing entry point is PdfEditor.compress() in pdf_document (#368).
    • JPX (JPEG 2000) resolution-level skip: decode at a reduced cp_reduce level when an image is displayed far below its native size, instead of decoding full resolution and downscaling (#525).
    • Cache decoded JBIG2 globals dictionaries across images on the same page - scanned books with shared /JBIG2Globals decode once, not per image (#532).
    • Int-key the loaded-object cache so warm resolves allocate nothing (#522), and drop the double copy of every inflated stream (#533).
    Open source →
  12. 3.0.0 23 Jul 2026
    Release notes

    Lockstep major release: a breaking change in dart_pdf_editor moves the whole suite to 3.0.0. pdf_cos's own public API is unchanged.

    • Cache decoded stream bytes on CosDocument so a stream inflated once (xref reconstruction, content parsing, image extraction) is not re-decoded on the next access (#392).
    • Perf micro-batch: chunked message-digest hashing, an in-place JPX inverse DWT, and predictor/lexer/regex fast-path fixes (#407).
    Open source →
  13. 2.1.0 21 Jul 2026
    Release notes
    • Append incremental saves to the existing bytes instead of rebuilding the whole file: CosUpdater.saveTail() returns only the new tail (the appended objects, xref, and trailer), so an incremental revision costs the size of the change rather than the size of the document. Save cost no longer scales with the base file - a guard test pins that a 2.78x larger base does not make a same-sized edit 2.78x more expensive (#413).

    • Memoise the per-object decryption key so a page's streams and strings derive it once per object rather than once per access, cutting repeated MD5/AES key derivation on encrypted documents (#400).

    • Speed up CCITT G3/G4 decoding by ~4x on dense scanned pages: a monotonic cursor for the 2-D reference-row scan (was O(transitions^2) per row), peek-once prefix tables for run and mode codes, byte-run span fills, and a byte-at-a-time bit reader. The JBIG2 MMR path, which reuses the same decoder, gains a byte-at-a-time bitmap unpack. Output is byte-identical on well-formed, malformed, and truncated input, locked by golden digests captured from the previous implementation (#398).

    Open source →
  14. 2.0.0 19 Jul 2026
    Release notes
    • Major version bump for the 2.0.0 package suite. A breaking API change in dart_pdf_editor moves every package to 2.0.0 in lockstep; the COS object model, syntax, and (de)serialization API is source-compatible with 1.4.7.
    • Add an asynchronous byte-source API (PdfByteSource) for progressive PDF loading: the reader pulls ranged slices on demand instead of requiring the whole file up front, so remote and large local files can paint their first page before the full download or read completes (#328, #359).
    • Decode PDF text strings as PDFDocEncoding rather than Latin-1, so document metadata and outline titles that use PDFDocEncoding-specific code points round-trip correctly (#347).
    • Add the crypto primitives behind one-tap and keyless signing identities: P-256 EcPrivateKey.generate, deterministic RFC 6979 ecdsaSign, the X.509 v3 builders buildSelfSignedCertificate / buildCaCertificate / issueCertificate, and ecSubjectPublicKeyInfo / pemEncode for Sigstore/Fulcio (#322, #337, #355).
    • Internal refactors with no public API change: extract CosXrefReader from CosDocument, move the encryption object-graph walk behind the security handler, share file-tail framing between the builder and updater, and dedupe ObjStm header parsing between recovery and the stream decoder.
    Open source →
  15. 1.4.7 16 Jul 2026
    Release notes
    • Version bump to keep the dart-pdf package suite aligned at 1.4.7. No COS API changes since 1.4.6.
    Open source →
  16. 1.4.6 15 Jul 2026
    Release notes
    • Version bump to keep the dart-pdf package suite aligned at 1.4.6. No COS API changes since 1.4.5.
    Open source →
  17. 1.4.5 14 Jul 2026
    Release notes
    • Version bump to keep the dart-pdf package suite aligned at 1.4.5. No COS API changes since 1.4.4.
    Open source →
  18. 1.4.4 13 Jul 2026
    Release notes
    • Version bump to keep the dart-pdf package suite aligned at 1.4.4. No COS API changes since 1.4.3.
    Open source →
  19. 1.4.3 13 Jul 2026
    Release notes
    • Version bump to keep the dart-pdf package suite aligned at 1.4.3. No COS API changes since 1.4.2.
    Open source →
  20. 1.4.2 12 Jul 2026
    Release notes
    • Version bump to keep the dart-pdf package suite aligned at 1.4.2. No COS API changes since 1.4.1.
    Open source →
  21. 1.4.1 12 Jul 2026
    Release notes
    • Speed up dense content parsing with byte-level real-number parsing, operator interning, and streaming content-token handling.
    • Keep the low-level parser and writer compatible with the rendering and editing improvements in the 1.4.1 package suite.
    Open source →
  22. 1.4.0 07 Jul 2026
    Release notes
    • Version bump to keep the dart-pdf package suite aligned at 1.4.0. Low-level parser, writer, filter, and crypto maintenance supports the higher-level editor and document features in this release.
    Open source →
  23. 1.3.2 05 Jul 2026
    Release notes
    • Version bump to keep the dart-pdf package suite aligned at 1.3.2. No COS API changes since 1.3.1.
    Open source →
  24. 1.3.1 02 Jul 2026
    Release notes
    • Add ContentStreamSerializer for writing parsed content-stream operations back to PDF syntax, including inline-image (BI/ID/EI) operations.
    Open source →
  25. 1.3.0 27 Jun 2026

    Nothing published for this version

  26. 1.2.3 20 Jun 2026
    Release notes
    • Version bump to keep the dart-pdf package suite aligned at 1.2.3. No COS API changes since 1.2.2.
    Open source →
  27. 1.2.2 17 Jun 2026
    Release notes
    • Version bump to keep the dart-pdf package suite aligned at 1.2.2. No COS API changes since 1.2.1.
    Open source →
  28. 1.2.1 15 Jun 2026
    Release notes
    • Add a package example for pub.dev scoring.
    Open source →
  29. 1.2.0 15 Jun 2026
    Release notes
    • Version bump to keep the dart-pdf package suite aligned at 1.2.0. No low-level COS API changes since 1.1.0.
    Open source →
  30. 1.1.0 14 Jun 2026
    Release notes
    • Performance: a faster content-stream tokenizer. This is the heart of the render-speed work that puts dart-pdf ahead of PDFium on the benchmark corpus.
    • Fix: JPEG 2000 tile-part desynchronization, and indexed Lab color palettes now decode correctly.
    Open source →
  31. 1.0.0 13 Jun 2026
    Release notes

    First stable release. Changes since 0.1.0:

    • JBIG2: Huffman-coded symbol dictionaries and text regions, generic refinement regions, and pattern dictionaries with halftone regions.
    • JPEG 2000: reset-probabilities (RESET) code-block style support.
    • Inline images: correct data-length detection for DCT-filtered streams.
    Open source →
  32. 0.1.0 12 Jun 2026
    Release notes

    Initial release.

    • COS object model: dictionaries, arrays, names, strings, streams, references.
    • Lenient tokenizer/parser for real-world PDFs (broken /Length, missing endobj, junk before the header, broken xref chains with object-scan recovery).
    • Cross-reference tables and streams; lazy object loading; incremental updates.
    • Filters: Flate, LZW, RunLength, ASCIIHex, ASCII85, DCT passthrough, CCITT G3/G4, JBIG2 (embedded profile), JPEG 2000.
    • Encryption: RC4, AES-128, AES-256 decryption and encrypt-on-write.
    • Crypto primitives for signing/validation: ASN.1, RSA, ECDSA, CMS, X.509 chain verification.
    • Content-stream tokenizer and a from-scratch document builder.
    Open source →

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive