Crate fpdf

Crate fpdf 

Source
Expand description

fpdf Copyright (C) 2025 Maik Steiger

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

A PDF document generator with high level support for text, drawing and images.

This crate is inspired by its founding PHP library: https://www.fpdf.org/

The implementation is heavily inspired by GoFPDF: https://codeberg.org/go-pdf/fpdf/

Structs§

AnnotationAttachment
Annotated attachment.
Attachment
Attachment.
BString
CMYKColorName
DateTime
FontDesc
Font descriptor specifies metrics and other attributes of a font, as distinct from the metrics of individual glyphs (as defined in the pdf specification).
Fpdf
Fpdf is the principal structure for creating a single PDF document.
FpdfTTF
FpdfTpl
A concrete implementation of the Template trait.
Grid
HTMLBasic
HTMLLink
ImageInfo
Stores size, color and other information about an image.
ImageOptions
Stores image options for parsing.
Link
Margin
Offset
PageBox
RGB
Describe an RGB color.
SVGBasic
Aggregates the information needed to describe a multi-segment basic vector image.
SVGBasicSegment
TemplateSize
Tpl
Tpl is shadowing Fpdf and it is used for writing a template. It has most of the facilities of a Fpdf, but cannot add more pages. Tpl is used directly only during the limited time a template is writeable.
TransformMatrix
Vec2
Container for two floating-point values with double-point precision.

Enums§

Blend
Select a blend mode.
ColorSpace
Color space of an image object.
FpdfError
Any FPDF error that can happen during runtime execution.
ImageType
Layout
Describe the layout of a PDF page.
Month
Orientation
Orientation state of a PDF page.
PageSize
Specify the page size.
Unit
Define a unit of measurement that translates to a PDF page.
UnitSelector
UnitVec2
Vec2 with unit type annotation attached.
ZoomMode
Zoom mode for displaying content on a PDF page.

Constants§

CN_PROTECT_ANNOT_FORMS
CN_PROTECT_COPY
CN_PROTECT_MODIFY
CN_PROTECT_PRINT

Traits§

FontLoader
Is used to read fonts (JSON font specification and zlib compressed font binaries) from arbitrary locations (e.g. files, zip files).
Pdf
Defines the trait used for various methods. It is implemented by the Fpdf struct, as well as templates.
Template
Templates are object, that can be written to, then used and re-used any number of times within a document.

Functions§

ttf_parse

Type Aliases§

Result