Mako 8.4.0 API
MakoCore SDK API Documentation
Loading...
Searching...
No Matches
pdfoutput.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2014-2026 Hybrid Software Helix Ltd. All rights reserved.
3 */
4
5#ifndef JAWSMAKO_PDFOUTPUT_H
6#define JAWSMAKO_PDFOUTPUT_H
7
12
13#include <jawsmako/jawsmako.h>
14#include <jawsmako/transforms.h>
15
16namespace JawsMako
17{
18 using namespace EDL;
19
20 class IPDFOutput;
22
71 class IPDFOutput : public IOutput
72 {
73 public:
74 virtual ~IPDFOutput() {}
75
82 JAWSMAKO_API static IPDFOutputPtr create(const IJawsMakoPtr &jawsMako,
83 const IProgressMonitorPtr &progressMonitor = IProgressMonitorPtr ());
84
85 /*
86 * PDF Output-specific configuration
87 */
88
89 /* Bit positions for ePDFVersion so that we can store a PDF version number
90 * plus the flavor (like PDF/A or PDF/X). We use a total of 28 bits so it
91 * fits in a 32-bit int.
92 *
93 * (field:size) (offset)
94 * variantType:8 20
95 * variantVer:4 16
96 * variantVerSub:8 8
97 * verMajor:4 4
98 * verMinor:4 0
99 */
100
101 #define MAKE_PDF_VERSION(major,minor) ( ((major) << 4) | (minor) )
102 #define MAKE_PDF_VARIANT(variantType,variantVer,variantVerSub) ( ((variantType) << 20) | ((variantVer) << 16) | ((variantVerSub) << 8) )
103
104 #define GET_PDF_VERSION_MAJOR(pdfVersion) (((pdfVersion) >> 4) & 0x0f)
105 #define GET_PDF_VERSION_MINOR(pdfVersion) (((pdfVersion) >> 0) & 0x0f)
106
107 #define GET_PDF_VARIANT_TYPE(pdfVersion) (((pdfVersion) >> 20) & 0x0ff)
108 #define GET_PDF_VARIANT_VER(pdfVersion) (((pdfVersion) >> 16) & 0x00f)
109 #define GET_PDF_VARIANT_VERSUB(pdfVersion) (((pdfVersion) >> 8) & 0x0ff)
110
111 #define GET_PDFA_VERSION(pdfVersion) ( (GET_PDF_VARIANT_TYPE(pdfVersion) == 'A') ? GET_PDF_VARIANT_VER(pdfVersion) : 0)
112 #define GET_PDFX_VERSION(pdfVersion) ( (GET_PDF_VARIANT_TYPE(pdfVersion) == 'X') ? GET_PDF_VARIANT_VER(pdfVersion) : 0)
113
133
173 virtual void setVersion(ePDFVersion version) = 0;
174
190 virtual void setProducer(const U8String &producer) = 0;
191
225 virtual void setEnableIncrementalOutput(bool enable = true) = 0;
226
238 virtual void setLinearize(bool linearize = true) = 0;
239
280 virtual void setEncryption(uint32 keyLength, uint32 permissions, bool encryptMetadata = false,
281 const U8String &ownerPassword = "", const U8String &userPassword = "") = 0;
282
284 {
285 public:
288
289 bool operator== (const CPDFRecipientsInfo &other) const
290 {
291 return (other.certificates == certificates)
292 && (other.permissions == permissions);
293 }
294
295 bool operator!= (const CPDFRecipientsInfo &other) const
296 {
297 return ! (*this == other);
298 }
299 };
300
329 virtual void setPublicKeyEncryption(uint32 keyLength, const CEDLVector<CPDFRecipientsInfo> &recipients, bool encryptMetadata = false) = 0;
330
331
370 virtual void setTargetColorSpace(const IDOMColorSpacePtr &targetSpace) = 0;
371
387 virtual void setTargetProfile(const IDOMICCProfilePtr &profile) = 0;
388
405 virtual void setOutputIntent(const IOutputIntentPtr &outputIntent) = 0;
406
440 virtual void setOutputIntents(const COutputIntentVect &outputIntents) = 0;
441
458 virtual void setConvertAllColors(bool convert) = 0;
459
480 virtual void setConvertGray(bool convert) = 0;
481
502
523
545
562 virtual void setDownsampleMaskedImages(bool downsampleMaskedImages) = 0;
563
593 virtual void setUseMaskResolutionForMaskedImages(bool useMaskResolutionSettingForMaskedImages) = 0;
594
606 virtual void setRenderResolution(uint32 resolution) = 0;
607
620
638
657
675
692
708 virtual void setJPEGQuality(uint8 quality) = 0;
709
735 virtual void setJPEGChromaSubsampling(bool subsample) = 0;
736
752 virtual void setFlateCompressionLevel(uint8 compressionLevel) = 0;
753
769 virtual void setReencodeImages(bool reencode) = 0;
770
782 virtual void setCompressPages(bool compressPages) = 0;
783
801 virtual void setCompressObjects(bool compressObjects) = 0;
802
822 virtual void setAutoRotatePages(bool autoRotate) = 0;
823
838 virtual void setSubsetFonts(bool subset) = 0;
839
856 virtual void setEmbedFonts(bool embed) = 0;
857
874 virtual void setEmbedBase14Fonts(bool embed) = 0;
875
889 virtual void setAlwaysEmbedFonts(CU8StringVect &fontNames) = 0;
890
901 virtual void setNeverEmbedFonts(CU8StringVect &fontNames) = 0;
902
921 virtual void setAllowRestrictedFonts(bool allowRestrictedFonts) = 0;
922
949 virtual void setEmbedIdentityCidFonts(bool embed) = 0;
950
969 virtual void setEnableTrueTypeNotDef(bool enableTrueTypeNotDef) = 0;
970
984 virtual void setBlockNotdefGlyphs(bool blockNotdefGlyphs) = 0;
985
1009
1027 virtual void setForceEmitPageGroup(bool force) = 0;
1028
1043 virtual void setForceMediaBoxOriginZero(bool force) = 0;
1044
1065 virtual void overrideMaximumICCVersion(uint32 majorVersion, uint32 minorVersion) = 0;
1066
1106
1118 virtual void setDeviceNErrorHandling(uint32 flags) = 0;
1119
1135 typedef enum
1136 {
1138 // conformant output
1140 // either has no name or whose name clashes with another
1141 // configuration. If not set, configurations will be named
1142 // with a default value or edited on a clash
1144 // present, does not contain all the groups. If not set, any
1145 // groups missing from the order will be added to the end, in
1146 // a sub-group labelled "Additional Layers".
1148 // one or more Auto States. These are prohibited for PDF/X-4 and
1149 // PDF/A-2. If this flag is not set the auto state entries will
1150 // simply be dropped.
1152
1163
1179 typedef enum
1180 {
1183 // If not set, transfer functions will be silently dropped.
1185
1196
1230
1242
1257
1268
1276 virtual void setDefaultFormCJKLanguage(eFormCJKCharacterSet characterSet) = 0;
1277
1291 virtual void setRetainEmbeddedFiles(bool retainEmbeddedFiles) = 0;
1292
1306 virtual void setRetainClippedContent(bool retainClippedContent) = 0;
1307
1335 virtual void setAllowOptionalContentUpdateDuringWrite(bool allow) = 0;
1336
1355 virtual void setIgnoreXmp(bool ignore) = 0;
1356
1377 virtual void setValidateXmp(bool validate) = 0;
1378
1395 virtual void setOriginalFontEncoding(bool originalEncoding) = 0;
1396
1412 virtual void setMaxInFlightPages(uint32 maxInFlightPages) = 0;
1413
1414 };
1415 #define obj2IPDFOutput(obj) IPDFOutputPtr(dynamic_cast<IPDFOutput *>((IRCObject *) (obj)), true)
1416}
1417
1418#endif
1419
Definition edlvector.h:30
eDownsamplingMethod
The type of downsampling to be performed.
Definition idomimageresource.h:1938
@ eBicubic
Definition idomimageresource.h:1941
@ eSubsample
Definition idomimageresource.h:1939
Abstract output sink that can output DOM to a file or stream in a given output format.
Definition jawsmako.h:605
bool operator==(const CPDFRecipientsInfo &other) const
Definition pdfoutput.h:289
uint32 permissions
The permissions bit mask for the recipients (see IDOMStandardPDFSecurityInfo::ePermissionsFlags and I...
Definition pdfoutput.h:287
bool operator!=(const CPDFRecipientsInfo &other) const
Definition pdfoutput.h:295
CEDLVector< IRAInputStreamPtr > certificates
A stream containing the certificates of all the intended recipients sharing these permissions.
Definition pdfoutput.h:286
Interface for the PDF IOutput class.
Definition pdfoutput.h:72
virtual void setCompressPages(bool compressPages)=0
Set whether compression should be applied to page content. The default is true.
virtual ~IPDFOutput()
Definition pdfoutput.h:74
ePdfExtendedGraphicsStateHandling
Flags controlling PDF/X-4 and PDF/A-2 Extended Graphics State information.
Definition pdfoutput.h:1180
@ ePEGSHFailOnTransferFunction
Throw an exception if a non-default transfer function is encountered.
Definition pdfoutput.h:1182
@ ePEGSHDefault
Default; makes a best-effort attempt to produce conformant output.
Definition pdfoutput.h:1181
virtual void setPreferredRenderedImageCompression(eImageCompression compression)=0
Set the desired image compression for images that are the result of rendering. The default is eICFlat...
virtual void setRenderResolution(uint32 resolution)=0
Set the resolution to use if page content requires rendering in order to be output.
virtual void setGrayImageMaxResolution(float resolution, float threshold=0.0f, IDOMImageDownsamplerFilter::eDownsamplingMethod method=IDOMImageDownsamplerFilter::eBicubic)=0
Set the desired maximum resolution, threshold and downsampling method for gray images.
virtual void setOutputIntents(const COutputIntentVect &outputIntents)=0
Set a vector of output intents, or an empty vector to clear them.
virtual void setPreferredColorImageCompression(eImageCompression compression)=0
Set the desired image compression for color images that need to be re-encoded. The default is eICAuto...
virtual void setFlateCompressionLevel(uint8 compressionLevel)=0
Set the Flate compression level for any flate compression.
virtual void setNonUtf8InkNameFallbackEncoding(eInkFallbackEncoding fallbackEncoding)=0
Set the fallback encoding to use when attempting to decode non-UTF8 compatible ink names for PDF/A-2 ...
virtual void setEncryption(uint32 keyLength, uint32 permissions, bool encryptMetadata=false, const U8String &ownerPassword="", const U8String &userPassword="")=0
Set the encryption for the output PDF. The default is no encryption.
virtual void setForceEmitPageGroup(bool force)=0
Set whether the page group should be forcibly written.
virtual void setNeverEmbedFonts(CU8StringVect &fontNames)=0
Provide a list of name of fonts that should never be embedded, regardless of the settings for setEmbe...
virtual void setProducer(const U8String &producer)=0
Set the Producer name for the output PDF.
virtual void setConvertGray(bool convert)=0
Set whether gray colors should be subject to color conversion. That is, colors using DeviceGray,...
virtual void setEmbedBase14Fonts(bool embed)=0
Set whether the base 14 PDF fonts should be forcibly embedded. If true, this overrides the embedding ...
virtual void setPreferredGrayImageCompression(eImageCompression compression)=0
Set the desired image compression for gray images that need to be reencoded. The default is eICAuto.
ePDFVersion
Supported versions.
Definition pdfoutput.h:118
@ ePDF1_7
PDF 1.7.
Definition pdfoutput.h:123
@ ePDFA1b
PDF/A-1b, based on PDF 1.4.
Definition pdfoutput.h:125
@ ePDF1_6
PDF 1.6.
Definition pdfoutput.h:122
@ ePDF1_5
PDF 1.5.
Definition pdfoutput.h:121
@ ePDFA2b
PDF/A-2b, based on PDF 1.7.
Definition pdfoutput.h:126
@ ePDF2_0
PDF 2.0 (EXPERIMENTAL)
Definition pdfoutput.h:124
@ ePDFX1a
PDF/X-1a:2003, based on PDF 1.4.
Definition pdfoutput.h:130
@ ePDF1_3
PDF 1.3.
Definition pdfoutput.h:119
@ ePDFA3b
PDF/A-3b, based on PDF 1.7.
Definition pdfoutput.h:127
@ ePDFX4
PDF/X-4, based on PDF 1.6.
Definition pdfoutput.h:131
@ ePDFUA
PDF/UA, based on PDF/A-2u.
Definition pdfoutput.h:129
@ ePDFA2u
PDF/A-2u, based on PDF 1.7.
Definition pdfoutput.h:128
@ ePDF1_4
PDF 1.4.
Definition pdfoutput.h:120
virtual void setAllowOptionalContentUpdateDuringWrite(bool allow)=0
Allow updates to optional content to be made while the output is being written using an IOutputWriter...
virtual void setUseMaskResolutionForMaskedImages(bool useMaskResolutionSettingForMaskedImages)=0
Set whether the mask resolution setting should be applied to the image portion of a masked image.
ePdfOptionalContentHandling
Flags controlling PDF/X-4 and PDF/A-2 Optional content.
Definition pdfoutput.h:1136
@ ePOCHFailIfAutoStateFound
Throw an exception if an optional content configuration contains.
Definition pdfoutput.h:1147
@ ePOCHFailOnInvalidOrder
Throw if the Optional Content order information, if present.
Definition pdfoutput.h:1143
@ ePOCHDefault
Default; make a best effort attempt to produce.
Definition pdfoutput.h:1137
@ ePOCHFailOnInconsistentConfigurationName
Throw an exception if an optional content configuration.
Definition pdfoutput.h:1139
virtual void setPublicKeyEncryption(uint32 keyLength, const CEDLVector< CPDFRecipientsInfo > &recipients, bool encryptMetadata=false)=0
Use certificate/public-key encryption for the output PDF. The default is no encryption.
virtual void setColorImageMaxResolution(float resolution, float threshold=0.0f, IDOMImageDownsamplerFilter::eDownsamplingMethod method=IDOMImageDownsamplerFilter::eBicubic)=0
Set the desired maximum resolution, threshold and downsampling method for color images.
virtual void setRetainEmbeddedFiles(bool retainEmbeddedFiles)=0
Allow embedded files to be retained in PDF/A and PDF/X-4 output.
virtual void setEnableTrueTypeNotDef(bool enableTrueTypeNotDef)=0
Enable the use of a True Type font's /.notdef glyph in the output.
virtual void setTargetProfile(const IDOMICCProfilePtr &profile)=0
Set the target color space for the output using an ICC profile.
ePdfDeviceNHandling
Flags controlling PDF/X-4 and PDF/A-2 DeviceN handling.
Definition pdfoutput.h:1083
@ ePDNHFailOnInconsistentColorantInformation
Definition pdfoutput.h:1088
@ ePDNFailOnNonUtf8ColorantName
Definition pdfoutput.h:1101
@ ePDNFailOnMismatchedDeviceNProcessSpace
Definition pdfoutput.h:1096
@ ePDNHFailOnMissingColorantInformation
Definition pdfoutput.h:1086
@ ePDNHDefault
Definition pdfoutput.h:1084
@ ePDNHFailIfBetterColorantInformationFoundAfterFirstUse
Definition pdfoutput.h:1090
@ ePDNHFailIfDotGainFound
Definition pdfoutput.h:1093
virtual void setExtendedGraphicsStateErrorHandling(uint32 flags)=0
Set flags controlling PDF/X-4 and PDF/A-2 Extended Graphics State handling. See ePdfExtendedGraphicsS...
virtual void setRetainClippedContent(bool retainClippedContent)=0
Allow clipped out content to be retained in the output.
virtual void setMaxInFlightPages(uint32 maxInFlightPages)=0
Set the maximum number of simultaneously in-flight pages.
ePdfAlternateImageHandling
Flags controlling PDF/X-4 and PDF/A-2 alternate image handling.
Definition pdfoutput.h:1225
@ ePAIHDefault
Default; see the comment above.
Definition pdfoutput.h:1226
@ ePAIHFailIfDefaultForPrintingFound
Throw an exception if an alternate image marked as default for printing is encountered.
Definition pdfoutput.h:1228
@ ePAIHFailIfAlternatesFound
Throw an exception if an alternate image is encountered.
Definition pdfoutput.h:1227
virtual void setOriginalFontEncoding(bool originalEncoding)=0
Set whether to use the original font encoding, if specified.
virtual void setDeviceNErrorHandling(uint32 flags)=0
Set flags controlling PDF/X-4 and PDF/A-2 DeviceN handling. See ePdfDeviceNHandling for details.
virtual void setPreferredMonoImageCompression(eImageCompression compression)=0
Set the desired image compression for monochrome images that need to be re-encoded....
virtual void setSubsetFonts(bool subset)=0
Set whether embedded fonts should be subset or not. The default is true.
virtual void setAllowRestrictedFonts(bool allowRestrictedFonts)=0
Allow restricted fonts to be embedded in the output.
virtual void setJPEGQuality(uint8 quality)=0
Set the JPEG quality to use when compressing images in DCT format. Equivalent to calling setParameter...
eImageCompression
Enumeration for image compression formats.
Definition pdfoutput.h:612
@ eICDCT
Jpeg.
Definition pdfoutput.h:615
@ eICLZW
LZW.
Definition pdfoutput.h:616
@ eICRLE
Run length encoding.
Definition pdfoutput.h:617
@ eICFlate
Flate (zip)
Definition pdfoutput.h:614
@ eICCCITT
CCITT Group 3 or 4.
Definition pdfoutput.h:618
@ eICAuto
Automatic selection of appropriate compression method.
Definition pdfoutput.h:613
virtual void setOptionalContentErrorHandling(uint32 flags)=0
Set flags controlling PDF/X-4 and PDF/A-2 Optional Content handling. See ePdfOptionalContentHandling ...
virtual void setVersion(ePDFVersion version)=0
Set the PDF version to generate.
virtual void setEmbedFonts(bool embed)=0
Set whether fonts should be forcibly embedded. If true, this overrides the embedding settings in each...
virtual void setReencodeImages(bool reencode)=0
Set whether images should be re-encoded.
virtual void setAutoRotatePages(bool autoRotate)=0
Set whether pages should be automatically rotated. The default is false.
virtual void setEmit30CmapSubtableForSymbolicTrueTypeFonts(bool emit)=0
Set whether to add a 3,0 ("Windows") cmap subtable to symbolic TrueType fonts in PDF output.
virtual void setIgnoreXmp(bool ignore)=0
Set whether to ignore existing XMP metadata.
virtual void setBlockNotdefGlyphs(bool blockNotdefGlyphs)=0
Set whether to block notdef glyphs from PDF output.
virtual void setJPEGChromaSubsampling(bool subsample)=0
Set whether or not to use chroma subsampling when compressing color images in DCT/JPEG format.
virtual void setAlternateImageErrorHandling(uint32 flags)=0
Set flags controlling PDF/X-4 and PDF/A-2b alternate image handling See ePdfAlternateImageHandling fo...
virtual void setDownsampleMaskedImages(bool downsampleMaskedImages)=0
Set whether or not to downsample masked images.
virtual void setConvertAllColors(bool convert)=0
Set whether all content should be color converted to the target space set by setTargetColorSpace().
static JAWSMAKO_API IPDFOutputPtr create(const IJawsMakoPtr &jawsMako, const IProgressMonitorPtr &progressMonitor=IProgressMonitorPtr())
Create a PDF Output instance.
eFormCJKCharacterSet
A CJK character set.
Definition pdfoutput.h:1262
@ eFCSTraditionalChinese
Traditional Chinese character set.
Definition pdfoutput.h:1266
@ eFCSJapanese
Japanese character set.
Definition pdfoutput.h:1263
@ eFCSSimplifiedChinese
Simplified Chinese character set.
Definition pdfoutput.h:1265
@ eFCSKorean
Korean character set.
Definition pdfoutput.h:1264
virtual void setAlwaysEmbedFonts(CU8StringVect &fontNames)=0
Provide a list of name of fonts that should be always embedded, regardless of the settings for setEmb...
virtual void setValidateXmp(bool validate)=0
Validate XMP metadata.
virtual void setCompressObjects(bool compressObjects)=0
Set whether to compress individual objects.
virtual void overrideMaximumICCVersion(uint32 majorVersion, uint32 minorVersion)=0
Override the maximum allowed ICC profile version for PDF output.
virtual void setMonoImageMaxResolution(float resolution, float threshold=0.0f, IDOMImageDownsamplerFilter::eDownsamplingMethod method=IDOMImageDownsamplerFilter::eSubsample)=0
Set the desired maximum resolution, threshold and downsampling method for monochrome images.
virtual void setOutputIntent(const IOutputIntentPtr &outputIntent)=0
Set an explicit output intent, or NULL to clear it.
virtual void setDefaultFormCJKLanguage(eFormCJKCharacterSet characterSet)=0
Set the default CJK character set for forms. Used when generating form appearance streams,...
virtual void setEnableIncrementalOutput(bool enable=true)=0
Set whether incremental output should be enabled.
virtual void setLinearize(bool linearize=true)=0
Set whether the output should be linearized (made "web-ready").
virtual void setTargetColorSpace(const IDOMColorSpacePtr &targetSpace)=0
Set the target color space for the output.
virtual void setEmbedIdentityCidFonts(bool embed)=0
Set whether Identity CIDFonts should be embedded.
virtual void setForceMediaBoxOriginZero(bool force)=0
Set whether the media box origin should be set to 0,0 in the output.
unsigned int uint32
Definition edltypes.h:34
unsigned char uint8
Definition edltypes.h:32
EDLSysString U8String
A UTF-8 String.
Definition types.h:146
Definition apexcustompostprocess.h:17
EDL::IProgressMonitorPtr IProgressMonitorPtr
Definition types.h:87
CEDLSysStringVect CU8StringVect
Definition types.h:169
eInkFallbackEncoding
An enumeration of fallback encoding schemes to use for decoding PDF ink names that are not presented ...
Definition types.h:314
CEDLVector< IOutputIntentPtr > COutputIntentVect
Definition types.h:175
#define MAKE_PDF_VERSION(major, minor)
Definition pdfoutput.h:101
#define MAKE_PDF_VARIANT(variantType, variantVer, variantVerSub)
Definition pdfoutput.h:102
#define DECL_SMART_PTR(cls)
Definition smartptr.h:211
Transforms for JawsMako, allowing direct modification of individual brushes, nodes,...
#define JAWSMAKO_API
Definition types.h:29