NAME
PDF::Make - PDF generation, parsing, and editing
SYNOPSIS
# High-level Builder API (recommended)
use PDF::Make::Builder;
PDF::Make::Builder->new(file_name => 'report.pdf')
->add_page(page_size => 'A4')
->title('Quarterly Report')
->author('Jane Smith')
->add_h1(text => 'Q4 Results')
->add_text(text => 'Revenue increased 15% year-over-year.')
->add_line(x => 72, ex => 523)
->add_image(image => 'chart.jpg', w => 400)
->add_outline('Q4 Results', page => 0)
->save;
# Low-level XS API (full control)
use PDF::Make::Document;
use PDF::Make::Canvas;
use PDF::Make::Page qw(:fonts);
my $doc = PDF::Make::Document->new;
my $page = $doc->add_page(612, 792);
$page->add_std14_font('F1', HELVETICA);
my $c = PDF::Make::Canvas->new;
$c->BT->Tf('F1', 24)->Td(72, 700)->Tj('Hello, World!')->ET;
$page->set_content($c->to_bytes);
$doc->to_file('hello.pdf');
DESCRIPTION
PDF::Make is a from-scratch PDF implementation for the Semantic ecosystem. The engine is a pure-C library (libpdfmake) with zero runtime dependencies -- no zlib, OpenSSL, libjpeg, or ICU. All compression, encryption, font handling, and image decoding is implemented in C.
The distribution provides two API layers:
- PDF::Make::Builder - High-level, chainable, Object::Proto-based API for common document creation tasks. Handles coordinate translation, page management, word-wrap, and font metrics automatically.
- PDF::Make::Document / PDF::Make::Canvas - Low-level XS API that maps directly to PDF specification concepts. Gives full control over content streams, object graphs, and page structure.
MODULES
Core
- PDF::Make::Document - Create and serialise PDF documents
- PDF::Make::Page - Page objects with font and content management
- PDF::Make::Canvas - Content stream builder (all PDF operators)
- PDF::Make::Writer - Low-level PDF serialiser
- PDF::Make::Arena - Memory arena for PDF object graphs
- PDF::Make::Obj - PDF primitive wrappers (int, string, array, dict)
Parsing and Reading
- PDF::Make::Parser - Parse existing PDF files
- PDF::Make::Reader - Read page information from parsed PDFs
- PDF::Make::Extract - Extract text, annotations, forms, and tables from PDF pages
Fonts and Images
- PDF::Make::Font - Standard 14 and TrueType font handling
- PDF::Make::Image - JPEG and PNG image embedding
Interactive Features
- PDF::Make::Action - Link actions (URI, GoTo, Named, JavaScript)
- PDF::Make::Form - AcroForm interactive forms
- PDF::Make::Field - Form field types (text, checkbox, radio, combo)
Document Features
- PDF::Make::Layer - Optional Content Groups (layers/OCG)
- PDF::Make::Attachment - Embedded file attachments
- PDF::Make::Structure - Tagged PDF and accessibility (StructTree)
- PDF::Make::Color - Color spaces (sRGB, Separation, CMYK)
- PDF::Make::Watermark - Text and image watermarks, stamps
- PDF::Make::Redaction - Content redaction and metadata sanitisation
Security
- PDF::Make::Crypt - Encryption (RC4, AES-128, AES-256)
- PDF::Make::Signature - Digital signatures (PKCS#12, X.509)
Output
- PDF::Make::Linearization - Fast Web View (linearised PDF)
Builder (High-Level API)
- PDF::Make::Builder - Chainable document builder
- PDF::Make::Builder::Font - Font registry and metrics
- PDF::Make::Builder::Page - Page state and layout
- PDF::Make::Builder::Text - Word-wrapped text with alignment
- PDF::Make::Builder::Image - Image placement
- PDF::Make::Builder::TOC - Table of contents generation
- PDF::Make::Builder::Shape::Line - Line drawing
- PDF::Make::Builder::Shape::Box - Rectangle drawing
- PDF::Make::Builder::Shape::Circle - Circle drawing
- PDF::Make::Builder::Shape::Ellipse - Ellipse drawing
- PDF::Make::Builder::Shape::Pie - Pie/arc sector drawing
FUNCTIONS
version()
my $v = PDF::Make::version();
Returns the libpdfmake version string.
DEPENDENCIES
Object::Proto - Call-checker-optimised accessors for Builder classes.
No other runtime dependencies.
SEE ALSO
PDF::Make::Builder for the recommended high-level API.
AUTHOR
LNATION <email@lnation.org>
LICENSE
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.