Expand description
Low-level PDF rendering utilities.
This module provides low-level abstractions over printpdf: A Renderer creates a
document with one or more pages with different sizes. A Page has one or more layers, all
of the same size. A Layer can be used to access its Area.
An Area is a view on a full layer or on a part of a layer. It can be used to print
lines and text. For more advanced text formatting, you can create a TextSection from an
Area.
StructsΒ§
- Area
- A view on an area of a PDF layer that can be drawn on.
- Layer
- A layer of a page of a PDF document.
- Layer
Data π - Layer
Position π - A position relative to the top left corner of a layer.
- Layers π
- Link
Annotation π - Represents a link annotation to be added to a PDF
- Page
- A page of a PDF document.
- Renderer
- Renders a PDF document with one or more pages.
- TJResult π
- Result of parsing and building a TJ operation from a GENPDFI_CPK marker
- Text
Section - A text section that is drawn on an area of a PDF layer.
- User
Space πPosition - A position relative to the bottom left corner of a layer (βuser spaceβ in PDF terms).
EnumsΒ§
- Indirect
Font Ref - Compatibility wrapper for a font reference (either builtin or external) to adapt to
printpdf0.8 which usesFontIdfor external fonts andBuiltinFontfor builtin ones.
ConstantsΒ§
- WIN_
ANSI_ πEXT
FunctionsΒ§
- add_
annotations_ πto_ pdf - Add link annotations to pages in the PDF
- encode_
win1252 π - Encodes the given string using the Windows-1252 encoding for use with built-in PDF fonts, returning an error if it contains unsupported characters.
- parse_
and_ πbuild_ tj - Parse a GENPDFI_CPK marker and build a proper TJ operation
- postprocess_
pdf π - Post-process the PDF to add link annotations to the appropriate pages
- postprocess_
tj_ πimpl