io library

File-backed DataSource / DataSink helpers for native platforms.

import 'package:pdf_manipulator/pdf_manipulator.dart';
import 'package:pdf_manipulator/io.dart';

final input = PdfFile(File('in.pdf'));
final out = await FileSink.open(File('out.pdf'));

This library imports dart:io, so it is a separate entry point from the main package:pdf_manipulator/pdf_manipulator.dart library. Web builds simply don't import it and never pull in dart:io. On web, back sources and sinks with BlobSource (package:pdf_manipulator/web.dart) or in-memory bytes instead.

Classes

FileSink
A DataSink that streams written chunks to a file on disk. Native platforms only.
FileSource
A DataSource backed by a file on disk. Native platforms only.
PdfFile
A PDF in a file on disk. The job opens the file when it needs it and closes it when it is done, on success, error and cancel: a FileSource you open yourself stays yours to close.