CGPDFContext.pas 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521
  1. { CoreGraphics - CGPDFContext.h
  2. Copyright (c) 2000-2011 Apple Inc.
  3. All rights reserved. }
  4. { Pascal Translation: Peter N Lewis, <[email protected]>, August 2005 }
  5. { Pascal Translation Updated: Jonas Maebe, <[email protected]>, October 2009 }
  6. { Pascal Translation Updated: Jonas Maebe, <[email protected]>, October 2012 }
  7. { Pascal Translation Updated: Jonas Maebe, <[email protected]>, August 2015 }
  8. {
  9. Modified for use with Free Pascal
  10. Version 308
  11. Please report any bugs to <[email protected]>
  12. }
  13. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  14. {$mode macpas}
  15. {$modeswitch cblocks}
  16. {$packenum 1}
  17. {$macro on}
  18. {$inline on}
  19. {$calling mwpascal}
  20. unit CGPDFContext;
  21. interface
  22. {$setc UNIVERSAL_INTERFACES_VERSION := $0400}
  23. {$setc GAP_INTERFACES_VERSION := $0308}
  24. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  25. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  26. {$endc}
  27. {$ifc defined CPUPOWERPC and defined CPUI386}
  28. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  29. {$endc}
  30. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  31. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  32. {$endc}
  33. {$ifc not defined __ppc__ and defined CPUPOWERPC32}
  34. {$setc __ppc__ := 1}
  35. {$elsec}
  36. {$setc __ppc__ := 0}
  37. {$endc}
  38. {$ifc not defined __ppc64__ and defined CPUPOWERPC64}
  39. {$setc __ppc64__ := 1}
  40. {$elsec}
  41. {$setc __ppc64__ := 0}
  42. {$endc}
  43. {$ifc not defined __i386__ and defined CPUI386}
  44. {$setc __i386__ := 1}
  45. {$elsec}
  46. {$setc __i386__ := 0}
  47. {$endc}
  48. {$ifc not defined __x86_64__ and defined CPUX86_64}
  49. {$setc __x86_64__ := 1}
  50. {$elsec}
  51. {$setc __x86_64__ := 0}
  52. {$endc}
  53. {$ifc not defined __arm__ and defined CPUARM}
  54. {$setc __arm__ := 1}
  55. {$elsec}
  56. {$setc __arm__ := 0}
  57. {$endc}
  58. {$ifc not defined __arm64__ and defined CPUAARCH64}
  59. {$setc __arm64__ := 1}
  60. {$elsec}
  61. {$setc __arm64__ := 0}
  62. {$endc}
  63. {$ifc defined cpu64}
  64. {$setc __LP64__ := 1}
  65. {$elsec}
  66. {$setc __LP64__ := 0}
  67. {$endc}
  68. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  69. {$error Conflicting definitions for __ppc__ and __i386__}
  70. {$endc}
  71. {$ifc defined __ppc__ and __ppc__}
  72. {$setc TARGET_CPU_PPC := TRUE}
  73. {$setc TARGET_CPU_PPC64 := FALSE}
  74. {$setc TARGET_CPU_X86 := FALSE}
  75. {$setc TARGET_CPU_X86_64 := FALSE}
  76. {$setc TARGET_CPU_ARM := FALSE}
  77. {$setc TARGET_CPU_ARM64 := FALSE}
  78. {$setc TARGET_OS_MAC := TRUE}
  79. {$setc TARGET_OS_IPHONE := FALSE}
  80. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  81. {$setc TARGET_OS_EMBEDDED := FALSE}
  82. {$elifc defined __ppc64__ and __ppc64__}
  83. {$setc TARGET_CPU_PPC := FALSE}
  84. {$setc TARGET_CPU_PPC64 := TRUE}
  85. {$setc TARGET_CPU_X86 := FALSE}
  86. {$setc TARGET_CPU_X86_64 := FALSE}
  87. {$setc TARGET_CPU_ARM := FALSE}
  88. {$setc TARGET_CPU_ARM64 := FALSE}
  89. {$setc TARGET_OS_MAC := TRUE}
  90. {$setc TARGET_OS_IPHONE := FALSE}
  91. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  92. {$setc TARGET_OS_EMBEDDED := FALSE}
  93. {$elifc defined __i386__ and __i386__}
  94. {$setc TARGET_CPU_PPC := FALSE}
  95. {$setc TARGET_CPU_PPC64 := FALSE}
  96. {$setc TARGET_CPU_X86 := TRUE}
  97. {$setc TARGET_CPU_X86_64 := FALSE}
  98. {$setc TARGET_CPU_ARM := FALSE}
  99. {$setc TARGET_CPU_ARM64 := FALSE}
  100. {$ifc defined iphonesim}
  101. {$setc TARGET_OS_MAC := FALSE}
  102. {$setc TARGET_OS_IPHONE := TRUE}
  103. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  104. {$elsec}
  105. {$setc TARGET_OS_MAC := TRUE}
  106. {$setc TARGET_OS_IPHONE := FALSE}
  107. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  108. {$endc}
  109. {$setc TARGET_OS_EMBEDDED := FALSE}
  110. {$elifc defined __x86_64__ and __x86_64__}
  111. {$setc TARGET_CPU_PPC := FALSE}
  112. {$setc TARGET_CPU_PPC64 := FALSE}
  113. {$setc TARGET_CPU_X86 := FALSE}
  114. {$setc TARGET_CPU_X86_64 := TRUE}
  115. {$setc TARGET_CPU_ARM := FALSE}
  116. {$setc TARGET_CPU_ARM64 := FALSE}
  117. {$ifc defined iphonesim}
  118. {$setc TARGET_OS_MAC := FALSE}
  119. {$setc TARGET_OS_IPHONE := TRUE}
  120. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  121. {$elsec}
  122. {$setc TARGET_OS_MAC := TRUE}
  123. {$setc TARGET_OS_IPHONE := FALSE}
  124. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  125. {$endc}
  126. {$setc TARGET_OS_EMBEDDED := FALSE}
  127. {$elifc defined __arm__ and __arm__}
  128. {$setc TARGET_CPU_PPC := FALSE}
  129. {$setc TARGET_CPU_PPC64 := FALSE}
  130. {$setc TARGET_CPU_X86 := FALSE}
  131. {$setc TARGET_CPU_X86_64 := FALSE}
  132. {$setc TARGET_CPU_ARM := TRUE}
  133. {$setc TARGET_CPU_ARM64 := FALSE}
  134. {$setc TARGET_OS_MAC := FALSE}
  135. {$setc TARGET_OS_IPHONE := TRUE}
  136. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  137. {$setc TARGET_OS_EMBEDDED := TRUE}
  138. {$elifc defined __arm64__ and __arm64__}
  139. {$setc TARGET_CPU_PPC := FALSE}
  140. {$setc TARGET_CPU_PPC64 := FALSE}
  141. {$setc TARGET_CPU_X86 := FALSE}
  142. {$setc TARGET_CPU_X86_64 := FALSE}
  143. {$setc TARGET_CPU_ARM := FALSE}
  144. {$setc TARGET_CPU_ARM64 := TRUE}
  145. {$ifc defined ios}
  146. {$setc TARGET_OS_MAC := FALSE}
  147. {$setc TARGET_OS_IPHONE := TRUE}
  148. {$setc TARGET_OS_EMBEDDED := TRUE}
  149. {$elsec}
  150. {$setc TARGET_OS_MAC := TRUE}
  151. {$setc TARGET_OS_IPHONE := FALSE}
  152. {$setc TARGET_OS_EMBEDDED := FALSE}
  153. {$endc}
  154. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  155. {$elsec}
  156. {$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ nor __arm64__ is defined.}
  157. {$endc}
  158. {$ifc defined __LP64__ and __LP64__ }
  159. {$setc TARGET_CPU_64 := TRUE}
  160. {$elsec}
  161. {$setc TARGET_CPU_64 := FALSE}
  162. {$endc}
  163. {$ifc defined FPC_BIG_ENDIAN}
  164. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  165. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  166. {$elifc defined FPC_LITTLE_ENDIAN}
  167. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  168. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  169. {$elsec}
  170. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  171. {$endc}
  172. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  173. {$setc CALL_NOT_IN_CARBON := FALSE}
  174. {$setc OLDROUTINENAMES := FALSE}
  175. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  176. {$setc OPAQUE_UPP_TYPES := TRUE}
  177. {$setc OTCARBONAPPLICATION := TRUE}
  178. {$setc OTKERNEL := FALSE}
  179. {$setc PM_USE_SESSION_APIS := TRUE}
  180. {$setc TARGET_API_MAC_CARBON := TRUE}
  181. {$setc TARGET_API_MAC_OS8 := FALSE}
  182. {$setc TARGET_API_MAC_OSX := TRUE}
  183. {$setc TARGET_CARBON := TRUE}
  184. {$setc TARGET_CPU_68K := FALSE}
  185. {$setc TARGET_CPU_MIPS := FALSE}
  186. {$setc TARGET_CPU_SPARC := FALSE}
  187. {$setc TARGET_OS_UNIX := FALSE}
  188. {$setc TARGET_OS_WIN32 := FALSE}
  189. {$setc TARGET_RT_MAC_68881 := FALSE}
  190. {$setc TARGET_RT_MAC_CFM := FALSE}
  191. {$setc TARGET_RT_MAC_MACHO := TRUE}
  192. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  193. {$setc TYPE_BOOL := FALSE}
  194. {$setc TYPE_EXTENDED := FALSE}
  195. {$setc TYPE_LONGLONG := TRUE}
  196. uses MacTypes,CGGeometry,CFBase,CFData,CFDictionary,CFURL,CGBase,CGContext,CGDataConsumer;
  197. {$endc} {not MACOSALLINCLUDE}
  198. {$ALIGN POWER}
  199. { Create a PDF context, using `consumer' for output. `mediaBox' is the
  200. default page media bounding box; if NULL, then a default page size is
  201. used. `auxiliaryInfo' specifies additional information used by the PDF
  202. context when generating the PDF file. The keys and values in
  203. `auxiliaryInfo' are described below. If `mediaBox' is non-NULL, then its
  204. value overrides the value of `kCGPDFContextMediaBox' if specified in the
  205. `auxiliaryInfo' dictionary. }
  206. function CGPDFContextCreate( consumer: CGDataConsumerRef; const (*var*) mediaBox: CGRect; auxiliaryInfo: CFDictionaryRef ): CGContextRef; external name '_CGPDFContextCreate';
  207. (* CG_AVAILABLE_STARTING(__MAC_10_0, __IPHONE_2_0) *)
  208. { Create a PDF context for writing to `url'. This function behaves in the
  209. same manner as the above function, except that the output data will be
  210. written to `url'. }
  211. function CGPDFContextCreateWithURL( url: CFURLRef; const (*var*) mediaBox: CGRect; auxiliaryInfo: CFDictionaryRef ): CGContextRef; external name '_CGPDFContextCreateWithURL';
  212. (* CG_AVAILABLE_STARTING(__MAC_10_0, __IPHONE_2_0) *)
  213. { Close a PDF context. After closing the context, all pending data is
  214. written to the context's destination, and the PDF file is completed. No
  215. additional data will be written to the context's destionation after
  216. closing. }
  217. procedure CGPDFContextClose( context: CGContextRef ); external name '_CGPDFContextClose';
  218. (* CG_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0) *)
  219. { Begin a new page in the PDF context `context'. }
  220. procedure CGPDFContextBeginPage( context: CGContextRef; pageInfo: CFDictionaryRef ); external name '_CGPDFContextBeginPage';
  221. (* CG_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) *)
  222. { End the current page in the PDF context `context'. }
  223. procedure CGPDFContextEndPage( context: CGContextRef ); external name '_CGPDFContextEndPage';
  224. (* CG_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) *)
  225. { Add the metadata stream specified by `metadata' to the document catalog
  226. of `context', as described in Table 3.25, "Entries in the catalog
  227. dictionary", of the PDF 1.7 specification. The contents of metadata must
  228. be XML formatted according to the Extensible Metadata Platform, as
  229. described in section 10.2.2, "Metadata Streams", of the PDF 1.7
  230. specification. }
  231. procedure CGPDFContextAddDocumentMetadata( context: CGContextRef; metadata: CFDataRef ); external name '_CGPDFContextAddDocumentMetadata';
  232. (* CG_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_0) *)
  233. { Set the URL associated with `rect' to `url' in the PDF context
  234. `context'. }
  235. procedure CGPDFContextSetURLForRect( context: CGContextRef; url: CFURLRef; rect: CGRect ); external name '_CGPDFContextSetURLForRect';
  236. (* CG_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) *)
  237. { Create a PDF destination named `name' at `point' in the current page of
  238. the PDF context `context'. }
  239. procedure CGPDFContextAddDestinationAtPoint( context: CGContextRef; name: CFStringRef; point: CGPoint ); external name '_CGPDFContextAddDestinationAtPoint';
  240. (* CG_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) *)
  241. { Specify a destination named `name' to jump to when clicking in `rect' of
  242. the current page of the PDF context `context'. }
  243. procedure CGPDFContextSetDestinationForRect( context: CGContextRef; name: CFStringRef; rect: CGRect ); external name '_CGPDFContextSetDestinationForRect';
  244. (* CG_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) *)
  245. {** Keys for the auxiliary info dictionary or the page info dictionary. **}
  246. { The media box for the document or for a given page. Optional; if present,
  247. the value of this key must be a CFData containing a CGRect (stored by
  248. value, not by reference). }
  249. var kCGPDFContextMediaBox: CFStringRef; external name '_kCGPDFContextMediaBox'; (* attribute const *)
  250. (* CG_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) *)
  251. { The crop box for the document or for a given page. Optional; if present,
  252. the value of this key must be a CFData containing a CGRect (stored by
  253. value, not by reference). }
  254. var kCGPDFContextCropBox: CFStringRef; external name '_kCGPDFContextCropBox'; (* attribute const *)
  255. (* CG_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) *)
  256. { The bleed box for the document or for a given page. Optional; if present,
  257. the value of this key must be a CFData containing a CGRect (stored by
  258. value, not by reference). }
  259. var kCGPDFContextBleedBox: CFStringRef; external name '_kCGPDFContextBleedBox'; (* attribute const *)
  260. (* CG_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) *)
  261. { The trim box for the document or for a given page. Optional; if present,
  262. the value of this key must be a CFData containing a CGRect (stored by
  263. value, not by reference). }
  264. var kCGPDFContextTrimBox: CFStringRef; external name '_kCGPDFContextTrimBox'; (* attribute const *)
  265. (* CG_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) *)
  266. { The art box for the document or for a given page. Optional; if present,
  267. the value of this key must be a CFData containing a CGRect (stored by
  268. value, not by reference). }
  269. var kCGPDFContextArtBox: CFStringRef; external name '_kCGPDFContextArtBox'; (* attribute const *)
  270. (* CG_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) *)
  271. {** Keys for auxiliary info dictionary. **}
  272. { The document's title. Optional; if present, the value of this key must be
  273. a CFString. }
  274. //const kCGPDFContextTitle: CFStringRef;
  275. //CG_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0);
  276. { The name of the person who created this document. Optional; if present,
  277. the value of this key must be a CFString. }
  278. //const kCGPDFContextAuthor: CFStringRef;
  279. //CG_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0);
  280. { The subject of a document. Optional; if present, the value of this key
  281. must be a CFString. }
  282. var kCGPDFContextSubject: CFStringRef; external name '_kCGPDFContextSubject'; (* attribute const *)
  283. (* CG_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0) *)
  284. { The keywords for this document. This key is optional. If the value of
  285. this key is a CFString, the /Keywords entry will be the specified string.
  286. If the value of this key is a CFArray, then it must be an array of
  287. CFStrings. The /Keywords entry will in this case be the concatenation of
  288. the specified strings separated by commas (","). In addition, an entry
  289. with the key "/AAPL:Keywords" will be stored in the document information
  290. dictionary; its value is an array consisting of each of the specified
  291. strings. The value of this key must be in one of the above forms;
  292. otherwise, this key is ignored. }
  293. var kCGPDFContextKeywords: CFStringRef; external name '_kCGPDFContextKeywords'; (* attribute const *)
  294. (* CG_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0) *)
  295. { The name of the application that created the original data used to create
  296. this document. Optional; if present, the value of this key must be a
  297. CFString. }
  298. //const kCGPDFContextCreator: CFStringRef;
  299. //CG_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0);
  300. { The "owner password" of the PDF document. If this key is specified, the
  301. document will be encrypted using the value as the owner password;
  302. otherwise, the document will not be encrypted. The value of this key must
  303. be a CFStringRef which can be represented in ASCII encoding; only the
  304. first 32 bytes will be used for the password. There is no default value
  305. for this key.
  306. If the value of this key cannot be represented in ASCII, the document
  307. will not be created and the creation function will return NULL. }
  308. var kCGPDFContextOwnerPassword: CFStringRef; external name '_kCGPDFContextOwnerPassword'; (* attribute const *)
  309. (* CG_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) *)
  310. { The "user password" of the PDF document. If the document is encrypted,
  311. then the value of this key will be the user password for the document; if
  312. unspecified, the user password will be the empty string. The value of
  313. this key must be a CFStringRef which can be represented in ASCII
  314. encoding; only the first 32 bytes will be used for the password.
  315. If the value of this key cannot be represented in ASCII, the document
  316. will not be created and the creation function will return NULL. }
  317. var kCGPDFContextUserPassword: CFStringRef; external name '_kCGPDFContextUserPassword'; (* attribute const *)
  318. (* CG_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) *)
  319. { Specifies the encryption key length in bits; see Table 3.18 "Entries
  320. common to all encryption dictionaries", PDF Reference: Adobe PDF version
  321. 1.5 (4th ed.) for more info. Optional; if present, the value of this key
  322. must be a CFNumber with value which is a multiple of 8 between 40 and
  323. 128, inclusive. If this key is absent or invalid, the encryption key
  324. length defaults to 40 bits. }
  325. var kCGPDFContextEncryptionKeyLength: CFStringRef; external name '_kCGPDFContextEncryptionKeyLength'; (* attribute const *)
  326. (* CG_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0) *)
  327. { Used to specify whether the document allows printing when unlocked with
  328. the user password. The value of this key must be a CFBooleanRef. The
  329. default value of this key is "kCFBooleanTrue". }
  330. var kCGPDFContextAllowsPrinting: CFStringRef; external name '_kCGPDFContextAllowsPrinting'; (* attribute const *)
  331. (* CG_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) *)
  332. { Used to specify whether the document allows copying when unlocked with
  333. the user password. The value of this key must be a CFBooleanRef. The
  334. default value of this key is "kCFBooleanTrue". }
  335. var kCGPDFContextAllowsCopying: CFStringRef; external name '_kCGPDFContextAllowsCopying'; (* attribute const *)
  336. (* CG_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0) *)
  337. {$ifc TARGET_OS_MAC}
  338. { The document's PDF/X output intent. Optional; if present, the value of
  339. this key must be a CFDictionaryRef. The dictionary is added to the
  340. /OutputIntents entry in the PDF file's document catalog. The keys and
  341. values contained in the dictionary must match those specified in section
  342. 9.10.4 of the PDF 1.4 specification, ISO/DIS 15930-3 document published
  343. by ISO/TC 130, and Adobe Technical Note #5413. }
  344. //const kCGPDFContextOutputIntent: CFStringRef;
  345. //CG_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_NA);
  346. { The following keys are supported in the output intent dictionary:
  347. kCGPDFXOutputIntentSubtype ("S"): The output intent subtype. This key is
  348. required; the value of this key must be a CFString equal to "GTS_PDFX";
  349. otherwise, the dictionary is ignored. }
  350. var kCGPDFXOutputIntentSubtype: CFStringRef; external name '_kCGPDFXOutputIntentSubtype'; (* attribute const *)
  351. (* CG_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_NA) *)
  352. { kCGPDFXOutputConditionIdentifier ("OutputConditionIdentifier"): A string
  353. identifying the intended output device or production condition in a
  354. human- or machine-readable form. This key is required; the value of this
  355. key must be a CFString. For best results, the string should be
  356. representable losslessly in ASCII encoding. }
  357. var kCGPDFXOutputConditionIdentifier: CFStringRef; external name '_kCGPDFXOutputConditionIdentifier'; (* attribute const *)
  358. (* CG_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_NA) *)
  359. { kCGPDFXOutputCondition ("OutputCondition"): A text string identifying the
  360. intended output device or production condition in a human-readable form.
  361. This key is optional; if present, the value of this key must be a
  362. CFString. }
  363. var kCGPDFXOutputCondition: CFStringRef; external name '_kCGPDFXOutputCondition'; (* attribute const *)
  364. (* CG_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_NA) *)
  365. { kCGPDFXRegistryName ("RegistryName"): A string identifying the registry
  366. in which the condition designated by `kCGPDFXOutputConditionIdentifier'
  367. is defined. This key is optional; if present, the value of this key must
  368. be a CFString. For best results, the string should be representable
  369. losslessly in ASCII encoding. }
  370. var kCGPDFXRegistryName: CFStringRef; external name '_kCGPDFXRegistryName'; (* attribute const *)
  371. (* CG_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_NA) *)
  372. { kCGPDFXInfo ("Info"): A human-readable text string containing additional
  373. information about the intended target device or production condition.
  374. This key is required if the value of `kCGPDFXOutputConditionIdentifier'
  375. does not specify a standard production condition; it is optional
  376. otherwise. If present, the value of this key must be a CFString. }
  377. var kCGPDFXInfo: CFStringRef; external name '_kCGPDFXInfo'; (* attribute const *)
  378. (* CG_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_NA) *)
  379. { kCGPDFXDestinationOutputProfile ("DestOutputProfile"): An ICC profile
  380. stream defining the transformation from the PDF document's source colors
  381. to output device colorants. This key is required if the value of
  382. `kCGPDFXOutputConditionIdentifier' does not specify a standard production
  383. condition; it is optional otherwise. If present, the value of this key
  384. must be a ICC-based CGColorSpaceRef. }
  385. var kCGPDFXDestinationOutputProfile: CFStringRef; external name '_kCGPDFXDestinationOutputProfile'; (* attribute const *)
  386. (* CG_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_NA) *)
  387. {$endc}
  388. { The document's output intents. Optional; if present, the value must be a
  389. CFArrayRef containing one or more CFDictionaryRefs. The array is added to
  390. the PDF document in the /OutputIntents entry in the PDF file's document
  391. catalog. Each dictionary in the array must be of form specified above for
  392. the `kCGPDFContextOutputIntent' key, except that only the first
  393. dictionary in the array may contain the `kCGPDFXOutputIntentSubtype'
  394. ("S") key with a value of "GTS_PDFX". If both `kCGPDFContextOutputIntent'
  395. and `kCGPDFContextOutputIntents' keys are specified, the former is
  396. ignored. }
  397. // const kCGPDFContextOutputIntents: CFStringRef;
  398. // CG_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_NA);
  399. { Compatibility with earlier versions of Mac OS X. }
  400. // #if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_4
  401. {
  402. PNL comments:
  403. There is an issue here that these types below are macro defines, and they
  404. conflict with the definitions above unless only one or the other is defined.
  405. This only applies to GPC where GPCMacros.inc contains the macros and
  406. is typically read before this Pascal source file.
  407. }
  408. {$ifc USE_CFSTR_CONSTANT_MACROS}
  409. {$definec kCGPDFContextTitle CFSTRP('kCGPDFContextTitle')}
  410. {$endc}
  411. {$ifc USE_CFSTR_CONSTANT_MACROS}
  412. {$definec kCGPDFContextAuthor CFSTRP('kCGPDFContextAuthor')}
  413. {$endc}
  414. {$ifc USE_CFSTR_CONSTANT_MACROS}
  415. {$definec kCGPDFContextCreator CFSTRP('kCGPDFContextCreator')}
  416. {$endc}
  417. {$ifc TARGET_OS_MAC}
  418. {$ifc USE_CFSTR_CONSTANT_MACROS}
  419. {$definec kCGPDFContextOutputIntent CFSTRP('kCGPDFContextOutputIntent')}
  420. {$endc}
  421. {$ifc USE_CFSTR_CONSTANT_MACROS}
  422. {$definec kCGPDFContextOutputIntents CFSTRP('kCGPDFContextOutputIntents')}
  423. {$endc}
  424. {$endif}
  425. // #endif { MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_4 }
  426. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  427. end.
  428. {$endc} {not MACOSALLINCLUDE}