Module render

Module render 

Source
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.
LayerData πŸ”’
LayerPosition πŸ”’
A position relative to the top left corner of a layer.
Layers πŸ”’
LinkAnnotation πŸ”’
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
TextSection
A text section that is drawn on an area of a PDF layer.
UserSpacePosition πŸ”’
A position relative to the bottom left corner of a layer (β€œuser space” in PDF terms).

EnumsΒ§

IndirectFontRef
Compatibility wrapper for a font reference (either builtin or external) to adapt to printpdf 0.8 which uses FontId for external fonts and BuiltinFont for 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 πŸ”’