PoDoFo 1.1.0
Loading...
Searching...
No Matches
PdfDeclarations.h
Go to the documentation of this file.
1
7#ifndef PDF_DECLARATIONS_H
8#define PDF_DECLARATIONS_H
9
18 // Include some base macro definitions
19#include <podofo/auxiliary/basedefs.h>
20
21// Include common system headers
22#include <podofo/auxiliary/baseincludes.h>
23
24#include <podofo/auxiliary/Version.h>
25
26#define FORWARD_DECLARE_FCONFIG()\
27extern "C" {\
28 struct _FcConfig;\
29 typedef struct _FcConfig FcConfig;\
30}
31
32#define FORWARD_DECLARE_FREETYPE()\
33extern "C"\
34{\
35 struct FT_FaceRec_;\
36 typedef struct FT_FaceRec_* FT_Face;\
37}
38
49namespace PoDoFo {
50
57{
58 None = 0,
59 Error,
60 Warning,
62 Debug,
63};
64
65// Enums
66
70enum class PdfVersion : uint8_t
71{
72 Unknown = 0,
73 V1_0 = 10,
74 V1_1 = 11,
75 V1_2 = 12,
76 V1_3 = 13,
77 V1_4 = 14,
78 V1_5 = 15,
79 V1_6 = 16,
80 V1_7 = 17,
81 V2_0 = 20,
82};
83
88
89enum class PdfALevel : uint8_t
90{
91 Unknown = 0,
92 // ISO 19005-1:2005
93 L1B,
94 L1A,
95 // ISO 19005-2:2011
96 L2B,
97 L2A,
98 L2U,
99 // ISO 19005-3:2012
100 L3B,
101 L3A,
102 L3U,
103 // ISO 19005-4:2020
104 L4,
105 L4E,
106 L4F,
107};
108
109enum class PdfUALevel : uint8_t
110{
111 Unknown = 0,
112 L1, // ISO 14289-1:2014
113 L2, // ISO 14289-2:2024
114};
115
117{
118 Unknown = 0,
119 Ascii,
121 Unicode,
122};
123
125{
126 Indeterminate = 0,
127 Simple,
128 CMap
129};
130
138
139enum class PdfWModeKind : uint8_t
140{
141 Horizontal = 0,
142 Vertical = 1,
143};
144
149{
150 None = 0,
151 Clean = 1,
152 NoInlineLiteral = 2,
153 NoFlateCompress = 4,
154 PdfAPreserve = 8,
155 SkipDelimiters = 16,
156};
157
167{
168 Unknown = 0,
169 Bool,
170 Number,
171 Real,
172 String,
173 Name,
174 Array,
175 Dictionary,
176 Null,
177 Reference,
178 RawData,
179};
180
181enum class PdfTokenType : uint8_t
182{
183 Unknown = 0,
184 Literal,
185 ParenthesisLeft,
186 ParenthesisRight,
187 BraceLeft,
188 BraceRight,
189 AngleBracketLeft,
190 AngleBracketRight,
191 DoubleAngleBracketsLeft,
192 DoubleAngleBracketsRight,
193 SquareBracketLeft,
194 SquareBracketRight,
195 Slash,
196};
197
199{
200 None = 0,
201 IgnoreCase = 1,
202 KeepWhiteTokens = 2,
203 TokenizeWords = 4,
204 MatchWholeWord = 8,
205 RegexPattern = 16,
206 ComputeBoundingBox = 32,
207 RawCoordinates = 64,
208 ExtractSubstring = 128,
209};
210
211enum class PdfXObjectType : uint8_t
212{
213 Unknown = 0,
214 Form,
215 Image,
216 PostScript,
217};
218
226{
227 None = 0,
230 LZWDecode,
233 CCITTFaxDecode,
234 JBIG2Decode,
235 DCTDecode,
236 JPXDecode,
237 Crypt
238};
239
241{
242 Png = 1,
243 Jpeg = 2,
244};
245
252{
253 None = 0,
254 FixedPitch = 1 << 0,
255 Serif = 1 << 1,
256 Symbolic = 1 << 2,
257 Script = 1 << 3,
258 NonSymbolic = 1 << 5,
259 Italic = 1 << 6,
260 AllCap = 1 << 16,
261 SmallCap = 1 << 17,
262 ForceBold = 1 << 18,
263};
264
265enum class PdfFontStretch : uint8_t
266{
267 Unknown = 0,
268 UltraCondensed,
269 ExtraCondensed,
270 Condensed,
271 SemiCondensed,
272 Normal,
273 SemiExpanded,
274 Expanded,
275 ExtraExpanded,
276 UltraExpanded,
277};
278
286{
287 Unknown = 0,
288 Type1,
289 Type3,
290 TrueType,
291 CIDCFF,
293};
294
296{
297 // Table 126 – Embedded font organization for various font types
298 Unknown = 0,
299 Type1,
300 Type1CFF,
302 Type3,
303 TrueType,
305};
306
310{
311 None = 0,
312 Italic = 1,
313 Bold = 2,
314 // Alias to represent a font with regular style
315 Regular = None,
316};
317
323{
324 ReadMetrics = 1,
325 FontProgram = 2
326};
327
331{
332 None = 0,
333 Standard14 = 1,
334 Standard14Alt = 2,
335};
336
340{
341 None = 0,
342 DontEmbed = 1,
343 DontSubset = 2,
344 PreferNonCID = 4,
345};
346
353
359{
360 Unknown = 0,
361 DeviceGray,
362 DeviceRGB,
363 DeviceCMYK,
364 CalGray,
365 CalRGB,
366 Lab,
367 ICCBased,
368 Indexed,
369 Pattern,
370 Separation,
371 DeviceN
372};
373
375{
376 Unknown = 0,
377 Grayscale,
378 RGB24,
379 BGR24,
380 RGBA,
381 BGRA,
382 ARGB,
383 ABGR,
384};
385
402
408{
409 Solid = 1,
410 Dash,
411 Dot,
412 DashDot,
413 DashDotDot
414};
415
421{
422 None = 0,
425 WriteProducer = 4,
426};
427
432{
433 Butt = 0,
434 Round = 1,
435 Square = 2
436};
437
442{
443 Miter = 0,
444 Round = 1,
445 Bevel = 2
446};
447
452{
453 Top = 0,
454 Center = 1,
455 Bottom = 2
456};
457
462{
463 Left = 0,
464 Center = 1,
465 Right = 2
466};
467
469{
470 None = 0,
471 _Reserved1 = 1,
472 _Reserved2 = 2,
476 NoFlateCompress = 4,
477 NoCollectGarbage = 8,
486 NoMetadataUpdate = 16,
487 Clean = 32,
492 SaveOnSigning = 64,
493
498};
499
501{
502 None = 0,
504 StrictParsing = 1,
508 SkipXRefRecovery = 4,
509};
510
511enum class PdfAdditionalMetadata : uint8_t
512{
513 PdfAIdAmd = 1,
514 PdfAIdCorr,
515 PdfAIdRev,
516 PdfUAIdAmd,
517 PdfUAIdCorr,
518 PdfUAIdRev,
519};
520
529{
530 Unknown = 0,
531 A0,
532 A1,
533 A2,
534 A3,
535 A4,
536 A5,
537 A6,
538 Letter,
539 Legal,
540 Tabloid,
541};
542
551{
552 UseNone = 1,
553 UseThumbs,
554 UseOutlines,
555 FullScreen,
556 UseOC,
557 UseAttachments
558};
559
568{
569 SinglePage = 1,
570 OneColumn,
571 TwoColumnLeft,
572 TwoColumnRight,
573 TwoPageLeft,
574 TwoPageRight
575};
576
577enum class PdfStandard14FontType : uint8_t
578{
579 Unknown = 0,
580 TimesRoman,
581 TimesItalic,
582 TimesBold,
583 TimesBoldItalic,
584 Helvetica,
585 HelveticaOblique,
586 HelveticaBold,
587 HelveticaBoldOblique,
588 Courier,
589 CourierOblique,
590 CourierBold,
591 CourierBoldOblique,
592 Symbol,
593 ZapfDingbats,
594};
595
606{
607 Unknown = 0,
608 Text, // - supported
609 Link, // - supported
610 FreeText, // PDF 1.3 // - supported
611 Line, // PDF 1.3 // - supported
612 Square, // PDF 1.3
613 Circle, // PDF 1.3
614 Polygon, // PDF 1.5
615 PolyLine, // PDF 1.5
616 Highlight, // PDF 1.3
617 Underline, // PDF 1.3
618 Squiggly, // PDF 1.4
619 StrikeOut, // PDF 1.3
620 Stamp, // PDF 1.3
621 Caret, // PDF 1.5
622 Ink, // PDF 1.3
623 Popup, // PDF 1.3 // - supported
624 FileAttachement,// PDF 1.3
625 Sound, // PDF 1.2
626 Movie, // PDF 1.2
627 Widget, // PDF 1.2 // - supported
628 Screen, // PDF 1.5
629 PrinterMark, // PDF 1.4
630 TrapNet, // PDF 1.3
631 Watermark, // PDF 1.6
632 Model3D, // PDF 1.6
633 RichMedia, // PDF 1.7 ADBE ExtensionLevel 3 ALX: Petr P. Petrov
634 WebMedia, // PDF 1.7 IPDF ExtensionLevel 3
635 Redact, // PDF 1.7
636 Projection, // PDF 2.0
637};
638
644{
645 None = 0x0000,
646 Invisible = 0x0001,
647 Hidden = 0x0002,
648 Print = 0x0004,
649 NoZoom = 0x0008,
650 NoRotate = 0x0010,
651 NoView = 0x0020,
652 ReadOnly = 0x0040,
653 Locked = 0x0080,
654 ToggleNoView = 0x0100,
655 LockedContents = 0x0200,
656};
657
661{
662 Unknown = 0,
663 PushButton,
664 CheckBox,
665 RadioButton,
666 TextBox,
667 ComboBox,
668 ListBox,
669 Signature,
670};
671
681{
682 Unknown = 0,
683 None,
684 Invert,
686 Push,
687};
688
689enum class PdfFieldFlags : uint8_t
690{
691 ReadOnly = 1,
692 Required = 2,
693 NoExport = 4
694};
695
700{
701 Normal = 0,
702 Rollover,
703 Down
704};
705
706enum class PdfResourceType : uint8_t
707{
708 Unknown = 0,
709 ExtGState,
710 ColorSpace,
711 Pattern,
712 Shading,
713 XObject,
714 Font,
715 Properties
716};
717
718enum class PdfKnownNameTree : uint8_t
719{
720 Unknown = 0,
721 Dests,
722 AP,
723 JavaScript,
724 Pages,
725 Templates,
726 IDS,
727 URLS,
728 EmbeddedFiles,
729 AlternatePresentations,
730 Renditions,
731};
732
737{
738 Unknown = 0,
739 // ISO 32008-1:2008 Table 51 – Operator Categories
740 // General graphics state
741 w,
742 J,
743 j,
744 M,
745 d,
746 ri,
747 i,
748 gs,
749 // Special graphics state
750 q,
751 Q,
752 cm,
753 // Path construction
754 m,
755 l,
756 c,
757 v,
758 y,
759 h,
760 re,
761 // Path painting
762 S,
763 s,
764 f,
765 F,
766 f_Star,
767 B,
768 B_Star,
769 b,
770 b_Star,
771 n,
772 // Clipping paths
773 W,
774 W_Star,
775 // Text objects
776 BT,
777 ET,
778 // Text state
779 Tc,
780 Tw,
781 Tz,
782 TL,
783 Tf,
784 Tr,
785 Ts,
786 // Text positioning
787 Td,
788 TD,
789 Tm,
790 T_Star,
791 // Text showing
792 Tj,
793 TJ,
794 Quote,
795 DoubleQuote,
796 // Type 3 fonts
797 d0,
798 d1,
799 // Color
800 CS,
801 cs,
802 SC,
803 SCN,
804 sc,
805 scn,
806 G,
807 g,
808 RG,
809 rg,
810 K,
811 k,
812 // Shading patterns
813 sh,
814 // Inline images
815 BI,
816 ID,
817 EI,
818 // XObjects
819 Do,
820 // Marked content
821 MP,
822 DP,
823 BMC,
824 BDC,
825 EMC,
826 // Compatibility
827 BX,
828 EX,
829};
830
835{
836 Unknown = 0,
837 AbsoluteColorimetric,
838 RelativeColorimetric,
839 Perceptual,
840 Saturation,
841};
842
847{
848 Unknown = 0,
849 Normal,
850 Multiply,
851 Screen,
852 Overlay,
853 Darken,
854 Lighten,
855 ColorDodge,
856 ColorBurn,
857 HardLight,
858 SoftLight,
859 Difference,
860 Exclusion,
861 Hue,
862 Saturation,
863 Color,
864 Luminosity,
865};
866
867enum class PdfSignatureType : uint8_t
868{
869 Unknown = 0,
870 PAdES_B = 1,
871 Pkcs7 = 2,
872};
873
874enum class PdfSignatureEncryption : uint8_t
875{
876 Unknown = 0,
877 RSA,
878 ECDSA,
879};
880
881enum class PdfHashingAlgorithm : uint8_t
882{
883 Unknown = 0,
884 SHA256,
885 SHA384,
886 SHA512,
887};
888
889using PdfFilterList = std::vector<PdfFilterType>;
890
891};
892
893ENABLE_BITMASK_OPERATORS(PoDoFo::PdfSaveOptions);
894ENABLE_BITMASK_OPERATORS(PoDoFo::PdfLoadOptions);
895ENABLE_BITMASK_OPERATORS(PoDoFo::PdfWriteFlags);
896ENABLE_BITMASK_OPERATORS(PoDoFo::PdfInfoInitial);
897ENABLE_BITMASK_OPERATORS(PoDoFo::PdfFontStyle);
898ENABLE_BITMASK_OPERATORS(PoDoFo::PdfFontCreateFlags);
899ENABLE_BITMASK_OPERATORS(PoDoFo::PdfFontAutoSelectBehavior);
900ENABLE_BITMASK_OPERATORS(PoDoFo::PdfFontMatchBehaviorFlags);
901ENABLE_BITMASK_OPERATORS(PoDoFo::PdfFontDescriptorFlags);
902ENABLE_BITMASK_OPERATORS(PoDoFo::PdfGlyphAccess);
903ENABLE_BITMASK_OPERATORS(PoDoFo::PdfTextExtractFlags);
904ENABLE_BITMASK_OPERATORS(PoDoFo::PdfAnnotationFlags);
905
936#endif // PDF_DECLARATIONS_H
Convenient type for char array storage and/or buffer with std::string compatibility.
Definition basetypes.h:38
SPDX-FileCopyrightText: (C) 2022 Francesco Pretto ceztko@gmail.com SPDX-License-Identifier: LGPL-2....
Definition basetypes.h:16
PdfLineJoinStyle
Enum for line join styles when drawing.
Definition PdfDeclarations.h:442
PdfPageLayout
Enum holding the supported of types of "PageLayouts" that define how Acrobat will display the pages i...
Definition PdfDeclarations.h:568
PdfAnnotationType
The type of the annotation.
Definition PdfDeclarations.h:606
PdfPageSize
Enum holding the supported page sizes by PoDoFo.
Definition PdfDeclarations.h:529
PdfPixelFormat
Definition PdfDeclarations.h:375
@ BGRA
This is known to be used in Windows GDI Bitmap.
@ ABGR
This is known to be used in JDK BufferedImage.TYPE_4BYTE_ABGR.
@ RGBA
This is known to be working in Apple CGImage created with rgb colorspace and kCGBitmapByteOrder32Big ...
PdfInfoInitial
Enum to specify the initial information of the info dictionary.
Definition PdfDeclarations.h:421
@ WriteCreationTime
Write the creation time (current time). Default for new documents.
@ WriteModificationTime
Write the modification time (current time). Default for loaded documents.
@ WriteProducer
Write producer key. Default for new documents.
PdfPageMode
Enum holding the supported of types of "PageModes" that define which (if any) of the "panels" are ope...
Definition PdfDeclarations.h:551
PdfGlyphAccess
When accessing a glyph, there may be a difference in the glyph ID to retrieve the widths or to index ...
Definition PdfDeclarations.h:323
@ ReadMetrics
The glyph is accessed in the PDF metrics arrays (/Widths, /W keys)
@ FontProgram
The glyph is accessed in the font program.
PdfBlendMode
List of defined transparency blending modes.
Definition PdfDeclarations.h:847
PdfFontFileType
Definition PdfDeclarations.h:296
@ Type1CFF
Compact Font representation for a Type1 font, as described by Adobe Technical Note #5176 "The Compact...
@ CIDKeyedCFF
A Compact Font representation of a CID keyed font, as described by Adobe Technical Note #5176 "The Co...
@ OpenTypeCFF
OpenType font with a "CFF"/"CFF2" table, as described in ISO/IEC 14496-22.
PdfStrokeStyle
Enum for the different stroke styles that can be set when drawing to a PDF file (mostly for line draw...
Definition PdfDeclarations.h:408
PdfDataType
Every PDF datatype that can occur in a PDF file is referenced by an own enum (e.g.
Definition PdfDeclarations.h:167
@ String
String datatype in PDF file. Strings have the form (Hallo World!) in PDF files.
@ Dictionary
A dictionary associates keys with values. A key can have another dictionary as value.
@ Array
An array of other PDF data types.
@ Name
Name datatype. Names are used as keys in dictionary to reference values.
@ Reference
The reference datatype contains references to PDF objects in the PDF file of the form 4 0 R.
@ Real
Real datatype for floating point numbers.
@ Number
Number datatype for integer values.
@ Null
The null datatype is always null.
@ Bool
Boolean datatype: Accepts the values "true" and "false".
@ RawData
Raw PDF data.
PdfSaveOptions
Definition PdfDeclarations.h:469
@ NoMetadataUpdate
Don't update the trailer "/Info/ModDate" with current time and synchronize XMP metadata "/Catalog/Met...
@ SaveOnSigning
Save the document on a signing operation, instead of performing an incremental update.
PdfRenderingIntent
List of defined Rendering intents.
Definition PdfDeclarations.h:835
PdfStringCharset
Definition PdfDeclarations.h:117
@ PdfDocEncoding
UTF-8 string that have characters that are in the whole PdfDocEncoding charset.
@ Ascii
UTF-8 string that have characters that are in both Ascii and PdfDocEncoding charsets.
@ Unicode
UTF-8 string that have characters that are in the whole Unicode charset.
PdfFieldType
The type of PDF field.
Definition PdfDeclarations.h:661
constexpr PdfVersion PdfVersionDefault
The default PDF Version used by new PDF documents in PoDoFo.
Definition PdfDeclarations.h:87
PdfLoadOptions
Definition PdfDeclarations.h:501
@ LoadStreamsEagerly
Skip rebuilding object index on cross reference sections parsing failing.
@ StrictParsing
Load object streams immediately after parsing cross references sections.
PdfHorizontalAlignment
Enum for text alignment.
Definition PdfDeclarations.h:462
@ None
Do not add a default appearrance.
PdfExportFormat
Definition PdfDeclarations.h:241
@ Png
NOTE: Not yet supported.
PdfFontAutoSelectBehavior
Flags to control font creation.
Definition PdfDeclarations.h:331
@ Standard14Alt
Automatically select a Standard14 font if the fontname matches one of them (standard and alternative ...
@ Standard14
Automatically select a Standard14 font if the fontname matches one of them.
PdfAppearanceType
Type of the annotation appearance.
Definition PdfDeclarations.h:700
@ Down
Down appearance; the default is PdfAnnotationAppearance::Normal.
@ Rollover
Rollover appearance; the default is PdfAnnotationAppearance::Normal.
PdfWriteFlags
Specify additional options for writing the PDF.
Definition PdfDeclarations.h:149
@ 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)
@ PdfAPreserve
Preserve PDFA compliance during writing (NOTE: it does not itself convert the document to PDF/A)
@ SkipDelimiters
Skip delimiters in serialization of strings and outer dictionaries/arrays.
PdfLineCapStyle
Enum for line cap styles when drawing.
Definition PdfDeclarations.h:432
PdfHighlightingMode
The possible highlighting modes for a PdfField.
Definition PdfDeclarations.h:681
@ InvertOutline
Invert the fields border.
@ Invert
Invert the PdfField.
@ Push
Display the fields down appearance (requires an additional appearance stream to be set)
PdfTextExtractFlags
Definition PdfDeclarations.h:199
@ ComputeBoundingBox
NOTE: Currently the bounding is inaccurate.
@ ExtractSubstring
NOTE: Extract the matched substring.
PdfFontCreateFlags
Font init flags.
Definition PdfDeclarations.h:340
@ DontEmbed
Do not embed font data. Not embedding Standard14 fonts implies non CID.
@ DontSubset
Don't subset font data (includes all the font glyphs)
@ PreferNonCID
Prefer non CID, simple fonts (/Type1, /TrueType)
PdfEncodingMapType
Definition PdfDeclarations.h:125
@ Simple
A legacy encoding, such as predefined, Type1 font built-in, or difference.
@ Indeterminate
Indeterminate map type, such as non standard identity encodings.
@ CMap
A proper CMap encoding or pre-defined CMap names.
PdfAnnotationFlags
Flags that control the appearance of a PdfAnnotation.
Definition PdfDeclarations.h:644
PdfFilterType
Every filter that can be used to encode a stream in a PDF file is referenced by an own enum value.
Definition PdfDeclarations.h:226
@ RunLengthDecode
Run length decode data.
@ ASCII85Decode
Converts to and from Ascii85 encoding.
@ ASCIIHexDecode
Converts data from and to hexadecimal. Increases size of the data by a factor of 2!
@ FlateDecode
Compress data using the Flate algorithm of ZLib. This filter is recommended to be used always.
PdfOperator
List of PDF stream content operators.
Definition PdfDeclarations.h:737
PdfFontStyle
Font style flags used during searches.
Definition PdfDeclarations.h:310
PdfTextRenderingMode
Enum for text rendering mode (Tr)
Definition PdfDeclarations.h:392
@ StrokeAddToClipPath
Stroke text and add to path for clipping.
@ AddToClipPath
Add text to path for clipping.
@ Invisible
Neither fill nor stroke text (invisible)
@ FillStroke
Fill, then stroke text.
@ Fill
Default mode, fill text.
@ FillAddToClipPath
Fill text and add to path for clipping.
@ FillStrokeAddToClipPath
Fill, then stroke text and add to path for clipping.
PdfFontType
Enum specifying the type of the font.
Definition PdfDeclarations.h:286
@ CIDCFF
This is a "/CIDFontType0" font.
@ CIDTrueType
This is a "/CIDFontType2" font.
PdfColorSpaceType
Enum for the colorspaces supported by PDF.
Definition PdfDeclarations.h:359
PdfVerticalAlignment
Enum for vertical text alignment.
Definition PdfDeclarations.h:452
PdfFontDescriptorFlags
Enum for the font descriptor flags.
Definition PdfDeclarations.h:252
@ NonSymbolic
Font uses the Standard Latin character set or a subset of it. It does not mean the font uses only tex...
@ Italic
Glyphs have dominant vertical strokes that are slanted.
@ ForceBold
Determine whether bold glyphs shall be painted with extra pixels even.
@ Symbolic
Font contains glyphs outside the Standard Latin character set. It does not mean the font is a symbol ...
@ FixedPitch
Also known as monospaced.
PdfLogSeverity
Used in PoDoFo::LogMessage to specify the log level.
Definition PdfDeclarations.h:57
@ Debug
Debug information.
@ Information
Information message.
PdfPredefinedEncodingType
Definition PdfDeclarations.h:132
@ PredefinedCMap
A predefined CMap, see ISO 32000-2:2020 "9.7.5.2 Predefined CMaps".
@ IdentityCMap
A predefined identity CMap that is either "Identity-H" or "Identity-V".
@ LegacyPredefined
A legacy predefined encoding, such as "WinAnsiEncoding", "MacRomanEncoding" or "MacExpertEncoding".
PdfFontMatchBehaviorFlags
Definition PdfDeclarations.h:348
@ NormalizePattern
Normalize search pattern, removing subset prefixes like "ABCDEF+" and extract flags from it (like ",...
@ SkipMatchPostScriptName
Skip matching postscript font name.
PdfVersion
Enum to identify different versions of the PDF file format.
Definition PdfDeclarations.h:71