PoDoFo 1.1.0
Loading...
Searching...
No Matches
PdfDeclarations.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2005 Dominik Seichter <domseichter@web.de>
2// SPDX-FileCopyrightText: 2020 Francesco Pretto <ceztko@gmail.com>
3// SPDX-License-Identifier: LGPL-2.0-or-later OR MPL-2.0
4
5#ifndef PDF_DECLARATIONS_H
6#define PDF_DECLARATIONS_H
7
16 // Include some base macro definitions
17#include <podofo/auxiliary/basedefs.h>
18
19// Include common system headers
20#include <podofo/auxiliary/baseincludes.h>
21
22#include <podofo/auxiliary/Version.h>
23
24#define FORWARD_DECLARE_FCONFIG()\
25extern "C" {\
26 struct _FcConfig;\
27 typedef struct _FcConfig FcConfig;\
28}
29
30#define FORWARD_DECLARE_FREETYPE()\
31extern "C"\
32{\
33 struct FT_FaceRec_;\
34 typedef struct FT_FaceRec_* FT_Face;\
35}
36
47namespace PoDoFo {
48
55{
56 None = 0,
57 Error,
58 Warning,
60 Debug,
61};
62
63// Enums
64
68enum class PdfVersion : uint8_t
69{
70 Unknown = 0,
71 V1_0 = 10,
72 V1_1 = 11,
73 V1_2 = 12,
74 V1_3 = 13,
75 V1_4 = 14,
76 V1_5 = 15,
77 V1_6 = 16,
78 V1_7 = 17,
79 V2_0 = 20,
80};
81
86
87enum class PdfALevel : uint8_t
88{
89 Unknown = 0,
90 // ISO 19005-1:2005
91 L1B,
92 L1A,
93 // ISO 19005-2:2011
94 L2B,
95 L2A,
96 L2U,
97 // ISO 19005-3:2012
98 L3B,
99 L3A,
100 L3U,
101 // ISO 19005-4:2020
102 L4,
103 L4E,
104 L4F,
105};
106
107enum class PdfUALevel : uint8_t
108{
109 Unknown = 0,
110 L1, // ISO 14289-1:2014
111 L2, // ISO 14289-2:2024
112};
113
115{
116 Unknown = 0,
117 Ascii,
119 Unicode,
120};
121
123{
124 Indeterminate = 0,
125 Simple,
126 CMap
127};
128
136
137enum class PdfWModeKind : uint8_t
138{
139 Horizontal = 0,
140 Vertical = 1,
141};
142
147{
148 None = 0,
149 Clean = 1,
150 NoInlineLiteral = 2,
151 NoFlateCompress = 4,
152 PdfAPreserve = 8,
153 SkipDelimiters = 16,
154};
155
165{
166 Unknown = 0,
167 Bool,
168 Number,
169 Real,
170 String,
171 Name,
172 Array,
173 Dictionary,
174 Null,
175 Reference,
176 RawData,
177};
178
179enum class PdfTokenType : uint8_t
180{
181 Unknown = 0,
182 Literal,
183 ParenthesisLeft,
184 ParenthesisRight,
185 BraceLeft,
186 BraceRight,
187 AngleBracketLeft,
188 AngleBracketRight,
189 DoubleAngleBracketsLeft,
190 DoubleAngleBracketsRight,
191 SquareBracketLeft,
192 SquareBracketRight,
193 Slash,
194};
195
197{
198 None = 0,
199 IgnoreCase = 1,
200 KeepWhiteTokens = 2,
201 TokenizeWords = 4,
202 MatchWholeWord = 8,
203 RegexPattern = 16,
204 ComputeBoundingBox = 32,
205 RawCoordinates = 64,
206 ExtractSubstring = 128,
207};
208
209enum class PdfXObjectType : uint8_t
210{
211 Unknown = 0,
212 Form,
213 Image,
214 PostScript,
215};
216
224{
225 None = 0,
228 LZWDecode,
231 CCITTFaxDecode,
232 JBIG2Decode,
233 DCTDecode,
234 JPXDecode,
235 Crypt
236};
237
239{
240 Png = 1,
241 Jpeg = 2,
242};
243
250{
251 None = 0,
252 FixedPitch = 1 << 0,
253 Serif = 1 << 1,
254 Symbolic = 1 << 2,
255 Script = 1 << 3,
256 NonSymbolic = 1 << 5,
257 Italic = 1 << 6,
258 AllCap = 1 << 16,
259 SmallCap = 1 << 17,
260 ForceBold = 1 << 18,
261};
262
263enum class PdfFontStretch : uint8_t
264{
265 Unknown = 0,
266 UltraCondensed,
267 ExtraCondensed,
268 Condensed,
269 SemiCondensed,
270 Normal,
271 SemiExpanded,
272 Expanded,
273 ExtraExpanded,
274 UltraExpanded,
275};
276
284{
285 Unknown = 0,
286 Type1,
287 Type3,
288 TrueType,
289 CIDCFF,
291};
292
294{
295 // Table 126 – Embedded font organization for various font types
296 Unknown = 0,
297 Type1,
298 Type1CFF,
300 Type3,
301 TrueType,
303};
304
308{
309 None = 0,
310 Italic = 1,
311 Bold = 2,
312 // Alias to represent a font with regular style
313 Regular = None,
314};
315
321{
322 ReadMetrics = 1,
323 FontProgram = 2
324};
325
329{
330 None = 0,
331 Standard14 = 1,
332 Standard14Alt = 2,
333};
334
338{
339 None = 0,
340 DontEmbed = 1,
341 DontSubset = 2,
342 PreferNonCID = 4,
343};
344
351
357{
358 Unknown = 0,
359 DeviceGray,
360 DeviceRGB,
361 DeviceCMYK,
362 CalGray,
363 CalRGB,
364 Lab,
365 ICCBased,
366 Indexed,
367 Pattern,
368 Separation,
369 DeviceN
370};
371
373{
374 Unknown = 0,
375 Grayscale,
376 RGB24,
377 BGR24,
378 RGBA,
379 BGRA,
380 ARGB,
381 ABGR,
382};
383
400
406{
407 Solid = 1,
408 Dash,
409 Dot,
410 DashDot,
411 DashDotDot
412};
413
419{
420 None = 0,
423 WriteProducer = 4,
424};
425
430{
431 Butt = 0,
432 Round = 1,
433 Square = 2
434};
435
440{
441 Miter = 0,
442 Round = 1,
443 Bevel = 2
444};
445
450{
451 Top = 0,
452 Center = 1,
453 Bottom = 2
454};
455
460{
461 Left = 0,
462 Center = 1,
463 Right = 2
464};
465
467{
468 None = 0,
469 _Reserved1 = 1,
470 _Reserved2 = 2,
474 NoFlateCompress = 4,
475 NoCollectGarbage = 8,
484 NoMetadataUpdate = 16,
485 Clean = 32,
490 SaveOnSigning = 64,
491
496 IgnoreXRefErrors = 128,
497
502};
503
505{
506 None = 0,
508 StrictParsing = 1,
512 SkipXRefRecovery = 4,
513};
514
515enum class PdfAdditionalMetadata : uint8_t
516{
517 PdfAIdAmd = 1,
518 PdfAIdCorr,
519 PdfAIdRev,
520 PdfUAIdAmd,
521 PdfUAIdCorr,
522 PdfUAIdRev,
523};
524
533{
534 Unknown = 0,
535 A0,
536 A1,
537 A2,
538 A3,
539 A4,
540 A5,
541 A6,
542 Letter,
543 Legal,
544 Tabloid,
545};
546
555{
556 UseNone = 1,
557 UseThumbs,
558 UseOutlines,
559 FullScreen,
560 UseOC,
561 UseAttachments
562};
563
572{
573 SinglePage = 1,
574 OneColumn,
575 TwoColumnLeft,
576 TwoColumnRight,
577 TwoPageLeft,
578 TwoPageRight
579};
580
581enum class PdfStandard14FontType : uint8_t
582{
583 Unknown = 0,
584 TimesRoman,
585 TimesItalic,
586 TimesBold,
587 TimesBoldItalic,
588 Helvetica,
589 HelveticaOblique,
590 HelveticaBold,
591 HelveticaBoldOblique,
592 Courier,
593 CourierOblique,
594 CourierBold,
595 CourierBoldOblique,
596 Symbol,
597 ZapfDingbats,
598};
599
610{
611 Unknown = 0,
612 Text, // - supported
613 Link, // - supported
614 FreeText, // PDF 1.3 // - supported
615 Line, // PDF 1.3 // - supported
616 Square, // PDF 1.3
617 Circle, // PDF 1.3
618 Polygon, // PDF 1.5
619 PolyLine, // PDF 1.5
620 Highlight, // PDF 1.3
621 Underline, // PDF 1.3
622 Squiggly, // PDF 1.4
623 StrikeOut, // PDF 1.3
624 Stamp, // PDF 1.3
625 Caret, // PDF 1.5
626 Ink, // PDF 1.3
627 Popup, // PDF 1.3 // - supported
628 FileAttachement,// PDF 1.3
629 Sound, // PDF 1.2
630 Movie, // PDF 1.2
631 Widget, // PDF 1.2 // - supported
632 Screen, // PDF 1.5
633 PrinterMark, // PDF 1.4
634 TrapNet, // PDF 1.3
635 Watermark, // PDF 1.6
636 Model3D, // PDF 1.6
637 RichMedia, // PDF 1.7 ADBE ExtensionLevel 3 ALX: Petr P. Petrov
638 WebMedia, // PDF 1.7 IPDF ExtensionLevel 3
639 Redact, // PDF 1.7
640 Projection, // PDF 2.0
641};
642
648{
649 None = 0x0000,
650 Invisible = 0x0001,
651 Hidden = 0x0002,
652 Print = 0x0004,
653 NoZoom = 0x0008,
654 NoRotate = 0x0010,
655 NoView = 0x0020,
656 ReadOnly = 0x0040,
657 Locked = 0x0080,
658 ToggleNoView = 0x0100,
659 LockedContents = 0x0200,
660};
661
665{
666 Unknown = 0,
667 PushButton,
668 CheckBox,
669 RadioButton,
670 TextBox,
671 ComboBox,
672 ListBox,
673 Signature,
674};
675
685{
686 Unknown = 0,
687 None,
688 Invert,
690 Push,
691};
692
693enum class PdfFieldFlags : uint8_t
694{
695 ReadOnly = 1,
696 Required = 2,
697 NoExport = 4
698};
699
704{
705 Normal = 0,
706 Rollover,
707 Down
708};
709
710enum class PdfResourceType : uint8_t
711{
712 Unknown = 0,
713 ExtGState,
714 ColorSpace,
715 Pattern,
716 Shading,
717 XObject,
718 Font,
719 Properties
720};
721
722enum class PdfKnownNameTree : uint8_t
723{
724 Unknown = 0,
725 Dests,
726 AP,
727 JavaScript,
728 Pages,
729 Templates,
730 IDS,
731 URLS,
732 EmbeddedFiles,
733 AlternatePresentations,
734 Renditions,
735};
736
741{
742 Unknown = 0,
743 // ISO 32008-1:2008 Table 51 – Operator Categories
744 // General graphics state
745 w,
746 J,
747 j,
748 M,
749 d,
750 ri,
751 i,
752 gs,
753 // Special graphics state
754 q,
755 Q,
756 cm,
757 // Path construction
758 m,
759 l,
760 c,
761 v,
762 y,
763 h,
764 re,
765 // Path painting
766 S,
767 s,
768 f,
769 F,
770 f_Star,
771 B,
772 B_Star,
773 b,
774 b_Star,
775 n,
776 // Clipping paths
777 W,
778 W_Star,
779 // Text objects
780 BT,
781 ET,
782 // Text state
783 Tc,
784 Tw,
785 Tz,
786 TL,
787 Tf,
788 Tr,
789 Ts,
790 // Text positioning
791 Td,
792 TD,
793 Tm,
794 T_Star,
795 // Text showing
796 Tj,
797 TJ,
798 Quote,
799 DoubleQuote,
800 // Type 3 fonts
801 d0,
802 d1,
803 // Color
804 CS,
805 cs,
806 SC,
807 SCN,
808 sc,
809 scn,
810 G,
811 g,
812 RG,
813 rg,
814 K,
815 k,
816 // Shading patterns
817 sh,
818 // Inline images
819 BI,
820 ID,
821 EI,
822 // XObjects
823 Do,
824 // Marked content
825 MP,
826 DP,
827 BMC,
828 BDC,
829 EMC,
830 // Compatibility
831 BX,
832 EX,
833};
834
839{
840 Unknown = 0,
841 AbsoluteColorimetric,
842 RelativeColorimetric,
843 Perceptual,
844 Saturation,
845};
846
851{
852 Unknown = 0,
853 Normal,
854 Multiply,
855 Screen,
856 Overlay,
857 Darken,
858 Lighten,
859 ColorDodge,
860 ColorBurn,
861 HardLight,
862 SoftLight,
863 Difference,
864 Exclusion,
865 Hue,
866 Saturation,
867 Color,
868 Luminosity,
869};
870
871enum class PdfSignatureType : uint8_t
872{
873 Unknown = 0,
874 PAdES_B = 1,
875 Pkcs7 = 2,
876};
877
878enum class PdfSignatureEncryption : uint8_t
879{
880 Unknown = 0,
881 RSA,
882 ECDSA,
883};
884
885enum class PdfHashingAlgorithm : uint8_t
886{
887 Unknown = 0,
888 SHA256,
889 SHA384,
890 SHA512,
891};
892
893using PdfFilterList = std::vector<PdfFilterType>;
894
895};
896
897ENABLE_BITMASK_OPERATORS(PoDoFo::PdfSaveOptions);
898ENABLE_BITMASK_OPERATORS(PoDoFo::PdfLoadOptions);
899ENABLE_BITMASK_OPERATORS(PoDoFo::PdfWriteFlags);
900ENABLE_BITMASK_OPERATORS(PoDoFo::PdfInfoInitial);
901ENABLE_BITMASK_OPERATORS(PoDoFo::PdfFontStyle);
902ENABLE_BITMASK_OPERATORS(PoDoFo::PdfFontCreateFlags);
903ENABLE_BITMASK_OPERATORS(PoDoFo::PdfFontAutoSelectBehavior);
904ENABLE_BITMASK_OPERATORS(PoDoFo::PdfFontMatchBehaviorFlags);
905ENABLE_BITMASK_OPERATORS(PoDoFo::PdfFontDescriptorFlags);
906ENABLE_BITMASK_OPERATORS(PoDoFo::PdfGlyphAccess);
907ENABLE_BITMASK_OPERATORS(PoDoFo::PdfTextExtractFlags);
908ENABLE_BITMASK_OPERATORS(PoDoFo::PdfAnnotationFlags);
909
940#endif // PDF_DECLARATIONS_H
Convenient type for char array storage and/or buffer with std::string compatibility.
Definition basetypes.h:35
All classes, functions, types and enums of PoDoFo are members of these namespace.
Definition basetypes.h:13
PdfLineJoinStyle
Enum for line join styles when drawing.
Definition PdfDeclarations.h:440
PdfPageLayout
Enum holding the supported of types of "PageLayouts" that define how Acrobat will display the pages i...
Definition PdfDeclarations.h:572
PdfAnnotationType
The type of the annotation.
Definition PdfDeclarations.h:610
PdfPageSize
Enum holding the supported page sizes by PoDoFo.
Definition PdfDeclarations.h:533
PdfPixelFormat
Definition PdfDeclarations.h:373
@ 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:419
@ 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:555
PdfGlyphAccess
When accessing a glyph, there may be a difference in the glyph ID to retrieve the widths or to index ...
Definition PdfDeclarations.h:321
@ 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:851
PdfFontFileType
Definition PdfDeclarations.h:294
@ 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:406
PdfDataType
Every PDF datatype that can occur in a PDF file is referenced by an own enum (e.g.
Definition PdfDeclarations.h:165
@ 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:467
@ 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.
@ IgnoreXRefErrors
This curently applies only during singing, and allows to sign documents with broken xref sections.
PdfRenderingIntent
List of defined Rendering intents.
Definition PdfDeclarations.h:839
PdfStringCharset
Definition PdfDeclarations.h:115
@ 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:665
constexpr PdfVersion PdfVersionDefault
The default PDF Version used by new PDF documents in PoDoFo.
Definition PdfDeclarations.h:85
PdfLoadOptions
Definition PdfDeclarations.h:505
@ 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:460
@ None
Do not add a default appearrance.
PdfExportFormat
Definition PdfDeclarations.h:239
@ Png
NOTE: Not yet supported.
PdfFontAutoSelectBehavior
Flags to control font creation.
Definition PdfDeclarations.h:329
@ 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:704
@ 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:147
@ 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:430
PdfHighlightingMode
The possible highlighting modes for a PdfField.
Definition PdfDeclarations.h:685
@ 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:197
@ ComputeBoundingBox
NOTE: Currently the bounding is inaccurate.
@ ExtractSubstring
NOTE: Extract the matched substring.
PdfFontCreateFlags
Font init flags.
Definition PdfDeclarations.h:338
@ 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:123
@ 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:648
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:224
@ 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:741
PdfFontStyle
Font style flags used during searches.
Definition PdfDeclarations.h:308
PdfTextRenderingMode
Enum for text rendering mode (Tr)
Definition PdfDeclarations.h:390
@ 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:284
@ CIDCFF
This is a "/CIDFontType0" font.
@ CIDTrueType
This is a "/CIDFontType2" font.
PdfColorSpaceType
Enum for the colorspaces supported by PDF.
Definition PdfDeclarations.h:357
PdfVerticalAlignment
Enum for vertical text alignment.
Definition PdfDeclarations.h:450
PdfFontDescriptorFlags
Enum for the font descriptor flags.
Definition PdfDeclarations.h:250
@ 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:55
@ Debug
Debug information.
@ Information
Information message.
PdfPredefinedEncodingType
Definition PdfDeclarations.h:130
@ 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:346
@ 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:69