PoDoFo 0.9.20
|
Typedefs | |
using | bufferview = cspan< char > |
using | bufferspan = mspan< char > |
using | unicodeview = cspan< char32_t > |
template<class T , size_t Extent = tcb::dynamic_extent> | |
using | cspan = tcb::span< const T, Extent > |
template<class T , size_t Extent = tcb::dynamic_extent, typename std::enable_if<!std::is_const< T >::value, int >::type = 0> | |
using | mspan = tcb::span< T, Extent > |
using | codepoint = char32_t |
using | PdfInlineImageHandler = std::function< bool(const PdfDictionary &imageDict, InputStreamDevice &device)> |
using | CIDToGIDMap = std::map< unsigned, unsigned > |
using | PdfEncodingMapConstPtr = std::shared_ptr< const PdfEncodingMap > |
using | PdfToUnicodeMapConstPtr = std::shared_ptr< const PdfEncodingMap > |
using | PdfFontMetricsConstPtr = std::shared_ptr< const PdfFontMetrics > |
Functions | |
Matrix PODOFO_API | GetFrameRotationTransform (const Rect &rect, double teta) |
Matrix PODOFO_API | GetFrameRotationTransformInverse (const Rect &rect, double teta) |
Rect PODOFO_API | TransformRectPage (const Rect &rect, const PdfPage &page, bool inputIsTransformed) |
PODOFO_API int | GetOperandCount (PdfOperator op) |
PODOFO_API bool | TryGetOperandCount (PdfOperator op, int &count) |
PODOFO_API void | SignDocument (PdfMemDocument &doc, StreamDevice &device, PdfSigner &signer, PdfSignature &signature, PdfSaveOptions saveOptions=PdfSaveOptions::None) |
PdfColorSpace | NameToColorSpaceRaw (const std::string_view &name) |
std::string | NormalizeFontName (const std::string_view &fontName) |
std::string | ExtractFontHints (const std::string_view &fontName, bool &isItalic, bool &isBold) |
void | LogMessage (PdfLogSeverity logSeverity, const std::string_view &msg) |
bool | CheckValidUTF8ToPdfDocEcondingChars (const std::string_view &view, bool &isAsciiEqual) |
Variables | |
constexpr AlgebraicTrait | Tx = AlgebraicTrait::Tx |
X Translation trait. | |
constexpr AlgebraicTrait | Ty = AlgebraicTrait::Ty |
X Translation trait. | |
constexpr PdfVersion | PdfVersionDefault = PdfVersion::V1_4 |
SPDX-FileCopyrightText: (C) 2022 Francesco Pretto ceztk.nosp@m.o@gm.nosp@m.ail.c.nosp@m.om SPDX-License-Identifier: LGPL-2.0-or-later SPDX-License-Identifier: MPL-2.0
SPDX-FileCopyrightText: (C) 2006 Dominik Seichter domse.nosp@m.icht.nosp@m.er@we.nosp@m.b.de SPDX-FileCopyrightText: (C) 2020 Francesco Pretto ceztk.nosp@m.o@gm.nosp@m.ail.c.nosp@m.om SPDX-License-Identifier: LGPL-2.0-or-later
SPDX-FileCopyrightText: (C) 2007 Dominik Seichter domse.nosp@m.icht.nosp@m.er@we.nosp@m.b.de SPDX-FileCopyrightText: (C) 2020 Francesco Pretto ceztk.nosp@m.o@gm.nosp@m.ail.c.nosp@m.om SPDX-License-Identifier: LGPL-2.0-or-later
SPDX-FileCopyrightText: (C) 2021 Francesco Pretto ceztk.nosp@m.o@gm.nosp@m.ail.c.nosp@m.om SPDX-License-Identifier: LGPL-2.0-or-later SPDX-License-Identifier: MPL-2.0
SPDX-FileCopyrightText: (C) 2005 Dominik Seichter domse.nosp@m.icht.nosp@m.er@we.nosp@m.b.de SPDX-License-Identifier: LGPL-2.0-or-later
SPDX-FileCopyrightText: (C) 2005 Dominik Seichter domse.nosp@m.icht.nosp@m.er@we.nosp@m.b.de SPDX-FileCopyrightText: (C) 2020 Francesco Pretto ceztk.nosp@m.o@gm.nosp@m.ail.c.nosp@m.om SPDX-License-Identifier: LGPL-2.0-or-later
All classes, functions, types and enums of PoDoFo are members of these namespace.
If you use PoDoFo, you might want to add the line: using namespace PoDoFo; to your application.
SPDX-FileCopyrightText: (C) 2006 Dominik Seichter domse.nosp@m.icht.nosp@m.er@we.nosp@m.b.de SPDX-License-Identifier: LGPL-2.0-or-later
SPDX-FileCopyrightText: (C) 2011 Dominik Seichter domse.nosp@m.icht.nosp@m.er@we.nosp@m.b.de SPDX-FileCopyrightText: (C) 2020 Francesco Pretto ceztk.nosp@m.o@gm.nosp@m.ail.c.nosp@m.om SPDX-License-Identifier: LGPL-2.0-or-later
SPDX-FileCopyrightText: (C) 2008 Dominik Seichter domse.nosp@m.icht.nosp@m.er@we.nosp@m.b.de SPDX-FileCopyrightText: (C) 2020 Francesco Pretto ceztk.nosp@m.o@gm.nosp@m.ail.c.nosp@m.om SPDX-License-Identifier: LGPL-2.0-or-later
SPDX-FileCopyrightText: (C) 2010 Dominik Seichter domse.nosp@m.icht.nosp@m.er@we.nosp@m.b.de SPDX-FileCopyrightText: (C) 2020 Francesco Pretto ceztk.nosp@m.o@gm.nosp@m.ail.c.nosp@m.om SPDX-License-Identifier: LGPL-2.0-or-later
SPDX-FileCopyrightText: (C) 2008 Dominik Seichter domse.nosp@m.icht.nosp@m.er@we.nosp@m.b.de SPDX-FileCopyrightText: (C) 2021 Francesco Pretto ceztk.nosp@m.o@gm.nosp@m.ail.c.nosp@m.om SPDX-License-Identifier: LGPL-2.0-or-later
SPDX-FileCopyrightText: (C) 2007 Dominik Seichter domse.nosp@m.icht.nosp@m.er@we.nosp@m.b.de SPDX-License-Identifier: LGPL-2.0-or-later
SPDX-FileCopyrightText: (C) 2006 Dominik Seichter domse.nosp@m.icht.nosp@m.er@we.nosp@m.b.de SPDX-FileCopyrightText: (C) 2021 Francesco Pretto ceztk.nosp@m.o@gm.nosp@m.ail.c.nosp@m.om SPDX-License-Identifier: LGPL-2.0-or-later
SPDX-FileCopyrightText: (C) 2007 Dominik Seichter domse.nosp@m.icht.nosp@m.er@we.nosp@m.b.de SPDX-FileCopyrightText: (C) 2021 Francesco Pretto ceztk.nosp@m.o@gm.nosp@m.ail.c.nosp@m.om SPDX-License-Identifier: LGPL-2.0-or-later
SPDX-FileCopyrightText: (C) 2011 Dominik Seichter domse.nosp@m.icht.nosp@m.er@we.nosp@m.b.de SPDX-FileCopyrightText: (C) 2011 Petr Pytelka SPDX-FileCopyrightText: (C) 2020 Francesco Pretto ceztk.nosp@m.o@gm.nosp@m.ail.c.nosp@m.om SPDX-License-Identifier: LGPL-2.0-or-later
SPDX-FileCopyrightText: (C) 2009 Dominik Seichter domse.nosp@m.icht.nosp@m.er@we.nosp@m.b.de SPDX-FileCopyrightText: (C) 2020 Francesco Pretto ceztk.nosp@m.o@gm.nosp@m.ail.c.nosp@m.om SPDX-License-Identifier: LGPL-2.0-or-later
SPDX-FileCopyrightText: (C) 2010 Dominik Seichter domse.nosp@m.icht.nosp@m.er@we.nosp@m.b.de SPDX-FileCopyrightText: (C) 2021 Francesco Pretto ceztk.nosp@m.o@gm.nosp@m.ail.c.nosp@m.om SPDX-License-Identifier: LGPL-2.0-or-later
using PoDoFo::bufferspan = typedef mspan<char> |
Convenient writable char buffer span
using PoDoFo::bufferview = typedef cspan<char> |
Convenient read-only char buffer span
using PoDoFo::CIDToGIDMap = typedef std::map<unsigned, unsigned> |
A backing storage for a CID to GID map
using PoDoFo::codepoint = typedef char32_t |
A conventient typedef for an unspecified codepoint The underlying type is convenientely char32_t so it's a 32 bit fixed sized type that is also compatible with unicode code points
using PoDoFo::cspan = typedef tcb::span<const T, Extent> |
Constant span
using PoDoFo::mspan = typedef tcb::span<T, Extent> |
Mutable span
using PoDoFo::PdfEncodingMapConstPtr = typedef std::shared_ptr<const PdfEncodingMap> |
Convenience typedef for a const /Encoding map entry shared ptr
using PoDoFo::PdfFontMetricsConstPtr = typedef std::shared_ptr<const PdfFontMetrics> |
Convenience typedef for a const PdfEncoding shared ptr
using PoDoFo::PdfInlineImageHandler = typedef std::function<bool(const PdfDictionary& imageDict, InputStreamDevice& device)> |
Custom handler for inline images
imageDict | dictionary for the inline image |
using PoDoFo::PdfToUnicodeMapConstPtr = typedef std::shared_ptr<const PdfEncodingMap> |
Convenience alias for a const /ToUnicode CMap entry shared ptr
using PoDoFo::unicodeview = typedef cspan<char32_t> |
Unicode code point view
|
strong |
|
strong |
|
strong |
|
strong |
The type of the action. PDF supports different action types, each of them has different keys and propeties.
Not all action types listed here are supported yet.
Please make also sure that the action type you use is supported by the PDF version you are using.
|
strong |
Flags that control the appearance of a PdfAnnotation. You can OR them together and pass it to PdfAnnotation::SetFlags.
|
strong |
The type of the annotation. PDF supports different annotation types, each of them has different keys and propeties.
Not all annotation types listed here are supported yet.
Please make also sure that the annotation type you use is supported by the PDF version you are using.
|
strong |
|
strong |
List of defined transparency blending modes
|
strong |
|
strong |
|
strong |
Type of the content read from a content stream
|
strong |
|
strong |
Every PDF datatype that can occur in a PDF file is referenced by an own enum (e.g. Bool or String).
Remember to update PdfVariant::GetDataTypeString() when adding members here.
Enumerator | |
---|---|
Unknown | The Datatype is unknown. The value is chosen to enable value storage in 8-bit unsigned integer. |
Bool | Boolean datatype: Accepts the values "true" and "false". |
Number | Number datatype for integer values. |
Real | Real datatype for floating point numbers. |
String | String datatype in PDF file. Strings have the form (Hallo World!) in PDF files.
|
Name | Name datatype. Names are used as keys in dictionary to reference values.
|
Array | An array of other PDF data types. |
Dictionary | A dictionary associates keys with values. A key can have another dictionary as value. |
Null | The null datatype is always null. |
Reference | The reference datatype contains references to PDF objects in the PDF file of the form 4 0 R.
|
RawData | Raw PDF data. |
|
strong |
Destination type, as per 12.3.2.2 of the Pdf spec.
(see table 151 in the pdf spec)
|
strong |
|
strong |
|
strong |
|
strong |
Error Code enum values which are used in PdfError to describe the error.
If you add an error code to this enum, please also add it to PdfError::ErrorName() and PdfError::ErrorMessage().
Enumerator | |
---|---|
Unknown | Unknown error. |
InvalidHandle | Null pointer was passed, but null pointer is not allowed. |
FileNotFound | A file was not found or cannot be opened. |
InvalidDeviceOperation | Tried to do something unsupported to an I/O device like seek a non-seekable input device. |
UnexpectedEOF | End of file was reached but data was expected. |
OutOfMemory | Not enough memory to complete an operation. |
ValueOutOfRange | The specified memory is out of the allowed range. |
InternalLogic | An internal sanity check or assertion failed. |
InvalidEnumValue | An invalid enum value was specified. |
BrokenFile | The file content is broken. |
PageNotFound | The requested page could not be found in the PDF. |
NoPdfFile | The file is no PDF file. |
NoXRef | The PDF file has no or an invalid XRef table. |
NoTrailer | The PDF file has no or an invalid trailer. |
NoNumber | A number was expected in the PDF file, but the read string is no number. |
NoObject | A object was expected and none was found. |
NoEOFToken | The PDF file has no or an invalid EOF marker. |
InvalidTrailerSize | The trailer size is invalid. |
InvalidDataType | The passed datatype is invalid or was not recognized. |
InvalidXRef | The XRef table is invalid. |
InvalidXRefStream | A XRef steam is invalid. |
InvalidXRefType | The XRef type is invalid or was not found. |
InvalidPredictor | Invalid or unimplemented predictor. |
InvalidStrokeStyle | Invalid stroke style during drawing. |
InvalidHexString | Invalid hex string. |
InvalidStream | The stream is invalid. |
InvalidStreamLength | The stream length is invalid. |
InvalidKey | The specified key is invalid. |
InvalidName | The specified Name is not valid in this context. |
InvalidEncryptionDict | The encryption dictionary is invalid or misses a required key. |
InvalidPassword | The password used to open the PDF file was invalid. |
InvalidFontData | The font file is invalid. |
InvalidContentStream | The content stream is invalid due to mismatched context pairing or other problems. |
UnsupportedFilter | The requested filter is not yet implemented. |
UnsupportedFontFormat | This font format is not supported by PoDoFo. |
ActionAlreadyPresent | An Action was already present when trying to add a Destination. |
WrongDestinationType | The requested field is not available for the given destination type. |
MissingEndStream | The required token endstream was not found. |
Date | Date/time error. |
Flate | Error in zlib. |
FreeType | Error in FreeType. |
SignatureError | Error in signature. |
UnsupportedImageFormat | This image format is not supported by PoDoFo. |
CannotConvertColor | This color format cannot be converted. |
NotImplemented | This feature is currently not implemented. |
DestinationAlreadyPresent | A destination was already present when trying to add an Action. |
ChangeOnImmutable | Changing values on immutable objects is not allowed. |
NotCompiled | This feature was disabled at compile time. |
OutlineItemAlreadyPresent | An outline item to be inserted was already in that outlines tree. |
NotLoadedForUpdate | The document had not been loaded for update. |
CannotEncryptedForUpdate | Cannot load encrypted documents for update. |
XmpMetadata | Error while creating or reading XMP metadata. |
|
strong |
|
strong |
The type of PDF field
|
strong |
Every filter that can be used to encode a stream in a PDF file is referenced by an own enum value. Common filters are PdfFilterType::FlateDecode (i.e. Zip) or PdfFilterType::ASCIIHexDecode
Enumerator | |
---|---|
None | Do not use any filtering. |
ASCIIHexDecode | Converts data from and to hexadecimal. Increases size of the data by a factor of 2!
|
ASCII85Decode | Converts to and from Ascii85 encoding.
|
FlateDecode | Compress data using the Flate algorithm of ZLib. This filter is recommended to be used always.
|
RunLengthDecode | Run length decode data.
|
|
strong |
|
strong |
|
strong |
|
strong |
Enum for the font descriptor flags
See ISO 32000-1:2008 Table 121 — Font flags
|
strong |
|
strong |
|
strong |
Font style flags used during searches
|
strong |
|
strong |
|
strong |
|
strong |
The possible highlighting modes for a PdfField. I.e the visual effect that is to be used when the mouse button is pressed.
The default value is PdfHighlightingMode::Invert
Enumerator | |
---|---|
None | Do no highlighting. |
Invert | Invert the PdfField. |
InvertOutline | Invert the fields border. |
Push | Display the fields down appearance (requires an additional appearance stream to be set) |
|
strong |
Enum for text alignment
|
strong |
Orientation for predefined CID identity encodings
|
strong |
Enum to specifiy the initial information of the info dictionary.
|
strong |
A enum specifying a valid keylength for a PDF encryption key. Keys must be in the range 40 to 128 bit and have to be a multiple of 8.
Adobe Reader supports only keys with 40, 128 or 256 bits!
|
strong |
Enum for line cap styles when drawing.
|
strong |
Enum for line join styles when drawing.
|
strong |
Used in PoDoFo::LogMessage to specify the log level.
Enumerator | |
---|---|
None | Logging disabled. |
Error | Error. |
Warning | Warning. |
Information | Information message. |
Debug | Debug information. |
|
strong |
List of PDF stream content operators
|
strong |
|
strong |
Enum holding the supported of types of "PageLayouts" that define how Acrobat will display the pages in relation to each other
|
strong |
Enum holding the supported of types of "PageModes" that define which (if any) of the "panels" are opened in Acrobat when the document is opened.
|
strong |
|
strong |
|
strong |
An enum describing modes to draw paths and figures
|
strong |
Set user permissions/restrictions on a document
Enumerator | |
---|---|
Allow printing the document. | |
Edit | Allow modifying the document besides annotations, form fields or changing pages. |
Copy | Allow text and graphic extraction. |
EditNotes | Add or modify text annotations or form fields (if PdfPermissions::Edit is set also allow to create interactive form fields including signature) |
FillAndSign | Fill in existing form or signature fields. |
Accessible | Extract text and graphics to support user with disabilities. |
DocAssembly | Assemble the document: insert, create, rotate delete pages or add bookmarks. |
HighPrint | Print a high resolution version of the document. |
|
strong |
|
strong |
|
strong |
List of defined Rendering intents
|
strong |
Enumerator | |
---|---|
NoMetadataUpdate | Don't update the trailer "/Info/ModDate" with current time and synchronize XMP metadata "/Catalog/Metadata" Use this option to produce deterministic PDF output, or if you want to manually handle the manipulation of the XMP packet |
NoModifyDateUpdate |
|
|
strong |
|
strong |
Enum for the different stroke styles that can be set when drawing to a PDF file (mostly for line drawing).
|
strong |
|
strong |
Enum for text rendering mode (Tr)
Compare ISO 32000-1:2008, Table 106 "Text rendering modes"
|
strong |
Enum for predefined tiling patterns.
|
strong |
|
strong |
Enum for vertical text alignment
|
strong |
Specify additional options for writing the PDF.
Enumerator | |
---|---|
Clean | Create a PDF that is readable in a text editor, i.e. insert spaces and linebreaks between tokens. |
NoInlineLiteral | Don't write spaces before literal types (numerical, references, null) |
NoPDFAPreserve | When writing compact (PdfWriteFlags::Clean is unset) code, preserving PDF/A compliance is not required. |
|
strong |
bool PoDoFo::CheckValidUTF8ToPdfDocEcondingChars | ( | const std::string_view & | view, |
bool & | isAsciiEqual | ||
) |
Check if the chars in the given utf-8 view are elegible for PdfDocEncofing conversion
/param isPdfDocEncoding the given utf-8 string is coincident in PdfDocEncoding representation
std::string PoDoFo::ExtractFontHints | ( | const std::string_view & | fontName, |
bool & | isItalic, | ||
bool & | isBold | ||
) |
Extract base font name, removing known bold/italic/subset prefixes/suffixes
Matrix PoDoFo::GetFrameRotationTransform | ( | const Rect & | rect, |
double | teta | ||
) |
Get a rotation trasformation that aligns the rectangle to the axis after the rotation
Matrix PoDoFo::GetFrameRotationTransformInverse | ( | const Rect & | rect, |
double | teta | ||
) |
Get an inverse rotation trasformation that aligns the rectangle to the axis after the rotation
int PoDoFo::GetOperandCount | ( | PdfOperator | op | ) |
Get the operands count of the operator
void PoDoFo::LogMessage | ( | PdfLogSeverity | logSeverity, |
const std::string_view & | msg | ||
) |
Log a message to the logging system defined for PoDoFo.
logSeverity | the severity of the log message |
msg | the message to be logged |
PdfColorSpace PoDoFo::NameToColorSpaceRaw | ( | const std::string_view & | name | ) |
Convert a name into a colorspace enum.
name | name representing a colorspace such as DeviceGray |
std::string PoDoFo::NormalizeFontName | ( | const std::string_view & | fontName | ) |
Normalize base font name, removing known bold/italic/subset prefixes/suffixes
void PoDoFo::SignDocument | ( | PdfMemDocument & | doc, |
StreamDevice & | device, | ||
PdfSigner & | signer, | ||
PdfSignature & | signature, | ||
PdfSaveOptions | saveOptions = PdfSaveOptions::None |
||
) |
Sign the document on the given signature field
doc | the document to be signed |
device | the input/output device where the document will be saved |
signer | the signer implementation that will compute the signature |
signature | the signature field where the signature will be applied |
options | document saving options |
Transform the given rect accordingly to the page rotation
inputIsTransformed | if true the input rectangle is already transformed, if false the input is canonically oriented in top-right quandrant |
bool PoDoFo::TryGetOperandCount | ( | PdfOperator | op, |
int & | count | ||
) |
Get the operands count of the operator
count | the number of operand, -1 means variadic number of operands |
|
constexpr |
The default PDF Version used by new PDF documents in PoDoFo.