Mako 9.1.0 API
MakoCore SDK API Documentation
Loading...
Searching...
No Matches
pdfoutput.h
Go to the documentation of this file.
1/*
2 * pdfoutput.h
3 *
4 * Copyright (C) 2014-2026 Hybrid Software Helix Ltd. All rights reserved.
5 */
6
7#ifndef JAWSMAKO_PDFOUTPUT_H
8#define JAWSMAKO_PDFOUTPUT_H
9
14
15#include <jawsmako/jawsmako.h>
16#include <jawsmako/transforms.h>
17
18namespace JawsMako
19{
20 using namespace EDL;
21
22 class IPDFOutput;
24
73 class IPDFOutput : public IOutput
74 {
75 public:
76 virtual ~IPDFOutput() {}
77
84 JAWSMAKO_API static IPDFOutputPtr create(const IJawsMakoPtr &jawsMako,
85 const IProgressMonitorPtr &progressMonitor = IProgressMonitorPtr ());
86
87 /*
88 * PDF Output-specific configuration
89 */
90
91 /* Bit positions for ePDFVersion so that we can store a PDF version number
92 * plus the flavor (like PDF/A or PDF/X). We use a total of 28 bits so it
93 * fits in a 32-bit int.
94 *
95 * (field:size) (offset)
96 * variantType:8 20
97 * variantVer:4 16
98 * variantVerSub:8 8
99 * verMajor:4 4
100 * verMinor:4 0
101 */
102
103 #define MAKE_PDF_VERSION(major,minor) ( ((major) << 4) | (minor) )
104 #define MAKE_PDF_VARIANT(variantType,variantVer,variantVerSub) ( ((variantType) << 20) | ((variantVer) << 16) | ((variantVerSub) << 8) )
105
106 /* For extracting the version of the PDF Standard, this makes it easy to compare versions
107 * when used in conjunction with MAKE_PDF_VERSION() as they can both be treated as integers
108 */
109 #define GET_PDF_VERSION_STANDARD(pdfVersion) ((pdfVersion) & 0x00ff)
110
111 #define GET_PDF_VERSION_MAJOR(pdfVersion) (((pdfVersion) >> 4) & 0x0f)
112 #define GET_PDF_VERSION_MINOR(pdfVersion) (((pdfVersion) >> 0) & 0x0f)
113
114 #define GET_PDF_VARIANT_TYPE(pdfVersion) (((pdfVersion) >> 20) & 0x0ff)
115 #define GET_PDF_VARIANT_VER(pdfVersion) (((pdfVersion) >> 16) & 0x00f)
116 #define GET_PDF_VARIANT_VERSUB(pdfVersion) (((pdfVersion) >> 8) & 0x0ff)
117
118 #define GET_PDFA_VERSION(pdfVersion) ( (GET_PDF_VARIANT_TYPE(pdfVersion) == 'A') ? GET_PDF_VARIANT_VER(pdfVersion) : 0)
119 #define GET_PDFX_VERSION(pdfVersion) ( (GET_PDF_VARIANT_TYPE(pdfVersion) == 'X') ? GET_PDF_VARIANT_VER(pdfVersion) : 0)
120
140
180 virtual void setVersion(ePDFVersion version) = 0;
181
197 virtual void setProducer(const U8String &producer) = 0;
198
232 virtual void setEnableIncrementalOutput(bool enable = true) = 0;
233
245 virtual void setLinearize(bool linearize = true) = 0;
246
287 virtual void setEncryption(uint32 keyLength, uint32 permissions, bool encryptMetadata = false,
288 const U8String &ownerPassword = "", const U8String &userPassword = "") = 0;
289
291 {
292 public:
295
296 bool operator== (const CPDFRecipientsInfo &other) const
297 {
298 return (other.certificates == certificates)
299 && (other.permissions == permissions);
300 }
301
302 bool operator!= (const CPDFRecipientsInfo &other) const
303 {
304 return ! (*this == other);
305 }
306 };
307
336 virtual void setPublicKeyEncryption(uint32 keyLength, const CEDLVector<CPDFRecipientsInfo> &recipients, bool encryptMetadata = false) = 0;
337
338
377 virtual void setTargetColorSpace(const IDOMColorSpacePtr &targetSpace) = 0;
378
394 virtual void setTargetProfile(const IDOMICCProfilePtr &profile) = 0;
395
412 virtual void setOutputIntent(const IOutputIntentPtr &outputIntent) = 0;
413
447 virtual void setOutputIntents(const COutputIntentVect &outputIntents) = 0;
448
465 virtual void setConvertAllColors(bool convert) = 0;
466
487 virtual void setConvertGray(bool convert) = 0;
488
509
530
552
569 virtual void setDownsampleMaskedImages(bool downsampleMaskedImages) = 0;
570
600 virtual void setUseMaskResolutionForMaskedImages(bool useMaskResolutionSettingForMaskedImages) = 0;
601
613 virtual void setRenderResolution(uint32 resolution) = 0;
614
627
645
664
682
699
715 virtual void setJPEGQuality(uint8 quality) = 0;
716
742 virtual void setJPEGChromaSubsampling(bool subsample) = 0;
743
759 virtual void setFlateCompressionLevel(uint8 compressionLevel) = 0;
760
776 virtual void setReencodeImages(bool reencode) = 0;
777
802 virtual void setTransformChain(const ITransformChainPtr &transformChain,
803 bool alwaysApply = false) = 0;
804
816 virtual void setCompressPages(bool compressPages) = 0;
817
835 virtual void setCompressObjects(bool compressObjects) = 0;
836
856 virtual void setAutoRotatePages(bool autoRotate) = 0;
857
872 virtual void setSubsetFonts(bool subset) = 0;
873
890 virtual void setEmbedFonts(bool embed) = 0;
891
908 virtual void setEmbedBase14Fonts(bool embed) = 0;
909
923 virtual void setAlwaysEmbedFonts(CU8StringVect &fontNames) = 0;
924
935 virtual void setNeverEmbedFonts(CU8StringVect &fontNames) = 0;
936
955 virtual void setAllowRestrictedFonts(bool allowRestrictedFonts) = 0;
956
983 virtual void setEmbedIdentityCidFonts(bool embed) = 0;
984
1003 virtual void setEnableTrueTypeNotDef(bool enableTrueTypeNotDef) = 0;
1004
1018 virtual void setBlockNotdefGlyphs(bool blockNotdefGlyphs) = 0;
1019
1043
1061 virtual void setForceEmitPageGroup(bool force) = 0;
1062
1077 virtual void setForceMediaBoxOriginZero(bool force) = 0;
1078
1099 virtual void overrideMaximumICCVersion(uint32 majorVersion, uint32 minorVersion) = 0;
1100
1140
1152 virtual void setDeviceNErrorHandling(uint32 flags) = 0;
1153
1169 typedef enum
1170 {
1172 // conformant output
1174 // either has no name or whose name clashes with another
1175 // configuration. If not set, configurations will be named
1176 // with a default value or edited on a clash
1178 // present, does not contain all the groups. If not set, any
1179 // groups missing from the order will be added to the end, in
1180 // a sub-group labelled "Additional Layers".
1182 // one or more Auto States. These are prohibited for PDF/X-4 and
1183 // PDF/A-2. If this flag is not set the auto state entries will
1184 // simply be dropped.
1186
1197
1213 typedef enum
1214 {
1217 // If not set, transfer functions will be silently dropped.
1219
1230
1264
1276
1291
1302
1310 virtual void setDefaultFormCJKLanguage(eFormCJKCharacterSet characterSet) = 0;
1311
1325 virtual void setRetainEmbeddedFiles(bool retainEmbeddedFiles) = 0;
1326
1340 virtual void setRetainClippedContent(bool retainClippedContent) = 0;
1341
1369 virtual void setAllowOptionalContentUpdateDuringWrite(bool allow) = 0;
1370
1389 virtual void setIgnoreXmp(bool ignore) = 0;
1390
1411 virtual void setValidateXmp(bool validate) = 0;
1412
1429 virtual void setOriginalFontEncoding(bool originalEncoding) = 0;
1430
1446 virtual void setMaxInFlightPages(uint32 maxInFlightPages) = 0;
1447
1448 };
1449 #define obj2IPDFOutput(obj) IPDFOutputPtr(dynamic_cast<IPDFOutput *>((IRCObject *) (obj)), true)
1450}
1451
1452#endif
1453
Definition edlvector.h:31
eDownsamplingMethod
The type of downsampling to be performed.
Definition idomimageresource.h:2095
@ eBicubic
Definition idomimageresource.h:2098
@ eSubsample
Definition idomimageresource.h:2096
Abstract output sink that can output DOM to a file or stream in a given output format.
Definition jawsmako.h:611
bool operator==(const CPDFRecipientsInfo &other) const
Definition pdfoutput.h:296
uint32 permissions
The permissions bit mask for the recipients (see IDOMStandardPDFSecurityInfo::ePermissionsFlags and I...
Definition pdfoutput.h:294
bool operator!=(const CPDFRecipientsInfo &other) const
Definition pdfoutput.h:302
CEDLVector< IRAInputStreamPtr > certificates
A stream containing the certificates of all the intended recipients sharing these permissions.
Definition pdfoutput.h:293
Interface for the PDF IOutput class.
Definition pdfoutput.h:74
virtual void setCompressPages(bool compressPages)=0
Set whether compression should be applied to page content. The default is true.
virtual ~IPDFOutput()
Definition pdfoutput.h:76
ePdfExtendedGraphicsStateHandling
Flags controlling PDF/X-4 and PDF/A-2 Extended Graphics State information.
Definition pdfoutput.h:1214
@ ePEGSHFailOnTransferFunction
Throw an exception if a non-default transfer function is encountered.
Definition pdfoutput.h:1216
@ ePEGSHDefault
Default; makes a best-effort attempt to produce conformant output.
Definition pdfoutput.h:1215
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:125
@ ePDF1_7
PDF 1.7.
Definition pdfoutput.h:130
@ ePDFA1b
PDF/A-1b, based on PDF 1.4.
Definition pdfoutput.h:132
@ ePDF1_6
PDF 1.6.
Definition pdfoutput.h:129
@ ePDF1_5
PDF 1.5.
Definition pdfoutput.h:128
@ ePDFA2b
PDF/A-2b, based on PDF 1.7.
Definition pdfoutput.h:133
@ ePDF2_0
PDF 2.0 (EXPERIMENTAL)
Definition pdfoutput.h:131
@ ePDFX1a
PDF/X-1a:2003, based on PDF 1.4.
Definition pdfoutput.h:137
@ ePDF1_3
PDF 1.3.
Definition pdfoutput.h:126
@ ePDFA3b
PDF/A-3b, based on PDF 1.7.
Definition pdfoutput.h:134
@ ePDFX4
PDF/X-4, based on PDF 1.6.
Definition pdfoutput.h:138
@ ePDFUA
PDF/UA, based on PDF/A-2u.
Definition pdfoutput.h:136
@ ePDFA2u
PDF/A-2u, based on PDF 1.7.
Definition pdfoutput.h:135
@ ePDF1_4
PDF 1.4.
Definition pdfoutput.h:127
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:1170
@ ePOCHFailIfAutoStateFound
Throw an exception if an optional content configuration contains.
Definition pdfoutput.h:1181
@ ePOCHFailOnInvalidOrder
Throw if the Optional Content order information, if present.
Definition pdfoutput.h:1177
@ ePOCHDefault
Default; make a best effort attempt to produce.
Definition pdfoutput.h:1171
@ ePOCHFailOnInconsistentConfigurationName
Throw an exception if an optional content configuration.
Definition pdfoutput.h:1173
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:1117
@ ePDNHFailOnInconsistentColorantInformation
Definition pdfoutput.h:1122
@ ePDNFailOnNonUtf8ColorantName
Definition pdfoutput.h:1135
@ ePDNFailOnMismatchedDeviceNProcessSpace
Definition pdfoutput.h:1130
@ ePDNHFailOnMissingColorantInformation
Definition pdfoutput.h:1120
@ ePDNHDefault
Definition pdfoutput.h:1118
@ ePDNHFailIfBetterColorantInformationFoundAfterFirstUse
Definition pdfoutput.h:1124
@ ePDNHFailIfDotGainFound
Definition pdfoutput.h:1127
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:1259
@ ePAIHDefault
Default; see the comment above.
Definition pdfoutput.h:1260
@ ePAIHFailIfDefaultForPrintingFound
Throw an exception if an alternate image marked as default for printing is encountered.
Definition pdfoutput.h:1262
@ ePAIHFailIfAlternatesFound
Throw an exception if an alternate image is encountered.
Definition pdfoutput.h:1261
virtual void setOriginalFontEncoding(bool originalEncoding)=0
Set whether to use the original font encoding, if specified.
virtual void setTransformChain(const ITransformChainPtr &transformChain, bool alwaysApply=false)=0
Set an ITransformChain to be applied to incoming pages before the page is written,...
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:619
@ eICDCT
Jpeg.
Definition pdfoutput.h:622
@ eICLZW
LZW.
Definition pdfoutput.h:623
@ eICRLE
Run length encoding.
Definition pdfoutput.h:624
@ eICFlate
Flate (zip)
Definition pdfoutput.h:621
@ eICCCITT
CCITT Group 3 or 4.
Definition pdfoutput.h:625
@ eICAuto
Automatic selection of appropriate compression method.
Definition pdfoutput.h:620
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:1296
@ eFCSTraditionalChinese
Traditional Chinese character set.
Definition pdfoutput.h:1300
@ eFCSJapanese
Japanese character set.
Definition pdfoutput.h:1297
@ eFCSSimplifiedChinese
Simplified Chinese character set.
Definition pdfoutput.h:1299
@ eFCSKorean
Korean character set.
Definition pdfoutput.h:1298
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:36
unsigned char uint8
Definition edltypes.h:34
EDLSysString U8String
A UTF-8 String.
Definition types.h:150
Definition apexcustompostprocess.h:17
EDL::IProgressMonitorPtr IProgressMonitorPtr
Definition types.h:91
CEDLSysStringVect CU8StringVect
Definition types.h:173
eInkFallbackEncoding
An enumeration of fallback encoding schemes to use for decoding PDF ink names that are not presented ...
Definition types.h:318
CEDLVector< IOutputIntentPtr > COutputIntentVect
Definition types.h:179
#define MAKE_PDF_VERSION(major, minor)
Definition pdfoutput.h:103
#define MAKE_PDF_VARIANT(variantType, variantVer, variantVerSub)
Definition pdfoutput.h:104
#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