PoDoFo 1.2.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
13
14 // Include some base macro definitions
15#include <podofo/auxiliary/basedefs.h>
16
17// Include common system headers
18#include <podofo/auxiliary/baseincludes.h>
19
20#include <podofo/auxiliary/Version.h>
21
22#define FORWARD_DECLARE_FCONFIG()\
23extern "C" {\
24 struct _FcConfig;\
25 typedef struct _FcConfig FcConfig;\
26}
27
28#define FORWARD_DECLARE_FREETYPE()\
29extern "C"\
30{\
31 struct FT_FaceRec_;\
32 typedef struct FT_FaceRec_* FT_Face;\
33}
34
43namespace PoDoFo {
44
49{
50 None = 0,
51 Error,
52 Warning,
54 Debug,
55};
56
57// Enums
58
60enum class PdfVersion : uint8_t
61{
62 Unknown = 0,
63 V1_0 = 10,
64 V1_1 = 11,
65 V1_2 = 12,
66 V1_3 = 13,
67 V1_4 = 14,
68 V1_5 = 15,
69 V1_6 = 16,
70 V1_7 = 17,
71 V2_0 = 20,
72};
73
77
78enum class PdfALevel : uint8_t
79{
80 Unknown = 0,
81 // ISO 19005-1:2005
82 L1B,
83 L1A,
84 // ISO 19005-2:2011
85 L2B,
86 L2A,
87 L2U,
88 // ISO 19005-3:2012
89 L3B,
90 L3A,
91 L3U,
92 // ISO 19005-4:2020
93 L4,
94 L4E,
95 L4F,
96};
97
98enum class PdfUALevel : uint8_t
99{
100 Unknown = 0,
101 L1, // ISO 14289-1:2014
102 L2, // ISO 14289-2:2024
103};
104
106{
107 Unknown = 0,
108 Ascii,
110 Unicode,
111};
112
114{
115 Indeterminate = 0,
116 Simple,
117 CMap
118};
119
127
128enum class PdfWModeKind : uint8_t
129{
130 Horizontal = 0,
131 Vertical = 1,
132};
133
136{
137 None = 0,
138 Clean = 1,
139 NoInlineLiteral = 2,
140 NoFlateCompress = 4,
141 PdfAPreserve = 8,
142 SkipDelimiters = 16,
143};
144
152{
153 Unknown = 0,
154 Bool,
155 Number,
156 Real,
157 String,
158 Name,
159 Array,
160 Dictionary,
161 Null,
162 Reference,
163 RawData,
164};
165
166enum class PdfTokenType : uint8_t
167{
168 Unknown = 0,
169 Literal,
170 ParenthesisLeft,
171 ParenthesisRight,
172 BraceLeft,
173 BraceRight,
174 AngleBracketLeft,
175 AngleBracketRight,
176 DoubleAngleBracketsLeft,
177 DoubleAngleBracketsRight,
178 SquareBracketLeft,
179 SquareBracketRight,
180 Slash,
181};
182
184{
185 None = 0,
186 IgnoreCase = 1,
187 KeepWhiteTokens = 2,
188 TokenizeWords = 4,
189 MatchWholeWord = 8,
190 RegexPattern = 16,
191 ComputeBoundingBox = 32,
192 RawCoordinates = 64,
193 ExtractSubstring = 128,
194};
195
196enum class PdfXObjectType : uint8_t
197{
198 Unknown = 0,
199 Form,
200 Image,
201 PostScript,
202};
203
209{
210 None = 0,
213 LZWDecode,
216 CCITTFaxDecode,
217 JBIG2Decode,
218 DCTDecode,
219 JPXDecode,
220 Crypt
221};
222
224{
225 Png = 1,
226 Jpeg = 2,
227};
228
233{
234 None = 0,
235 FixedPitch = 1 << 0,
236 Serif = 1 << 1,
237 Symbolic = 1 << 2,
238 Script = 1 << 3,
239 NonSymbolic = 1 << 5,
240 Italic = 1 << 6,
241 AllCap = 1 << 16,
242 SmallCap = 1 << 17,
243 ForceBold = 1 << 18,
244};
245
246enum class PdfFontStretch : uint8_t
247{
248 Unknown = 0,
249 UltraCondensed,
250 ExtraCondensed,
251 Condensed,
252 SemiCondensed,
253 Normal,
254 SemiExpanded,
255 Expanded,
256 ExtraExpanded,
257 UltraExpanded,
258};
259
266{
267 Unknown = 0,
268 Type1,
269 Type3,
270 TrueType,
271 CIDCFF,
273};
274
276{
277 // Table 126 – Embedded font organization for various font types
278 Unknown = 0,
279 Type1,
280 Type1CFF,
282 Type3,
283 TrueType,
285};
286
289{
290 None = 0,
291 Italic = 1,
292 Bold = 2,
293 // Alias to represent a font with regular style
294 Regular = None,
295};
296
301{
302 ReadMetrics = 1,
303 FontProgram = 2
304};
305
308{
309 None = 0,
310 Standard14 = 1,
311 Standard14Alt = 2,
312};
313
316{
317 None = 0,
318 DontEmbed = 1,
319 DontSubset = 2,
320 PreferNonCID = 4,
321};
322
329
333{
334 Unknown = 0,
335 DeviceGray,
336 DeviceRGB,
337 DeviceCMYK,
338 CalGray,
339 CalRGB,
340 Lab,
341 ICCBased,
342 Indexed,
343 Pattern,
344 Separation,
345 DeviceN
346};
347
349{
350 Unknown = 0,
351 Grayscale,
352 RGB24,
353 BGR24,
354 RGBA,
355 BGRA,
356 ARGB,
357 ABGR,
358};
359
374
378{
379 Solid = 1,
380 Dash,
381 Dot,
382 DashDot,
383 DashDotDot
384};
385
389{
390 None = 0,
393 WriteProducer = 4,
394};
395
398{
399 Butt = 0,
400 Round = 1,
401 Square = 2
402};
403
406{
407 Miter = 0,
408 Round = 1,
409 Bevel = 2
410};
411
414{
415 Top = 0,
416 Center = 1,
417 Bottom = 2
418};
419
422{
423 Left = 0,
424 Center = 1,
425 Right = 2
426};
427
429{
430 None = 0,
431 _Reserved1 = 1,
432 _Reserved2 = 2,
435 NoFlateCompress = 4,
436 NoCollectGarbage = 8,
443 NoMetadataUpdate = 16,
444 Clean = 32,
448 SaveOnSigning = 64,
449
452 IgnoreXRefErrors = 128,
453
456};
457
459{
460 None = 0,
462 StrictParsing = 1,
466 SkipXRefRecovery = 4,
467};
468
469enum class PdfAdditionalMetadata : uint8_t
470{
471 PdfAIdAmd = 1,
472 PdfAIdCorr,
473 PdfAIdRev,
474 PdfUAIdAmd,
475 PdfUAIdCorr,
476 PdfUAIdRev,
477};
478
485{
486 Unknown = 0,
487 A0,
488 A1,
489 A2,
490 A3,
491 A4,
492 A5,
493 A6,
494 Letter,
495 Legal,
496 Tabloid,
497};
498
505{
506 UseNone = 1,
507 UseThumbs,
508 UseOutlines,
509 FullScreen,
510 UseOC,
511 UseAttachments
512};
513
520{
521 SinglePage = 1,
522 OneColumn,
523 TwoColumnLeft,
524 TwoColumnRight,
525 TwoPageLeft,
526 TwoPageRight
527};
528
529enum class PdfStandard14FontType : uint8_t
530{
531 Unknown = 0,
532 TimesRoman,
533 TimesItalic,
534 TimesBold,
535 TimesBoldItalic,
536 Helvetica,
537 HelveticaOblique,
538 HelveticaBold,
539 HelveticaBoldOblique,
540 Courier,
541 CourierOblique,
542 CourierBold,
543 CourierBoldOblique,
544 Symbol,
545 ZapfDingbats,
546};
547
557{
558 Unknown = 0,
559 Text, // - supported
560 Link, // - supported
561 FreeText, // PDF 1.3 // - supported
562 Line, // PDF 1.3 // - supported
563 Square, // PDF 1.3
564 Circle, // PDF 1.3
565 Polygon, // PDF 1.5
566 PolyLine, // PDF 1.5
567 Highlight, // PDF 1.3
568 Underline, // PDF 1.3
569 Squiggly, // PDF 1.4
570 StrikeOut, // PDF 1.3
571 Stamp, // PDF 1.3
572 Caret, // PDF 1.5
573 Ink, // PDF 1.3
574 Popup, // PDF 1.3 // - supported
575 FileAttachement,// PDF 1.3
576 Sound, // PDF 1.2
577 Movie, // PDF 1.2
578 Widget, // PDF 1.2 // - supported
579 Screen, // PDF 1.5
580 PrinterMark, // PDF 1.4
581 TrapNet, // PDF 1.3
582 Watermark, // PDF 1.6
583 Model3D, // PDF 1.6
584 RichMedia, // PDF 1.7 ADBE ExtensionLevel 3 ALX: Petr P. Petrov
585 WebMedia, // PDF 1.7 IPDF ExtensionLevel 3
586 Redact, // PDF 1.7
587 Projection, // PDF 2.0
588};
589
594{
595 None = 0x0000,
596 Invisible = 0x0001,
597 Hidden = 0x0002,
598 Print = 0x0004,
599 NoZoom = 0x0008,
600 NoRotate = 0x0010,
601 NoView = 0x0020,
602 ReadOnly = 0x0040,
603 Locked = 0x0080,
604 ToggleNoView = 0x0100,
605 LockedContents = 0x0200,
606};
607
610{
611 Unknown = 0,
612 PushButton,
613 CheckBox,
614 RadioButton,
615 TextBox,
616 ComboBox,
617 ListBox,
618 Signature,
619};
620
629{
630 Unknown = 0,
631 None,
632 Invert,
634 Push,
635};
636
637enum class PdfFieldFlags : uint8_t
638{
639 ReadOnly = 1,
640 Required = 2,
641 NoExport = 4
642};
643
646{
647 Normal = 0,
648 Rollover,
649 Down
650};
651
652enum class PdfResourceType : uint8_t
653{
654 Unknown = 0,
655 ExtGState,
656 ColorSpace,
657 Pattern,
658 Shading,
659 XObject,
660 Font,
661 Properties
662};
663
664enum class PdfKnownNameTree : uint8_t
665{
666 Unknown = 0,
667 Dests,
668 AP,
669 JavaScript,
670 Pages,
671 Templates,
672 IDS,
673 URLS,
674 EmbeddedFiles,
675 AlternatePresentations,
676 Renditions,
677};
678
681{
682 Unknown = 0,
683 // ISO 32008-1:2008 Table 51 – Operator Categories
684 // General graphics state
685 w,
686 J,
687 j,
688 M,
689 d,
690 ri,
691 i,
692 gs,
693 // Special graphics state
694 q,
695 Q,
696 cm,
697 // Path construction
698 m,
699 l,
700 c,
701 v,
702 y,
703 h,
704 re,
705 // Path painting
706 S,
707 s,
708 f,
709 F,
710 f_Star,
711 B,
712 B_Star,
713 b,
714 b_Star,
715 n,
716 // Clipping paths
717 W,
718 W_Star,
719 // Text objects
720 BT,
721 ET,
722 // Text state
723 Tc,
724 Tw,
725 Tz,
726 TL,
727 Tf,
728 Tr,
729 Ts,
730 // Text positioning
731 Td,
732 TD,
733 Tm,
734 T_Star,
735 // Text showing
736 Tj,
737 TJ,
738 Quote,
739 DoubleQuote,
740 // Type 3 fonts
741 d0,
742 d1,
743 // Color
744 CS,
745 cs,
746 SC,
747 SCN,
748 sc,
749 scn,
750 G,
751 g,
752 RG,
753 rg,
754 K,
755 k,
756 // Shading patterns
757 sh,
758 // Inline images
759 BI,
760 ID,
761 EI,
762 // XObjects
763 Do,
764 // Marked content
765 MP,
766 DP,
767 BMC,
768 BDC,
769 EMC,
770 // Compatibility
771 BX,
772 EX,
773};
774
777{
778 Unknown = 0,
779 AbsoluteColorimetric,
780 RelativeColorimetric,
781 Perceptual,
782 Saturation,
783};
784
787{
788 Unknown = 0,
789 Normal,
790 Multiply,
791 Screen,
792 Overlay,
793 Darken,
794 Lighten,
795 ColorDodge,
796 ColorBurn,
797 HardLight,
798 SoftLight,
799 Difference,
800 Exclusion,
801 Hue,
802 Saturation,
803 Color,
804 Luminosity,
805};
806
807enum class PdfSignatureType : uint8_t
808{
809 Unknown = 0,
810 PAdES_B = 1,
811 Pkcs7 = 2,
812};
813
814enum class PdfSignatureEncryption : uint8_t
815{
816 Unknown = 0,
817 RSA,
818 ECDSA,
819};
820
821enum class PdfHashingAlgorithm : uint8_t
822{
823 Unknown = 0,
824 SHA256,
825 SHA384,
826 SHA512,
827};
828
829using PdfFilterList = std::vector<PdfFilterType>;
830
831};
832
833ENABLE_BITMASK_OPERATORS(PoDoFo::PdfSaveOptions);
834ENABLE_BITMASK_OPERATORS(PoDoFo::PdfLoadOptions);
835ENABLE_BITMASK_OPERATORS(PoDoFo::PdfWriteFlags);
836ENABLE_BITMASK_OPERATORS(PoDoFo::PdfInfoInitial);
837ENABLE_BITMASK_OPERATORS(PoDoFo::PdfFontStyle);
838ENABLE_BITMASK_OPERATORS(PoDoFo::PdfFontCreateFlags);
839ENABLE_BITMASK_OPERATORS(PoDoFo::PdfFontAutoSelectBehavior);
840ENABLE_BITMASK_OPERATORS(PoDoFo::PdfFontMatchBehaviorFlags);
841ENABLE_BITMASK_OPERATORS(PoDoFo::PdfFontDescriptorFlags);
842ENABLE_BITMASK_OPERATORS(PoDoFo::PdfGlyphAccess);
843ENABLE_BITMASK_OPERATORS(PoDoFo::PdfTextExtractFlags);
844ENABLE_BITMASK_OPERATORS(PoDoFo::PdfAnnotationFlags);
845
873
874#endif // PDF_DECLARATIONS_H
Convenient type for char array storage and/or buffer with std::string compatibility.
Definition basetypes.h:30
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:406
PdfPageLayout
Enum holding the supported of types of "PageLayouts" that define how Acrobat will display the pages i...
Definition PdfDeclarations.h:520
PdfAnnotationType
The type of the annotation.
Definition PdfDeclarations.h:557
PdfPageSize
Enum holding the supported page sizes by PoDoFo.
Definition PdfDeclarations.h:485
PdfPixelFormat
Definition PdfDeclarations.h:349
@ 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:389
@ 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:505
PdfGlyphAccess
When accessing a glyph, there may be a difference in the glyph ID to retrieve the widths or to index ...
Definition PdfDeclarations.h:301
@ 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:787
PdfFontFileType
Definition PdfDeclarations.h:276
@ 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:378
PdfDataType
Every PDF datatype that can occur in a PDF file is referenced by an own enum (e.g.
Definition PdfDeclarations.h:152
@ 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:429
@ 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 currently applies only during singing, and allows to sign documents with broken xref sections.
PdfRenderingIntent
List of defined Rendering intents.
Definition PdfDeclarations.h:777
PdfStringCharset
Definition PdfDeclarations.h:106
@ 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:610
constexpr PdfVersion PdfVersionDefault
The default PDF Version used by new PDF documents in PoDoFo.
Definition PdfDeclarations.h:76
PdfLoadOptions
Definition PdfDeclarations.h:459
@ 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:422
@ None
Do not add a default appearance.
PdfExportFormat
Definition PdfDeclarations.h:224
@ Png
NOTE: Not yet supported.
PdfFontAutoSelectBehavior
Flags to control font creation.
Definition PdfDeclarations.h:308
@ 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:646
@ 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:136
@ 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:398
PdfHighlightingMode
The possible highlighting modes for a PdfField.
Definition PdfDeclarations.h:629
@ 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:184
@ ComputeBoundingBox
NOTE: Currently the bounding is inaccurate.
@ ExtractSubstring
NOTE: Extract the matched substring.
PdfFontCreateFlags
Font init flags.
Definition PdfDeclarations.h:316
@ 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:114
@ 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:594
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:209
@ 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:681
PdfFontStyle
Font style flags used during searches.
Definition PdfDeclarations.h:289
PdfTextRenderingMode
Enum for text rendering mode (Tr)
Definition PdfDeclarations.h:364
@ 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:266
@ CIDCFF
This is a "/CIDFontType0" font.
@ CIDTrueType
This is a "/CIDFontType2" font.
PdfColorSpaceType
Enum for the colorspaces supported by PDF.
Definition PdfDeclarations.h:333
PdfVerticalAlignment
Enum for vertical text alignment.
Definition PdfDeclarations.h:414
PdfFontDescriptorFlags
Enum for the font descriptor flags.
Definition PdfDeclarations.h:233
@ 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:49
@ Debug
Debug information.
@ Information
Information message.
PdfPredefinedEncodingType
Definition PdfDeclarations.h:121
@ 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:324
@ 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:61