pdf_cos 0.1.0 copy "pdf_cos: ^0.1.0" to clipboard
pdf_cos: ^0.1.0 copied to clipboard

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

pdf_cos #

The COS (Carousel Object System) layer of the dart-pdf suite: everything a PDF file is made of, before any notion of pages or rendering.

Pure Dart with no dart:io or Flutter dependency, so it runs on the VM, in CLIs and servers, and on the web.

Features #

  • Object model: dictionaries, arrays, names, strings, numbers, streams, and indirect references, with lazy object loading through the cross-reference machinery.
  • Lenient parsing. Real-world PDFs are broken (wrong /Length, missing endobj, junk before the header); the parser tolerates them on input and stays strict on output, including full xref recovery by scanning for object headers when the chain is broken.
  • Filters: Flate, LZW, RunLength, ASCIIHex, ASCII85, CCITT G3/G4, JBIG2 (embedded profile), JPEG 2000, plus predictors. The image codecs are validated against reference implementations (libtiff, jbig2dec, OpenJPEG).
  • Encryption: RC4, AES-128, and AES-256 decryption, and encrypt-on-write for incremental saves.
  • Crypto primitives (ASN.1, RSA, ECDSA, CMS, X.509 chain verification) used by the document layer for digital signatures.
  • Writing: incremental updates that append to the original bytes, and a from-scratch document builder.

Usage #

import 'dart:typed_data';
import 'package:pdf_cos/pdf_cos.dart';

final doc = CosDocument.open(bytes);
final catalog = doc.catalog; // the /Root dictionary
final info = doc.trailer['Info'];

The suite #

Package Layer
pdf_cos file syntax, objects, filters, crypto
pdf_document pages, annotations, forms, signatures, editing
pdf_graphics content interpreter, fonts, text extraction
pdf_editor Flutter viewer + editing UI
0
likes
150
points
0
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

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

Repository (GitHub)
View/report issues
Contributing

Topics

#pdf #parser #serialization #encryption

License

Apache-2.0 (license)

Dependencies

archive, crypto

More

Packages that depend on pdf_cos