Published 2025-10-15
Port of alm, byter, pdfio that are unmaintained.

Source code upgraded to dart null-safety, and refactored to meet 'our' standards.
Technically it is possible to generate pdfs with this library, but you are advised to use pkg_pdflib for that if possible, a plus for pkg_pdfio is that it doesn't rely on anything (pure dart) but quality is not guaranteed.
Code added to extract custom color separations (Thru-cut, Crease, etc.) and cut-paths.
Beware of constructions like below, where we parse a list of pdf files and then extract info from them:
PDFObjecter parseFile(final File file) {
print('[all] ${file.path}');
return PDFObjecter.fromFile(file, withImages: false);
}
final List<String> result = Directory('..')
.listSync(recursive: true)
.whereType<File>()
.whereNot((final File e) => e.isHidden)
.where((final File e) => e.getExtension().equals('pdf'))
.map(parseFile)
.map((final PDFObjecter e) =>
e.all.map((final PDFParsedObject e) => e.toString()))
.expand((final Iterable<String> e) => e)
.toList();
You will get a (temporary) list of parsed pdf file objects from PDFObjecter.fromFile(file, withImages: false) which are then mapped with toString.
The (temporary) list will consume a LARGE amount of memory.
A better way is to process each file individually in a for loop so each temporary PDFObjecter will get disposed on each iteration.
ascii85 decoding, although it does not work with test file 'test/assets/196673_7UP.pdf'.Matrix4.translate to Matrix4.translateByDouble due to deprication of translate.Matrix4.scale to Matrix4.scaleByDouble due to deprication of scale.separations list, so it chooses eg. EOT over Pantone 109 C if both exist with the same key (like /CS1).Byter::byte offset out of buffer bounds.PDFObjecter::_doBuildObjectList reparses objects that contain missing references.verbose flag to extractor.