dart_pdf_cli library
Transport-independent PDF inspection services used by the dartpdf
command line executable and its MCP adapter.
Classes
- DartPdfDocument
- One open PDF document and the stable JSON-producing command handlers.
- DartPdfLimits
- Hard result bounds shared by CLI and MCP transports.
- DartPdfPageSelection
- A parsed, one-based CLI page range resolved to zero-based page indices.
- DartPdfService
- Opens bytes once and exposes the read-only operations shared by transports.
Constants
- dartPdfJsonSchemaVersion → const int
- Version of the JSON contract returned by all DartPDF read operations.
Functions
-
createDartPdfMcpServer(
{required DartPdfFileReader readFile, DartPdfPasswordReader? readPassword, DartPdfService service = const DartPdfService()}) → McpServer - Creates the read-only DartPDF MCP server over transport-independent DartPdfDocument handlers.
Typedefs
-
DartPdfFileReader
= Future<
Uint8List> Function(String path) - Reads one PDF path after the host has applied its filesystem policy.
-
DartPdfPasswordReader
= Future<
String> Function(Map<String, dynamic> arguments) - Resolves a password source from MCP tool arguments.
Exceptions / Errors
- DartPdfRequestException
- Invalid page selection or request that exceeds a configured result bound.