Mako 9.0.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 #define GET_PDF_VERSION_MAJOR(pdfVersion) (((pdfVersion) >> 4) & 0x0f)
107 #define GET_PDF_VERSION_MINOR(pdfVersion) (((pdfVersion) >> 0) & 0x0f)
108
109 #define GET_PDF_VARIANT_TYPE(pdfVersion) (((pdfVersion) >> 20) & 0x0ff)
110 #define GET_PDF_VARIANT_VER(pdfVersion) (((pdfVersion) >> 16) & 0x00f)
111 #define GET_PDF_VARIANT_VERSUB(pdfVersion) (((pdfVersion) >> 8) & 0x0ff)
112
113 #define GET_PDFA_VERSION(pdfVersion) ( (GET_PDF_VARIANT_TYPE(pdfVersion) == 'A') ? GET_PDF_VARIANT_VER(pdfVersion) : 0)
114 #define GET_PDFX_VERSION(pdfVersion) ( (GET_PDF_VARIANT_TYPE(pdfVersion) == 'X') ? GET_PDF_VARIANT_VER(pdfVersion) : 0)
115
135
175 virtual void setVersion(ePDFVersion version) = 0;
176
192 virtual void setProducer(const U8String &producer) = 0;
193
227 virtual void setEnableIncrementalOutput(bool enable = true) = 0;
228
240 virtual void setLinearize(bool linearize = true) = 0;
241
282 virtual void setEncryption(uint32 keyLength, uint32 permissions, bool encryptMetadata = false,
283 const U8String &ownerPassword = "", const U8String &userPassword = "") = 0;
284
286 {
287 public:
290
291 bool operator== (const CPDFRecipientsInfo &other) const
292 {
293 return (other.certificates == certificates)
294 && (other.permissions == permissions);
295 }
296
297 bool operator!= (const CPDFRecipientsInfo &other) const
298 {
299 return ! (*this == other);
300 }
301 };
302
331 virtual void setPublicKeyEncryption(uint32 keyLength, const CEDLVector<CPDFRecipientsInfo> &recipients, bool encryptMetadata = false) = 0;
332
333
372 virtual void setTargetColorSpace(const IDOMColorSpacePtr &targetSpace) = 0;
373
389 virtual void setTargetProfile(const IDOMICCProfilePtr &profile) = 0;
390
407 virtual void setOutputIntent(const IOutputIntentPtr &outputIntent) = 0;
408
442 virtual void setOutputIntents(const COutputIntentVect &outputIntents) = 0;
443
460 virtual void setConvertAllColors(bool convert) = 0;
461
482 virtual void setConvertGray(bool convert) = 0;
483
504
525
547
564 virtual void setDownsampleMaskedImages(bool downsampleMaskedImages) = 0;
565
595 virtual void setUseMaskResolutionForMaskedImages(bool useMaskResolutionSettingForMaskedImages) = 0;
596
608 virtual void setRenderResolution(uint32 resolution) = 0;
609
622
640
659
677
694
710 virtual void setJPEGQuality(uint8 quality) = 0;
711
737 virtual void setJPEGChromaSubsampling(bool subsample) = 0;
738
754 virtual void setFlateCompressionLevel(uint8 compressionLevel) = 0;
755
771 virtual void setReencodeImages(bool reencode) = 0;
772
784 virtual void setCompressPages(bool compressPages) = 0;
785
803 virtual void setCompressObjects(bool compressObjects) = 0;
804
824 virtual void setAutoRotatePages(bool autoRotate) = 0;
825
840 virtual void setSubsetFonts(bool subset) = 0;
841
858 virtual void setEmbedFonts(bool embed) = 0;
859
876 virtual void setEmbedBase14Fonts(bool embed) = 0;
877
891 virtual void setAlwaysEmbedFonts(CU8StringVect &fontNames) = 0;
892
903 virtual void setNeverEmbedFonts(CU8StringVect &fontNames) = 0;
904
923 virtual void setAllowRestrictedFonts(bool allowRestrictedFonts) = 0;
924
951 virtual void setEmbedIdentityCidFonts(bool embed) = 0;
952
971 virtual void setEnableTrueTypeNotDef(bool enableTrueTypeNotDef) = 0;
972
986 virtual void setBlockNotdefGlyphs(bool blockNotdefGlyphs) = 0;
987
1011
1029 virtual void setForceEmitPageGroup(bool force) = 0;
1030
1045 virtual void setForceMediaBoxOriginZero(bool force) = 0;
1046
1067 virtual void overrideMaximumICCVersion(uint32 majorVersion, uint32 minorVersion) = 0;
1068
1108
1120 virtual void setDeviceNErrorHandling(uint32 flags) = 0;
1121
1137 typedef enum
1138 {
1140 // conformant output
1142 // either has no name or whose name clashes with another
1143 // configuration. If not set, configurations will be named
1144 // with a default value or edited on a clash
1146 // present, does not contain all the groups. If not set, any
1147 // groups missing from the order will be added to the end, in
1148 // a sub-group labelled "Additional Layers".
1150 // one or more Auto States. These are prohibited for PDF/X-4 and
1151 // PDF/A-2. If this flag is not set the auto state entries will
1152 // simply be dropped.
1154
1165
1181 typedef enum
1182 {
1185 // If not set, transfer functions will be silently dropped.
1187
1198
1232
1244
1259
1270
1278 virtual void setDefaultFormCJKLanguage(eFormCJKCharacterSet characterSet) = 0;
1279
1293 virtual void setRetainEmbeddedFiles(bool retainEmbeddedFiles) = 0;
1294
1308 virtual void setRetainClippedContent(bool retainClippedContent) = 0;
1309
1337 virtual void setAllowOptionalContentUpdateDuringWrite(bool allow) = 0;
1338
1357 virtual void setIgnoreXmp(bool ignore) = 0;
1358
1379 virtual void setValidateXmp(bool validate) = 0;
1380
1397 virtual void setOriginalFontEncoding(bool originalEncoding) = 0;
1398
1414 virtual void setMaxInFlightPages(uint32 maxInFlightPages) = 0;
1415
1416 };
1417 #define obj2IPDFOutput(obj) IPDFOutputPtr(dynamic_cast<IPDFOutput *>((IRCObject *) (obj)), true)
1418}
1419
1420#endif
1421
Definition edlvector.h:30
eDownsamplingMethod
The type of downsampling to be performed.
Definition idomimageresource.h:2065
@ eBicubic
Definition idomimageresource.h:2068
@ eSubsample
Definition idomimageresource.h:2066
Abstract output sink that can output DOM to a file or stream in a given output format.
Definition jawsmako.h:610
bool operator==(const CPDFRecipientsInfo &other) const
Definition pdfoutput.h:291
uint32 permissions
The permissions bit mask for the recipients (see IDOMStandardPDFSecurityInfo::ePermissionsFlags and I...
Definition pdfoutput.h:289
bool operator!=(const CPDFRecipientsInfo &other) const
Definition pdfoutput.h:297
CEDLVector< IRAInputStreamPtr > certificates
A stream containing the certificates of all the intended recipients sharing these permissions.
Definition pdfoutput.h:288
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:1182
@ ePEGSHFailOnTransferFunction
Throw an exception if a non-default transfer function is encountered.
Definition pdfoutput.h:1184
@ ePEGSHDefault
Default; makes a best-effort attempt to produce conformant output.
Definition pdfoutput.h:1183
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:120
@ ePDF1_7
PDF 1.7.
Definition pdfoutput.h:125
@ ePDFA1b
PDF/A-1b, based on PDF 1.4.
Definition pdfoutput.h:127
@ ePDF1_6
PDF 1.6.
Definition pdfoutput.h:124
@ ePDF1_5
PDF 1.5.
Definition pdfoutput.h:123
@ ePDFA2b
PDF/A-2b, based on PDF 1.7.
Definition pdfoutput.h:128
@ ePDF2_0
PDF 2.0 (EXPERIMENTAL)
Definition pdfoutput.h:126
@ ePDFX1a
PDF/X-1a:2003, based on PDF 1.4.
Definition pdfoutput.h:132
@ ePDF1_3
PDF 1.3.
Definition pdfoutput.h:121
@ ePDFA3b
PDF/A-3b, based on PDF 1.7.
Definition pdfoutput.h:129
@ ePDFX4
PDF/X-4, based on PDF 1.6.
Definition pdfoutput.h:133
@ ePDFUA
PDF/UA, based on PDF/A-2u.
Definition pdfoutput.h:131
@ ePDFA2u
PDF/A-2u, based on PDF 1.7.
Definition pdfoutput.h:130
@ ePDF1_4
PDF 1.4.
Definition pdfoutput.h:122
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:1138
@ ePOCHFailIfAutoStateFound
Throw an exception if an optional content configuration contains.
Definition pdfoutput.h:1149
@ ePOCHFailOnInvalidOrder
Throw if the Optional Content order information, if present.
Definition pdfoutput.h:1145
@ ePOCHDefault
Default; make a best effort attempt to produce.
Definition pdfoutput.h:1139
@ ePOCHFailOnInconsistentConfigurationName
Throw an exception if an optional content configuration.
Definition pdfoutput.h:1141
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:1085
@ ePDNHFailOnInconsistentColorantInformation
Definition pdfoutput.h:1090
@ ePDNFailOnNonUtf8ColorantName
Definition pdfoutput.h:1103
@ ePDNFailOnMismatchedDeviceNProcessSpace
Definition pdfoutput.h:1098
@ ePDNHFailOnMissingColorantInformation
Definition pdfoutput.h:1088
@ ePDNHDefault
Definition pdfoutput.h:1086
@ ePDNHFailIfBetterColorantInformationFoundAfterFirstUse
Definition pdfoutput.h:1092
@ ePDNHFailIfDotGainFound
Definition pdfoutput.h:1095
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:1227
@ ePAIHDefault
Default; see the comment above.
Definition pdfoutput.h:1228
@ ePAIHFailIfDefaultForPrintingFound
Throw an exception if an alternate image marked as default for printing is encountered.
Definition pdfoutput.h:1230
@ ePAIHFailIfAlternatesFound
Throw an exception if an alternate image is encountered.
Definition pdfoutput.h:1229
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:614
@ eICDCT
Jpeg.
Definition pdfoutput.h:617
@ eICLZW
LZW.
Definition pdfoutput.h:618
@ eICRLE
Run length encoding.
Definition pdfoutput.h:619
@ eICFlate
Flate (zip)
Definition pdfoutput.h:616
@ eICCCITT
CCITT Group 3 or 4.
Definition pdfoutput.h:620
@ eICAuto
Automatic selection of appropriate compression method.
Definition pdfoutput.h:615
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:1264
@ eFCSTraditionalChinese
Traditional Chinese character set.
Definition pdfoutput.h:1268
@ eFCSJapanese
Japanese character set.
Definition pdfoutput.h:1265
@ eFCSSimplifiedChinese
Simplified Chinese character set.
Definition pdfoutput.h:1267
@ eFCSKorean
Korean character set.
Definition pdfoutput.h:1266
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: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