PoDoFo 1.0.0-dev
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
500enum class PdfAdditionalMetadata : uint8_t
501{
502 PdfAIdAmd = 1,
503 PdfAIdCorr,
504 PdfAIdRev,
505 PdfUAIdAmd,
506 PdfUAIdCorr,
507 PdfUAIdRev,
508};
509
518{
519 Unknown = 0,
520 A0,
521 A1,
522 A2,
523 A3,
524 A4,
525 A5,
526 A6,
527 Letter,
528 Legal,
529 Tabloid,
530};
531
540{
541 UseNone = 1,
542 UseThumbs,
543 UseOutlines,
544 FullScreen,
545 UseOC,
546 UseAttachments
547};
548
557{
558 SinglePage = 1,
559 OneColumn,
560 TwoColumnLeft,
561 TwoColumnRight,
562 TwoPageLeft,
563 TwoPageRight
564};
565
566enum class PdfStandard14FontType : uint8_t
567{
568 Unknown = 0,
569 TimesRoman,
570 TimesItalic,
571 TimesBold,
572 TimesBoldItalic,
573 Helvetica,
574 HelveticaOblique,
575 HelveticaBold,
576 HelveticaBoldOblique,
577 Courier,
578 CourierOblique,
579 CourierBold,
580 CourierBoldOblique,
581 Symbol,
582 ZapfDingbats,
583};
584
595{
596 Unknown = 0,
597 Text, // - supported
598 Link, // - supported
599 FreeText, // PDF 1.3 // - supported
600 Line, // PDF 1.3 // - supported
601 Square, // PDF 1.3
602 Circle, // PDF 1.3
603 Polygon, // PDF 1.5
604 PolyLine, // PDF 1.5
605 Highlight, // PDF 1.3
606 Underline, // PDF 1.3
607 Squiggly, // PDF 1.4
608 StrikeOut, // PDF 1.3
609 Stamp, // PDF 1.3
610 Caret, // PDF 1.5
611 Ink, // PDF 1.3
612 Popup, // PDF 1.3 // - supported
613 FileAttachement,// PDF 1.3
614 Sound, // PDF 1.2
615 Movie, // PDF 1.2
616 Widget, // PDF 1.2 // - supported
617 Screen, // PDF 1.5
618 PrinterMark, // PDF 1.4
619 TrapNet, // PDF 1.3
620 Watermark, // PDF 1.6
621 Model3D, // PDF 1.6
622 RichMedia, // PDF 1.7 ADBE ExtensionLevel 3 ALX: Petr P. Petrov
623 WebMedia, // PDF 1.7 IPDF ExtensionLevel 3
624 Redact, // PDF 1.7
625 Projection, // PDF 2.0
626};
627
633{
634 None = 0x0000,
635 Invisible = 0x0001,
636 Hidden = 0x0002,
637 Print = 0x0004,
638 NoZoom = 0x0008,
639 NoRotate = 0x0010,
640 NoView = 0x0020,
641 ReadOnly = 0x0040,
642 Locked = 0x0080,
643 ToggleNoView = 0x0100,
644 LockedContents = 0x0200,
645};
646
650{
651 Unknown = 0,
652 PushButton,
653 CheckBox,
654 RadioButton,
655 TextBox,
656 ComboBox,
657 ListBox,
658 Signature,
659};
660
670{
671 Unknown = 0,
672 None,
673 Invert,
675 Push,
676};
677
678enum class PdfFieldFlags : uint8_t
679{
680 ReadOnly = 1,
681 Required = 2,
682 NoExport = 4
683};
684
689{
690 Normal = 0,
691 Rollover,
692 Down
693};
694
695enum class PdfResourceType : uint8_t
696{
697 Unknown = 0,
698 ExtGState,
699 ColorSpace,
700 Pattern,
701 Shading,
702 XObject,
703 Font,
704 Properties
705};
706
707enum class PdfKnownNameTree : uint8_t
708{
709 Unknown = 0,
710 Dests,
711 AP,
712 JavaScript,
713 Pages,
714 Templates,
715 IDS,
716 URLS,
717 EmbeddedFiles,
718 AlternatePresentations,
719 Renditions,
720};
721
726{
727 Unknown = 0,
728 // ISO 32008-1:2008 Table 51 – Operator Categories
729 // General graphics state
730 w,
731 J,
732 j,
733 M,
734 d,
735 ri,
736 i,
737 gs,
738 // Special graphics state
739 q,
740 Q,
741 cm,
742 // Path construction
743 m,
744 l,
745 c,
746 v,
747 y,
748 h,
749 re,
750 // Path painting
751 S,
752 s,
753 f,
754 F,
755 f_Star,
756 B,
757 B_Star,
758 b,
759 b_Star,
760 n,
761 // Clipping paths
762 W,
763 W_Star,
764 // Text objects
765 BT,
766 ET,
767 // Text state
768 Tc,
769 Tw,
770 Tz,
771 TL,
772 Tf,
773 Tr,
774 Ts,
775 // Text positioning
776 Td,
777 TD,
778 Tm,
779 T_Star,
780 // Text showing
781 Tj,
782 TJ,
783 Quote,
784 DoubleQuote,
785 // Type 3 fonts
786 d0,
787 d1,
788 // Color
789 CS,
790 cs,
791 SC,
792 SCN,
793 sc,
794 scn,
795 G,
796 g,
797 RG,
798 rg,
799 K,
800 k,
801 // Shading patterns
802 sh,
803 // Inline images
804 BI,
805 ID,
806 EI,
807 // XObjects
808 Do,
809 // Marked content
810 MP,
811 DP,
812 BMC,
813 BDC,
814 EMC,
815 // Compatibility
816 BX,
817 EX,
818};
819
824{
825 Unknown = 0,
826 AbsoluteColorimetric,
827 RelativeColorimetric,
828 Perceptual,
829 Saturation,
830};
831
836{
837 Unknown = 0,
838 Normal,
839 Multiply,
840 Screen,
841 Overlay,
842 Darken,
843 Lighten,
844 ColorDodge,
845 ColorBurn,
846 HardLight,
847 SoftLight,
848 Difference,
849 Exclusion,
850 Hue,
851 Saturation,
852 Color,
853 Luminosity,
854};
855
856enum class PdfSignatureType : uint8_t
857{
858 Unknown = 0,
859 PAdES_B = 1,
860 Pkcs7 = 2,
861};
862
863enum class PdfSignatureEncryption : uint8_t
864{
865 Unknown = 0,
866 RSA,
867};
868
869enum class PdfHashingAlgorithm : uint8_t
870{
871 Unknown = 0,
872 SHA256,
873 SHA384,
874 SHA512,
875};
876
877using PdfFilterList = std::vector<PdfFilterType>;
878
879};
880
881ENABLE_BITMASK_OPERATORS(PoDoFo::PdfSaveOptions);
882ENABLE_BITMASK_OPERATORS(PoDoFo::PdfWriteFlags);
883ENABLE_BITMASK_OPERATORS(PoDoFo::PdfInfoInitial);
884ENABLE_BITMASK_OPERATORS(PoDoFo::PdfFontStyle);
885ENABLE_BITMASK_OPERATORS(PoDoFo::PdfFontCreateFlags);
886ENABLE_BITMASK_OPERATORS(PoDoFo::PdfFontAutoSelectBehavior);
887ENABLE_BITMASK_OPERATORS(PoDoFo::PdfFontMatchBehaviorFlags);
888ENABLE_BITMASK_OPERATORS(PoDoFo::PdfFontDescriptorFlags);
889ENABLE_BITMASK_OPERATORS(PoDoFo::PdfGlyphAccess);
890ENABLE_BITMASK_OPERATORS(PoDoFo::PdfTextExtractFlags);
891ENABLE_BITMASK_OPERATORS(PoDoFo::PdfAnnotationFlags);
892
923#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:557
PdfAnnotationType
The type of the annotation.
Definition PdfDeclarations.h:595
PdfPageSize
Enum holding the supported page sizes by PoDoFo.
Definition PdfDeclarations.h:518
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:540
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:836
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:824
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:650
constexpr PdfVersion PdfVersionDefault
The default PDF Version used by new PDF documents in PoDoFo.
Definition PdfDeclarations.h:87
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:689
@ 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:670
@ 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:633
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:726
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 ...
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