Upload
others
View
25
Download
0
Embed Size (px)
Citation preview
ADOBE SYSTEMS INCORPORATED
Corporate Headquarters345 Park Avenue
San Jose, CA 95110-2704(408) 536-6000
http://partners.adobe.com
b bc
August 2003
Technical Note #5414
Version: PDF Library 6.0
PDF Library Supplement to the Acrobat Core API Reference
Copyright 2003 Adobe Systems Incorporated. All rights reserved. Adobe® PDF Library Supplement to the Core API Reference.
If this guide is distributed with software that includes an end user agreement, this guide, as well as the software described in it, is furnished under license and may be used or copied only in accordance with the terms of such license. Except as permitted by any such license, no part of this guide may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, recording, or otherwise, without the prior written permission of Adobe Systems Incorporated. Please note that the content in this guide is protected under copyright law even if it is not distributed with software that includes an end user license agreement.
Please remember that existing artwork or images that you may want to include in your project may be protected under copyright law. The unauthorized incorporation of such material into your new work could be a violation of the rights of the copyright owner. Please be sure to obtain any permission required from the copyright owner.
Any references to company names in sample templates are for demonstration purposes only and are not intended to refer to any actual organization.
PostScript is a registered trademark of Adobe Systems Incorporated. All instances of the name PostScript in the text are references to the PostScript language as defined by Adobe Systems Incorporated unless otherwise stated. The name PostScript also is used as a product trademark for Adobe Systems’ implementation of the PostScript language interpreter.
Except as otherwise stated, any reference to a "PostScript printing device,” "PostScript display device,” or similar item refers to a printing device, display device or item (respectively) that contains PostScript technology created or licensed by Adobe Systems Incorporated and not to devices or items that purport to be merely compatible with the PostScript language.
Adobe, the Adobe logo, Acrobat, Acrobat Capture, the Adobe PDF logo, Distiller, PostScript, the PostScript logo and Reader are either registered trademarks or trademarks of Adobe Systems Incorporated in the United States and/or other countries.
Apple, Macintosh, and Power Macintosh are trademarks of Apple Computer, Inc., registered in the United States and other countries. PowerPC is a registered trademark of IBM Corporation in the United States. ActiveX, Microsoft, Windows, and Windows NT are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries. UNIX is a registered trademark of The Open Group. All other trademarks are the property of their respective owners.
This publication and the information herein is furnished AS IS, is subject to change without notice, and should not be construed as a commitment by Adobe Systems Incorporated. Adobe Systems Incorporated assumes no responsibility or liability for any errors or inaccuracies, makes no warranty of any kind (express, implied, or statutory) with respect to this publication, and expressly disclaims any and all warranties of merchantability, fitness for particular purposes, and noninfringement of third party rights.
Portions include software under the following terms:
Portions derived from the RSA DataSecurity, Inc. MD5 Message-Digest Algorithm.
Portions of the software were developed by the University of California, Berkeley.
The author of this software is David M. Gay. Copyright (c) 1991 by AT&T. Permission to use, copy, modify, and distribute this software for any purpose without fee is hereby granted, provided that this entire notice is included in all copies of any software which is or includes a copy or modification of this software and in all copies of the supporting documentation for such software. THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED WARRANTY. IN PARTICULAR, NEITHER THE AUTHOR NOR AT&T MAKES ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
Portions of the software were developed at Cygnus Solutions.
Portions copyright (c) 1995-2003 International Business Machines Corporation and others. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, provided that the above copyright notice(s) and this permission notice appear in all copies of the Software and that both the above copyright notice(s) and this permission notice appear in supporting documentation. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. Except as contained in this notice, the name of a copyright holder shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization of the copyright holder.
Portions copyright (c) 1994 Hewlett-Packard Company. Permission to use, copy, modify, distribute and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. Hewlett-Packard Company makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty.
Copyright (c) 1996 Silicon Graphics Computer Systems, Inc. Permission to use, copy, modify, distribute and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. Silicon Graphics makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty.
Contains an implementation of the LZW algorithm licensed under U.S. Patent 4,558,302.
Adobe Systems Incorporated, 345 Park Avenue, San Jose, California 95110, USA. Notice to U.S. Government End Users. The Software and Documentation are “Commercial Items,” as that term is defined at 48 C.F.R. ß2.101, consisting of “Commercial Computer Software” and “Commercial Computer Software Documentation,” as such terms are used in 48 C.F.R. ß12.212 or 48 C.F.R. ß227.7202, as applicable. Consistent with 48 C.F.R. ß12.212 or 48 C.F.R. ßß227.7202-1 through 227.7202-4, as applicable, the Commercial Computer Software and Commercial Computer Software Documentation are being licensed to U.S. Government end users (a) only as Commercial Items and (b) with only those rights as are granted to all other end users pursuant to the terms and conditions herein. Unpublished-rights reserved under the copyright laws of the United States.
Adobe Systems Incorporated, 345 Park Avenue, San Jose, CA 95110-2704, USA. For U.S. Government End Users, Adobe agrees to comply with all applicable equal opportunity laws including, if appropriate, the provisions of Executive Order 11246, as amended, Section 402 of the Vietnam Era Veterans Readjustment Assistance Act of 1974 (38 USC 4212), and Section 503 of the Rehabilitation Act of 1973, as amended, and the regulations at 41 CFR Parts 60-1 through 60-60, 60-250, and 60-741. The affirmative action clause and regulations contained in the preceding sentence shall be incorporated by reference.
PDF Library Supplement to the Acrobat Core API Reference 3
PDF Library-specific Methods
ASAtomGetCount
ASInt32 ASAtomGetCount (void);
Description
Gets the number of ASAtoms that have been allocated. The maximum number of ASAtoms is 0xFFFFFFFF. (This was a 16-bit value in Acrobat 4.x, and changed to a 32-bit value in Acrobat 5.)
ASAtoms cannot be deleted or freed. Use this method to determine if it is necessary to re-initialize the library before creating more ASAtoms.
Parameters
None
Return Value
Number of ASAtoms currently allocated.
Header File
PDFLCalls.h
Related Methods
ASAtomExistsForStringPDFLInitPDFLTerm
PDF Library Supplement to the Acrobat Core API Reference 4
PDF Library-specific MethodsASFileSysGetDefaultTempPath
ASFileSysGetDefaultTempPath
ASPathName ASFileSysGetDefaultTempPath (ASFileSys fileSys);
Description
Gets the default temporary path that was set by ASFileSysSetDefaultTempPath.
Parameters
Return Value
The ASPathName if the operation was successful, NULL otherwise.
Header File
PDFLCalls.h
Related Methods
ASFileSysSetDefaultTempPath
fileSys The file system in which the ASPathname is set.
PDF Library Supplement to the Acrobat Core API Reference 5
PDF Library-specific MethodsASFileSysSetDefaultTempPath
ASFileSysSetDefaultTempPath
ASBool ASFileSysSetDefaultTempPath (ASFileSys fileSys,ASPathName pathName);
Description
Sets the default temporary path for the specified file system to the specified pathname. The method copies the passed pathname object on success; the client is responsible for releasing the object when it is no longer needed, using ASFileSysReleasePath.
Pass a pathname of NULL to reset the default temporary path to the file system default.
Parameters
Return Value
false if the path provided is not writable, true otherwise.
Header File
PDFLCalls.h
Related Methods
ASFileSysGetDefaultTempPath
fileSys (May be NULL) The file system in which to set the default temporary path.
pathName The pathname for the new default temporary path, or NULL to reset to the file system default.
PDF Library Supplement to the Acrobat Core API Reference 6
PDF Library-specific MethodsASGetRamFileSys
ASGetRamFileSys
ASFileSys ASGetRamFileSys (void);
Description
Gets the in-memory file system implementation for a platform.
N O T E : This API is available only in the thread-safe version of the PDFL Library.
Parameters
None.
Return Value
The platform's in-memory file system.
Header File
ASCalls.h
Related Methods
ASRamFileSysSetLimitKB
PDF Library Supplement to the Acrobat Core API Reference 7
PDF Library-specific MethodsASGetTempFileSys
ASGetTempFileSys
ASFileSys ASGetTempFileSys (void);
Description
Gets the file system to be used for temporary files. The default temporary file system is the default file system as returned by ASGetDefaultFileSys.
N O T E : This API is available only in the thread-safe version of the PDFL Library.
Parameters
None.
Return Value
The file system to be used for temporary files.
Header File
ASCalls.h
Related Methods
ASGetRamFileSysASSetTempFileSys
PDF Library Supplement to the Acrobat Core API Reference 8
PDF Library-specific MethodsASPurgeMemory
ASPurgeMemory
ASSize_t ASPurgeMemory (ASSize_t amount);
Description
Attempts to free memory from the PDF Library caches.
The caches in the PDF Library can grow in complex and unexpected ways. A client can manage memory use with the PDFLInit memory callbacks, or by explicitly calling this function after certain functions, such as PDDocClose.
To manage memory use with the memory callbacks, a client can call ASPurgeMemory during the allocation callback if it is low on memory, or to limit the amount of memory used by the library. Use this approach only with extreme caution and extensive testing. The run-time memory requirements are very document-specific.
Parameters
Return Value
The approximate amount of memory freed.
Notifications
None
Header File
PDFLCalls.h
Related Methods
PDFLInitPDFLTerm
amount The desired amount of memory to free.
PDF Library Supplement to the Acrobat Core API Reference 9
PDF Library-specific MethodsASRamFileSysSetLimitKB
ASRamFileSysSetLimitKB
void ASRamFileSysSetLimitKB (ASInt32 limit);
Description
Sets the in-memory file system size limit, in kilobytes.
N O T E : This API is available only in the thread-safe version of the PDFL Library.
Parameters
Return Value
None.
Header File
ASCalls.h
Related Methods
ASGetRamFileSys
limit The in-memory file system size limit, in kilobytes.
PDF Library Supplement to the Acrobat Core API Reference 10
PDF Library-specific MethodsASSetTempFileSys
ASSetTempFileSys
void ASSetTempFileSys (ASFileSys fileSys);
Description
Sets the file system to be used for temporary files.
N O T E : This API is available only in the thread-safe version of the PDFL Library.
Parameters
Return Value
None.
Header File
ASCalls.h
Related Methods
ASGetRamFileSysASGetTempFileSys
fileSys The file system that will become the temporary file system for the platform.
PDF Library Supplement to the Acrobat Core API Reference 11
PDF Library-specific MethodsAVExtensionMgrRegisterNotification
AVExtensionMgrRegisterNotification
void AVExtensionMgrRegisterNotification (NSelector nsel,ASExtension owner, void* proc, void* clientData);
Description
Registers a user-supplied procedure to call when the event of the specified type occurs. This is exactly the same as the AVAppRegisterNotification method. All of the PD level notifications are available with the Adobe PDF Library.
Parameters
Return Value
None
Header File
PDFLCalls.h
Related Methods
AVExtensionMgrUnregisterNotificationAVAppRegisterNotification
nsel Notification type. Must be one of the notification selectors. The notification selector is the name of the notification with the characters NSEL appended. For example, the selector for PDDocDidPrintPage is PDDocDidPrintPageNSEL.Only the PD-level notifications are available with the Adobe PDF Library.
owner Identifies the owner. For the Adobe PDF Library, if there is only one owner of the PDFEdit subsystem, owner should be zero. If there are multiple owners, each should specify a nonzero, non-negative owner. (A negative owner is reserved for the implementation.)
proc User-supplied callback to call when the notification occurs. Its declaration depends on the notification type (see the Notifications section in the Acrobat Core API Reference).
clientData Pointer to user-supplied data to pass to proc each time it is called.
PDF Library Supplement to the Acrobat Core API Reference 12
PDF Library-specific MethodsAVExtensionMgrRegisterNotification
Examplevoid myWillPrintDoc(PDDoc doc, ASStm stm, ASInt32 level, void* clientData);ASCallback myWillPrintDocCB = ASCallbackCreateNotification (PDDocWillPrintDoc, myWillPrintDoc);
AVExtensionMgrRegisterNotification (PDDocWillPrintDocNSEL, (ASExtension)1, myWillPrintDocCB, NULL);
PDF Library Supplement to the Acrobat Core API Reference 13
PDF Library-specific MethodsAVExtensionMgrUnregisterNotification
AVExtensionMgrUnregisterNotification
void AVExtensionMgrUnregisterNotification (NSelector nsel,ASExtension owner, void* proc, void* clientData);
Description
Unregisters a user-supplied procedure to call when the specified event occurs. This is exactly the same as the AVAppUnregisterNotification method, as documented in the Acrobat Core API Reference.
Parameters
Return Value
None
Header File
PDFCalls.h
Related Methods
AVExtensionMgrRegisterNotificationAVAppUnregisterNotification
ExampleAVExtensionMgrUnregisterNotification (PDDocWillPrintDocNSEL, (ASExtension)1, myWillPrintDocCB, NULL);
nsel Notification type. Must be one of the notification selectors. The notification selector is the name of the notification with the characters NSEL appended. For example, the selector for PDDocDidOpen is PDDocDidOpenNSEL.
owner Identifies the owner with which the notification was registered.
proc User-supplied callback with which the notification was registered.
clientData Pointer to user-supplied data that was used when the notification was registered.
PDF Library Supplement to the Acrobat Core API Reference 14
PDF Library-specific MethodsPDDocPrintPages
PDDocPrintPages
void PDDocPrintPages (PDPrintClient client);
Description
Prints a range of pages from a document, controlled by a structure of data and callbacks.
N O T E : This low-level method should be avoided; use the higher-level PDFLPrintDoc instead.
Parameters
Return Value
None
Known Exceptions
genErrBadParm
Notifications
PSPrintAfterBeginPageSetupPSPrintAfterBeginPrologPSPrintAfterBeginSetupPSPrintAfterEmitExtGStatePSPrintAfterPageTrailerPSPrintAfterTrailerPSPrintBeforeEndCommentsPSPrintBeforeEndSetup
Header File
PDFLCalls.h
Related Methods
PDFLInitPDFLPrintDoc
client Control structure for the operation, containing data and callback procedures.
PDF Library Supplement to the Acrobat Core API Reference 15
PDF Library-specific MethodsPDFLGetCoreHFT
PDFLGetCoreHFT
HFT PDFLGetCoreHFT (void);
Description
Gets the Core HFT.
Parameters
None
Return Value
The Core HFT object.
Header File
PDFInit.h
Related Methods
PDFLInit
PDF Library Supplement to the Acrobat Core API Reference 16
PDF Library-specific MethodsPDFLGetFlags
PDFLGetFlags
ASUns32 PDFLGetFlags (void);
Description
Gets the flags set when the PDF Library was initialized. The only flag currently supported is kPDFLInitIgnoreDefaultDirectories.
When this flag is set, the initialization process does not search through the default font directories, but only searches for fonts in those directories specified in dirList.
Parameters
None
Return Value
The initialization flags value.
Header File
PDFInit.h
Related Methods
PDFLInit
PDF Library Supplement to the Acrobat Core API Reference 17
PDF Library-specific MethodsPDFLGetInitCount
PDFLGetInitCount
ASUns32 PDFLGetInitCount (void);
Description
Gets the number of times the PDF Library has been initialized.
Parameters
None
Return Value
The number of times the PDF Library has been initialized.
Header File
PDFInit.h
Related Methods
PDFLInit
PDF Library Supplement to the Acrobat Core API Reference 18
PDF Library-specific MethodsPDFLGetVersion
PDFLGetVersion
ASUns32 PDFLGetVersion (void);
Description
N O T E : Obsolete in PDF Library 6.0. Use HFTGetVersion instead.
Gets the value of the Adobe PDF Library version—kPDFLVersion. The most significant 16 bits are the major version number; the least significant 16 bits are the minor version number. The major version number indicates whether any incompatible API changes have been made. The minor version number indicates the API has changed, but in a compatible fashion.
Parameters
None
Return Value
Adobe PDF Library version—kPDFLVersion.
Header File
PDFInit.h
Related Methods
PDFLTerm
PDF Library Supplement to the Acrobat Core API Reference 19
PDF Library-specific MethodsPDFLibraryRegisterNotification
PDFLibraryRegisterNotification
void PDFLibraryRegisterNotification (NSelector nsel,ASExtension owner, void *proc, void *clientData);
Description
Registers a user-supplied procedure to call when the specified event occurs. This is exactly the same as the AVAppRegisterNotification method. All of the PD level notifications are available with the Adobe PDF Library.
Parameters
Return Value
None
Header File
PDFLHFT.h
Related Methods
AVExtensionMgrRegisterNotificationAVAppRegisterNotificationPDFLibraryUnregisterNotification
nsel Notification type. Must be one of the notification selectors. The notification selector is the name of the notification with the characters NSEL appended. For example, the selector for PDDocDidPrintPage is PDDocDidPrintPageNSEL.Only the PD-level notifications are available with the Adobe PDF Library.
owner Identifies the owner. For the Adobe PDF Library, if there is only one owner of the PDFEdit subsystem, owner should be zero. If there are multiple owners, each should specify a nonzero, non-negative owner. (A negative owner is reserved for the implementation.)
proc User-supplied callback to call when the notification occurs. Its declaration depends on the notification type (see the Notifications section in the Acrobat Core API Reference).
clientData Pointer to user-supplied data to pass to proc each time it is called.
PDF Library Supplement to the Acrobat Core API Reference 20
PDF Library-specific MethodsPDFLibraryUnregisterNotification
PDFLibraryUnregisterNotification
void PDFLibraryUnregisterNotification (NSelector nsel,ASExtension owner, void* proc, void* clientData);
Description
Unregisters a user-supplied procedure to call when the specified event occurs. This is exactly the same as the AVAppUnregisterNotification method, as documented in the Acrobat Core API Reference.
Parameters
Return Value
None
Header File
PDFLHFT.h
Related Methods
PDFLibraryRegisterNotificationAVAppUnregisterNotification
nsel Notification type. Must be one of the notification selectors. The notification selector is the name of the notification with the characters NSEL appended. For example, the selector for PDDocDidOpen is PDDocDidOpenNSEL.
owner Identifies the owner. For the Adobe PDF Library, if there is only one owner of the PDFEdit subsystem, owner should be zero. If there are multiple owners, each should specify a nonzero, non-negative owner. (A negative owner is reserved for the implementation.)
proc User-supplied callback to call when the notification occurs. Its declaration depends on the notification type (see the Notifications section in the Acrobat Core API Reference). You must use the same callback that you called AVExtensionMgrRegisterNotification with.
clientData Pointer to user-supplied data to pass to proc each time it is called.
PDF Library Supplement to the Acrobat Core API Reference 21
PDF Library-specific MethodsPDFLInit
PDFLInit
ASInt32 PDFLInit (PDFLData data);
Description
Initializes the Adobe PDF Library. This method must be called before any other Library calls can be made, printing or otherwise.
Parameters
Return Value
0 if initialization was successful, or an error code if it was not. Use ASGetErrorString to convert any error code to a string.
Header File
PDFInit.h
Related Methods
PDFLGetFlagsPDFLGetInitCountPDFLTerm
data Initialization data for Adobe PDF Library.
PDF Library Supplement to the Acrobat Core API Reference 22
PDF Library-specific MethodsPDFLPrintDoc
PDFLPrintDoc
void PDFLPrintDoc (PDDoc doc,PDFLPrintUserParamsRec userParams);
Description
Prints a PDF document or pages from a PDF document allowing the caller to specify options such as page size, rotation, and shrink-to-fit.
N O T E : Users of the PDFLPrintDoc method do not have to create the PDPrintClient callbacks. That detail is handled by the library.
Parameters
Return Value
None
Known Exceptions
cosErrWriteErrorpdErrOpNotPermittedgenErrBadParm
Notifications
PSPrintAfterBeginPageSetupPSPrintAfterBeginPrologPSPrintAfterBeginSetupPSPrintAfterEmitExtGStatePSPrintAfterPageTrailerPSPrintAfterTrailerPSPrintBeforeEndCommentsPSPrintBeforeEndSetup
Header File
PDFLPrint.h
Related Methods
PDFLPrintDoc
ExamplePDFLPrintDoc(doc, userParams);
doc The PDDoc for the document to print.
userParams Parameters to control printing.
PDF Library Supplement to the Acrobat Core API Reference 23
PDF Library-specific MethodsPDFLTerm
PDFLTerm
void PDFLTerm (void);
Description
Terminates the Adobe PDF Library. Call this method after you are completely done using the library. Call this once to terminate and release memory used by the library. After the library has been shut down, the process should terminate.
Parameters
None
Return Value
None
Header File
PDFInit.h
Related Methods
PDFLInit
PDF Library Supplement to the Acrobat Core API Reference 24
PDF Library-specific MethodsPDFontDownloadContextCreate
PDFontDownloadContextCreate
PDFontDownloadContext PDFontDownloadContextCreate(PDPrintClient client);
Description
Creates a font download context object. This object keeps track of the fonts downloaded during a print job and whether or not substitution fonts have already been downloaded. Also tracks the font download parameters, such as binaryOK and “emit TrueType as Type 42.” For use in the PDFontStreamPS method.
Parameters
Return Value
The newly-created context.
Header File
PDFLCalls.h
Related Methods
PDDocPrintPagesPDFontDownloadContextDestroyPDFontStreamPS
client The client record to pass to PDDocPrintPages.
PDF Library Supplement to the Acrobat Core API Reference 25
PDF Library-specific MethodsPDFontDownloadContextDestroy
PDFontDownloadContextDestroy
void PDFontDownloadContextDestroy(PDFontDownloadContext context);
Description
Destroys a font download context object. Call this method after PDDocPrintPages returns.
Parameters
Return Value
None
Header File
PDFLCalls.h
Related Methods
PDDocPrintPagesPDFontDownloadContextCreate
context The context to destroy.
PDF Library Supplement to the Acrobat Core API Reference 26
PDF Library-specific MethodsPDFontPSEmitGlyphsIncr
PDFontPSEmitGlyphsIncr
ASBool PDFontPSEmitGlyphsIncr (ASStm stm, PDFont fontP,PDPrintStrP srcStr, PDPrintStrP dstStr,ASUns32* srcBytesUsedP, ASUns32* dstBytesUsedP,ASUns32* glyphCount, ASUns16* fontIndexP,PDPrintClient printClient );
Description
Emit glyphs incrementally. This is the default EmitGlyphsIncr callback procedure for the PDPrintClient structure.
Parameters
Return Value
true if successful; false otherwise.
Header File
PDFLCalls.h
Related Methods
PDDocPrintPagesPDFontPSFlushIncrGlyphListPDFontPSGetComponentFontList
stm The stream.
fontP The font.
srcStr Source string.
dstStr Destination string.
srcBytesUsedP Source bytes used.
dstBytesUsedP Destination bytes used.
glyphCount Number of glyphs.
fontIndexP Font index.
printClient Control structure.
PDF Library Supplement to the Acrobat Core API Reference 27
PDF Library-specific MethodsPDFontPSFlushIncrGlyphList
PDFontPSFlushIncrGlyphList
void PDFontPSFlushIncrGlyphList (ASStm stm,PDPrintClient printClient);
Description
Flush the incremental glyphs list from a stream. This is the default FlushIncrGlyphList callback procedure for the PDPrintClient structure.
Parameters
Return Value
None
Header File
PDFLCalls.h
Related Methods
PDFontPSEmitGlyphsIncrPDFontPSGetComponentFontList
stm The stream.
printClient Control structure.
PDF Library Supplement to the Acrobat Core API Reference 28
PDF Library-specific MethodsPDFontPSGetComponentFontList
PDFontPSGetComponentFontList
void PDFontPSGetComponentFontList(PDFont fontP, PDPrintFontArrayP pdFontArr, PDPrintClient printClient);
Description
Get the component font list. This is the default GetComponentFontList callback procedure for the PDPrintClient structure.
Parameters
Return Value
None
Header File
PDFLCalls.h
Related Methods
PDFontPSEmitGlyphsIncrPDFontPSFlushIncrGlyphList
fontP The font.
pdFontArr Font array.
printClient Control structure.
PDF Library Supplement to the Acrobat Core API Reference 29
PDF Library-specific MethodsPDFontStreamPS
PDFontStreamPS
ASBool PDFontStreamPS (PDFont fontP, ASStm stm,PDFontDownloadContext context);
Description
Emits a font into a specified stream. The font is in a format suitable for downloading to a PostScript VM. For example, a TrueType font is converted into a Type 1 or Type 42 font.
For use in the EmitFont callback for PDDocPrintPages.
Parameters
Return Value
true if successful, false otherwise.
Header File
PDFLCalls.h
Related Methods
PDDocPrintPagesPDFontDownloadContextCreate
fontP The font to emit.
stm The ASStm into which the font is emitted.
context A context created by PDFontDownloadContextCreate.
PDF Library Supplement to the Acrobat Core API Reference 30
PDF Library-specific MethodsPDFontWasExtracted
PDFontWasExtracted
ASBool PDFontWasExtracted (PDFont fontP);
Description
Tests whether or not the specified font is embedded in the PDF file and has already been extracted to display or print the file.
Parameters
Return Value
true if the font is embedded in the PDF file and has been extracted, false otherwise.
Header File
PDFLCalls.h
Related Methods
PDFontDownloadContextCreatePDFontWasFauxed
fontP The font to test.
PDF Library Supplement to the Acrobat Core API Reference 31
PDF Library-specific MethodsPDFontWasFauxed
PDFontWasFauxed
ASBool PDFontWasFauxed (PDFont font);
Description
Tests whether or not the specified font is embedded in the PDF file or is installed in the user’s system. If this is the case, the correct font can be used for display and printing.
If the font is not embedded or installed, the Acrobat viewer has used a multiple master font to create a substitute font, called a faux font.
Parameters
Return Value
true if the font has been substituted, false otherwise.
Header File
PDFLCalls.h
Related Methods
PDFontWasExtracted
fontP The font to test.
PDF Library Supplement to the Acrobat Core API Reference 32
PDF Library-specific MethodsPDPageDrawContentsPlacedToWindow
PDPageDrawContentsPlacedToWindow
void PDPageDrawContentsPlacedToWindow (PDPage page,void* window, void* displayContext, ASBool isDPS,ASFixedMatrix* matrix, ASFixedRect* updateRect,ASCancelProc cancelProc, void* cancelProcClientData);
Description
Draws the page to the window or display context. The window and display context are implementation dependent.
This method is the same as PDPageDrawContentsToWindow, except that it raises an exception if the pdPermCopy (see PDPerms) permission is not set in the document.
Parameters
Return Value
None
page The page to draw into window.
window The platform window to which to render.In Mac OS, the window is a WindowPtr or GrafPtr or CGrafPtr.In Windows, the window is an HWND.
displayContext The platform display context to which to render. In Mac OS, currently unused.In Windows, displayContext is an HDC.
isDPS Currently unused. Always set to false.
matrix Pointer to the matrix to concatenate onto the default page matrix. It is useful for converting from page to window coordinates and for scaling.
updateRect Pointer to the rectangle to draw, defined in user space coordinates. Any objects outside of updateRect will not be drawn. All objects are drawn if updateRect is NULL.
cancelProc A method called to check whether drawing should be canceled. If the method returns true, drawing is stopped, nothing is erased, and the window contains whatever was drawn up to the current state.
cancelProcClientData
Pointer to user-supplied data to pass to cancelProc each time it is called. Should be NULL if cancelProc is NULL.
PDF Library Supplement to the Acrobat Core API Reference 33
PDF Library-specific MethodsPDPageDrawContentsPlacedToWindow
Known Exceptions
Raises pdErrOpNotPermitted if the pdPermCopy permission in PDPermReqObj for the document is not set.
Header File
PDFLCalls.h
Related Methods
PDPageDrawContentsToWindow
PDF Library Supplement to the Acrobat Core API Reference 34
PDF Library-specific MethodsPDPageDrawContentsToMemory
PDPageDrawContentsToMemory
ASInt32 PDPageDrawContentsToMemory (PDPage page, ASUns32 flags, ASFixedMatrix* matrix,ASFixedRect* updateRect, ASUns32 smoothFlags,ASAtom csAtom, ASInt32 bpc, ASFixedRect* destRect,char* buffer, ASInt32 bufferSize, CancelProc cancelProc,void* cancelProcData);
Description
Renders a page to memory. The width of the image is calculated as follows:
width = abs(ASFixedRoundToInt16(destRect.right) -ASFixedRoundToInt16(destRect.left));
width = ((((width * bpc * nComps)+31) / 32) * 4) * 8 / (bpc * nComps);
nComps = 1 for DeviceGray3 for DeviceRGB,
4 for DeviceCMYKbpc = bits per component
Parameters
page The page to render.
flags A bit field of PDPageDrawFlags. Must be an OR of the following flags:● kPDPageDoLazyErase—If set, erases the bitmap if the
first object drawn does not cover the page's entire crop box.
● kPDPageUseAnnotFaces—If set, draws annotations that have a default face, such as the visible fields in an Acrobat form. Text and link annotations are not drawn.
● kPDPageIsPrinting— If set, then Form annotations are rendered as if they are being printed. This means that form fields marked as “Hidden but printable” are rendered, but fields marked as “Visible but doesn’t print” will not be rendered. If not set, then Form annotations are rendered as if they are being viewed. This means that form fields marked as “Hidden but printable” are not rendered, but fields marked as “Visible but doesn’t print” will be.
matrix Pointer to the matrix to be concatenated onto the default page matrix.
PDF Library Supplement to the Acrobat Core API Reference 35
PDF Library-specific MethodsPDPageDrawContentsToMemory
Return Value
The size of the bitmap in bytes.
Header File
PDFLCalls.h
Related Methods
PDPageDrawContentsPlacedWithParams
updateRect Pointer to the rectangle to draw, defined in user space coordinates. Any objects outside of updateRect will not be drawn. All objects are drawn if updateRect is NULL.
smoothFlags A bit field of PDPageDrawSmoothFlags. Must be an OR of the following flags:● kPDPageDrawSmoothText● kPDPageDrawSmoothLineArt● kPDPageDrawSmoothImage
csAtom The color space in which the bitmap data is represented. It must be one of DeviceGray, DeviceRGB, or DeviceCMYK.
bpc The number of bits per color component in the bitmap data. 8 is the only valid value for DeviceCMYK and DeviceRGB color space.1, 8, and 24 are valid for DeviceGray.
destRect Pointer to the rectangle of the bitmap. Defined in device space coordinates.
buffer Pointer to the bitmap data. If NULL, this function returns the size of buffer needed for the bitmap.
bufferSize The size of the buffer.
cancelProc A method to call to check whether drawing should be canceled. If the method returns true, drawing is stopped; nothing is erased, and the buffer contains whatever was drawn up to the current state.
cancelProcData User-supplied data to pass to CancelProc each time it is called.
PDF Library Supplement to the Acrobat Core API Reference 36
PDF Library-specific MethodsPDPageEmitPSOrient
PDPageEmitPSOrient
void PDPageEmitPSOrient (PDPage pdPage, ASInt16 paperHeight,ASInt16 paperWidth, ASStm stm, PDPrintParams params);
Description
N O T E : Obsolete in PDFL 6.0. Do not use.
Header File
PDFLCalls.h
Related Methods
PDFLPrintDocPDDocPrintPages
PDF Library Supplement to the Acrobat Core API Reference 37
PDF Library-specific MethodsPDPageGetSize
PDPageGetSize
void PDPageGetSize (PDPage page, ASFixed* width,ASFixed* height);
Description
Returns the width and height of the page, which could be rotated or defaulted.
Parameters
Return Value
None
Header File
PDFLCalls.h
page The page whose size is being obtained.
width (Filled by the method) Width of the page.
height (Filled by the method) Height of the page.
PDF Library Supplement to the Acrobat Core API Reference 38
PDF Library-specific MethodsPDPrefGetAntialiasLevel
PDPrefGetAntialiasLevel
ASInt16 PDPrefGetAntialiasLevel (void);
Description
Returns the antialias level, in pixels.
Parameters
None
Return Value
The antialias level set by PDPrefSetAntialiasLevel.
Header File
PDFLCalls.h
Related Methods
PDPrefSetAntialiasLevel
PDF Library Supplement to the Acrobat Core API Reference 39
PDF Library-specific MethodsPDPrefGetBlackPointCompensation
PDPrefGetBlackPointCompensation
ASBool PDPrefGetBlackPointCompensation (void);
Description
Returns the black-point compensation flag.
Parameters
None
Return Value
true if black-point compensation is done.
Header File
PDFLCalls.h
Related Methods
PDPrefSetBlackPointCompensation
PDF Library Supplement to the Acrobat Core API Reference 40
PDF Library-specific MethodsPDPrefGetGreekLevel
PDPrefGetGreekLevel
ASInt16 PDPrefGetGreekLevel (void);
Description
Returns the greek level.
Parameters
None
Return Value
The greek level set by PDPrefSetGreekLevel.
Header File
PDFLCalls.h
Related Methods
PDPrefSetGreekLevel
PDF Library Supplement to the Acrobat Core API Reference 41
PDF Library-specific MethodsPDPrefGetSuppressICCSpaces
PDPrefGetSuppressICCSpaces
ASBool PDPrefGetSuppressICCSpaces (ASUns32 nComponents);
Description
Returns the value of the suppress flag for ICC-based spaces with the specified number of components.
Parameters
Return Value
The suppress flag value.
Header File
PDFLCalls.h
Related Methods
PDPrefSetSuppressICCSpaces
nComponents The number of ICC-based space components that are suppressed or not, according to the flag value.
PDF Library Supplement to the Acrobat Core API Reference 42
PDF Library-specific MethodsPDPrefGetUseOutputIntents
PDPrefGetUseOutputIntents
ASBool PDPrefGetUseOutputIntents (void);
Description
Returns the value of the Output Intent flag. When this flag is true, the system overrides working space with the Output Intent, if it is present.
Parameters
None.
Return Value
The Output Intent flag value.
Header File
PDFLCalls.h
Related Methods
PDPrefSetUseOutputIntents
PDF Library Supplement to the Acrobat Core API Reference 43
PDF Library-specific MethodsPDPrefSetAntialiasLevel
PDPrefSetAntialiasLevel
void PDPrefSetAntialiasLevel (ASInt16 antialiasPixelLevel);
Description
Sets the default smooth text and smooth images global flags for subsequent rendering methods.
If the function PDPageDrawContentsToMemory is used for drawing, the smoothFlags value passed to that function supercedes the preference value for the duration of the call.
Parameters
Return Value
None
Header File
PDFLCalls.h
Related Methods
PDPrefGetAntialiasLevel
antialiasPixelLevel The anitalias level, in pixels. An OR of the following flags:● PDPrefAASmoothText● PDPrefAASmoothLineArt● PDPrefAASmoothImage
PDF Library Supplement to the Acrobat Core API Reference 44
PDF Library-specific MethodsPDPrefSetBlackPointCompensation
PDPrefSetBlackPointCompensation
void PDPrefGetBlackPointCompensation (ASBool kbpc);
Description
Sets the black-point compensation flag, which controls whether to adjust for differences in black points when converting colors between color spaces. When enabled, the full dynamic range of the source space is mapped into the full dynamic range of the destination space. When disabled, the dynamic range of the source space is simulated in the destination space (which can result in blocked or gray shadows).
Parameters
Return Value
None.
Header File
PDFLCalls.h
Related Methods
PDPrefGetBlackPointCompensation
kbpc true to enable black-point compensation, false otherwise.
PDF Library Supplement to the Acrobat Core API Reference 45
PDF Library-specific MethodsPDPrefSetGreekLevel
PDPrefSetGreekLevel
void PDPrefSetGreekLevel (ASInt16 greekPixelLevel);
Description
Sets the greek level. The greek level is a text height below which text characters are not rendered. Instead, text-like glyphs that have no meaning but look good at very small size are used. This is known as "greeking".
Parameters
Return Value
None
Header File
PDFLCalls.h
Related Methods
PDPrefGetGreekLevel
greekPixelLevel The greek level, in pixels.
PDF Library Supplement to the Acrobat Core API Reference 46
PDF Library-specific MethodsPDPrefSetSuppressICCSpaces
PDPrefSetSuppressICCSpaces
void PDPrefSetSuppressICCSpaces (ASUns32 nComponents, ASBool value);
Description
Specifies use of a default colorspace rather an ICC-based colorspace.
Parameters
Return Value
None
Header File
PDFLCalls.h
Related Methods
PDPrefGetSuppressICCSpaces
nComponents The number of ICC colorspace components.
value When true, use DefaultCMYK, DefaultRGB, or DefaultGray colorspace instead of an ICC-based colorspace with the same number of components.
PDF Library Supplement to the Acrobat Core API Reference 47
PDF Library-specific MethodsPDPrefSetUseLocalFonts
PDPrefSetUseLocalFonts
void PDPrefSetUseLocalFonts (ASBool useLocalFonts);
Description
Enables or disables use of local fonts.
Parameters
Return Value
None
Header File
PDFLCalls.h
Related Methods
None
useLocalFonts When true, use local fonts. when false, use global fonts.
PDF Library Supplement to the Acrobat Core API Reference 48
PDF Library-specific MethodsPDPrefSetUseOutputIntents
PDPrefSetUseOutputIntents
void PDPrefSetUseLocalFonts (ASBool flag);
Description
Sets the Output Intent flag.
Parameters
Return Value
None
Header File
PDFLCalls.h
Related Methods
PDPrefGetUseOutputIntents
flag When true, use Output Intent to override a working space, if it is present.
PDF Library Supplement to the Acrobat Core API Reference 49
PDF Library-specific MethodsPDPrefSetWorkingCMYK
PDPrefSetWorkingCMYK
void PDPrefSetWorkingCMYK (void* profile,ASUns32 profileLength);
Description
Sets the current CMYK working space to a given ICC profile. A CMYK working space in PDF is defined as a profile to substitute for a corresponding /DeviceCMYK space.
Parameters
Return Value
None
Header File
PDFLCalls.h
Related Methods
PDPrefSetWorkingGrayPDPrefSetWorkingRGB
profile A pointer to a buffer containing the ICC color profile.
profileLength The length in bytes of the profile.
PDF Library Supplement to the Acrobat Core API Reference 50
PDF Library-specific MethodsPDPrefSetWorkingGray
PDPrefSetWorkingGray
void PDPrefSetWorkingGray (void* profile,ASUns32 profileLength);
Description
Sets the current gray working space to a given ICC profile. A Gray working space in PDF is defined as a profile to substitute for a corresponding /DeviceGray space. When rendering with overprint preview, the gray substitution is suppressed, to avoid converting grayscale to "rich black."
Parameters
Return Value
None
Header File
PDFLCalls.h
Related Methods
PDPrefSetWorkingCMYKPDPrefSetWorkingRGB
profile A pointer to a buffer containing the ICC color profile.
profileLength The length in bytes of the profile.
PDF Library Supplement to the Acrobat Core API Reference 51
PDF Library-specific MethodsPDPrefSetWorkingRGB
PDPrefSetWorkingRGB
void PDPrefSetWorkingRGB (void* profile,ASUns32 profileLength);
Description
Set the current RGB working space to a given ICC profile. An RGB working space in PDF is defined as a profile to substitute for a corresponding /DeviceRGB space.
Parameters
Return Value
None
Header File
PDFLCalls.h
Related Methods
PDPrefSetWorkingCMYKPDPrefSetWorkingGray
profile A pointer to a buffer containing the ICC color profile.
profileLength The length in bytes of the profile.
PDF Library Supplement to the Acrobat Core API Reference 52
PDF Library-specific Callbacks
ASExtensionProgressProc
ACCB1 void ACCB2 ASExtensionProgressProc(ASExtension extension, ASExtensionPhase phase, void* clientData);
Description
Called periodically during plug-in loading with the ASExtension currently being loaded.
N O T E : Extensions to the PDF Library are very similar to plugins to the Adobe Acrobat application. However, Adobe does not currently supply any extensions or support their creation.
Parameters
Return Value
None
Header File
PDFInit.h
Related Callbacks
ASExtensionReportErrorProc
Related Methods
None
extension The plug-in.
phase The context of the load, which determines the sequence of operations during the load operation. One of these constants:ASExtensionPhase_LOADINGASExtensionPhase_EXPORTING ASExtensionPhase_IMPORTINGASExtensionPhase_INITIALIZING ASExtensionPhase_UNLOADING
clientData A pointer to the client data.
PDF Library Supplement to the Acrobat Core API Reference 53
PDF Library-specific CallbacksASExtensionReportErrorProc
ASExtensionReportErrorProc
ACCB1 void ACCB2 ASExtensionReportErrorProc(ASExtension extension, ASExtensionPhase phase, ASInt32 error, void* clientData);
Description
Called during ASExtension initialization whenever an error occurs.
Parameters
Return Value
None
Header File
PDFInit.h
Related Callbacks
ASExtensionProgressProc
Related Methods
None
extension The plug-in.
phase Phase.
error The error code.
clientData A pointer to the client data.
PDF Library Supplement to the Acrobat Core API Reference 54
PDF Library-specific CallbacksASMemAllocProc
ASMemAllocProc
ACCB1 void* ACCB2 ASMemAllocProc (void* clientData,ASSize_t size);
Description
Called when the PDF Library needs to allocate memory. Callback should allocate the requested amount of memory and return it as a void*.
Parameters
Return Value
Pointer to the allocated block of memory.
Header File
PDFInit.h
Related Callbacks
ASMemAvailProcASMemFreeProcASMemReallocProc
Related Methods
PDFLInit
Examplevoid* StdMemAllocProc(void* clientData, void* p, ASSize_t size){return malloc(p, size);}
clientData The clientData specified in the TKAllocatorProcs structure.
size The amount of memory to be allocated.
PDF Library Supplement to the Acrobat Core API Reference 55
PDF Library-specific CallbacksASMemAvailProc
ASMemAvailProc
ACCB1 ASSize_t* ACCB2 ASMemAvailProc (void* clientData);
Description
Called when the PDF Library needs to determine the amount of available free memory.
Parameters
Return Value
Amount of available free memory.
Header File
PDFInit.h
Related Callbacks
ASMemAllocProcASMemFreeProcASMemReallocProc
Related Methods
PDFLInit
Exampleos_size_t sys_memavail(void){MEMORYSTATUS ms;
ms.dwLength = sizeof(ms);GlobalMemoryStatus(&ms);
return ms.dwAvailPhys + ms.dwAvailPageFile;}
clientData A pointer to the clientData specified in the TKAllocatorProcs structure.
PDF Library Supplement to the Acrobat Core API Reference 56
PDF Library-specific CallbacksASMemFreeProc
ASMemFreeProc
ACCB1 void* ACCB2 ASMemFreeProc (void* clientData, void* p);
Description
Called when the PDF Library needs to free memory. Callback should free the requested block of memory.
Parameters
Return Value
None
Header File
PDFInit.h
Related Callbacks
ASMemAllocProcASMemAvailProcASMemReallocProc
Related Methods
PDFLInit
Examplevoid StdMemFreeProc(void* clientData, void* p){free(p);}
clientData A pointer to the clientData specified in the TKAllocatorProcs structure.
p A pointer to memory to free.
PDF Library Supplement to the Acrobat Core API Reference 57
PDF Library-specific CallbacksASMemReallocProc
ASMemReallocProc
ACCB1 void* ACCB2 ASMemReallocProc (void* clientData, void* p,ASSize_t size);
Description
Called when the PDF Library needs to reallocate memory. Callback should reallocate the requested amount of memory and return it as a void*.
Parameters
Return Value
Pointer to allocated block of memory.
Header File
PDFInit.h
Related Callbacks
ASMemAllocProcASMemAvailProcASMemFreeProc
Related Methods
PDFLInit
Examplevoid* StdMemReallocProc(void* clientData, void* p, ASSize_t size){return realloc(p, size);}
clientData A pointer to the clientData specified in the TKAllocatorProcs structure.
p A pointer to memory to reallocate.
size The amount of memory requested.
PDF Library Supplement to the Acrobat Core API Reference 58
PDF Library-specific CallbacksCancelPrintJob
CancelPrintJob
ACCB1 ASBool ACCB2 CancelPrintJob (PDPrintClient printClient);
Description
Callback for PDPrintClient. CancelPrintJob is called to actually cause the print job to be cancelled. It should stop further printing and preferably should remove the incomplete print job.
Parameters
Return Value
Returns true if the print job was successfully cancelled.
Header File
PDFLExpT.h
Related Methods
PDDocPrintPages
printClient The PDPrintClient from which this is invoked.
PDF Library Supplement to the Acrobat Core API Reference 59
PDF Library-specific CallbacksDataSourceString
DataSourceString
ACCB1 ASUns32 ACCB2 DataSourceString (PDFileSpec f, char* buf,ASUns32 bufSize, void* clientData);
Description
(Optional) If this method is supplied, and the emitExternalStreamRef parameter in the PDPrintParamsRec is true, then during PostScript printing this method will be called when an external stream is encountered. If the method is not supplied, or if it returns NULL, then the “simple pathname” will be written as the DataSource for the stream; otherwise, the returned string will be written as the DataSource.
The DataSource is used thus:
/DataSource (xxxxx) (r) file
where xxxxx is the returned string or the simple pathname.
N O T E : The method may not store the PDFFileSpec pointer or any pointers (strings) within it.
Parameters
Return Value
Length of the string written info buf.
Header File
PDFLExpT.h
Related Methods
PDDocPrintPages
f An object of type PDFileSpec.
buf (Filled by the callback) The buffer.
bufSize The buffer size in bytes.
clientData A pointer to the client data.
PDF Library Supplement to the Acrobat Core API Reference 60
PDF Library-specific CallbacksDocBegin
DocBegin
ACCB1 void ACCB2 DocBegin (const PDPageRange ranges[], ASInt32 numRanges, ASStm stm, const PDResTree docTree,PDPrintClient printClient);
Description
(Optional) Callback for PDPrintClient. Begin processing a document for printing.
Parameters
Return Value
None
Header File
PDFLExpT.h
Related Methods
PDDocPrintPages
ranges Ranges of pages in document to print.
numRanges Number of page ranges in document to print.
stm The PostScript print stream.
docTree Must be NULL.
printClient The PDPrintClient from which this is invoked.
PDF Library Supplement to the Acrobat Core API Reference 61
PDF Library-specific CallbacksDocEnd
DocEnd
ACCB1 void ACCB2 DocEnd (ASStm stm,PDPrintClient printClient);
Description
(Optional) Callback for PDPrintClient. End processing a document for printing.
Parameters
Return Value
None
Header File
PDFLExpT.h
Related Methods
PDDocPrintPages
stm The PostScript print stream.
printClient The PDPrintClient from which this is invoked.
PDF Library Supplement to the Acrobat Core API Reference 62
PDF Library-specific CallbacksDocSetup
DocSetup
ACCB1 ASBool ACCB2 DocSetup (const PDPageRange ranges[],ASInt32 numRanges, ASStm prologStm,PDPrintClient printClient);
Description
(Optional) Callback for PDPrintClient. Set up a document for printing.
Parameters
Return Value
false if you don’t want PDDocPrintPages to emit procsets and other resources.
Header File
PDFLExpT.h
Related Methods
PDDocPrintPages
ranges Ranges of pages in document to print.
numRanges Number of page ranges in document to print.
prologStm The prolog stream.
printClient The PDPrintClient from which this is invoked.
PDF Library Supplement to the Acrobat Core API Reference 63
PDF Library-specific CallbacksEmitFontProcSet
EmitFontProcSet
ACCB1 ASBool ACCB2 EmitFontProcSet(ASStm stm, PDFont fontP,PDPrintClient printClient);
Description
(Optional) Callback for PDPrintClient. EmitFontProcSet is called while emitting the document prolog. It should emit any procsets required to download the font. The routine will be called once for each font in the document. However, each procset only needs to be downloaded once per document.
Parameters
Return Value
false if fontDownloadContext is not specified in the PDPrintClient; true otherwise.
Header File
PDFLExpT.h
Related Methods
PDDocPrintPages
stm The stream where the procset should be written.
fontP PDFont for the font.
printClient The PDPrintClient from which this is invoked.
PDF Library Supplement to the Acrobat Core API Reference 64
PDF Library-specific CallbacksEmitGlyphsIncr
EmitGlyphsIncr
ACCB1 ASBool ACCB2 EmitGlyphsIncr (ASStm stm, PDFont fontP,PDPrintStrP srcStr, PDPrintStrP dstStr,ASUns32* srcBytesUsed, ASUns32* dstBytesUsed,ASUns32* glyphCount, ASUns16* fontIndex,PDPrintClient printClient);
Description
Callback for PDPrintClient. Emit glyphs incrementally.
Parameters
Return Value
true if the glyphs successfully download, false otherwise.
Header File
PDFLExpT.h
Related Methods
PDDocPrintPagesPDFontPSEmitGlyphsIncr
stm The PostScript print stream for this page.
fontP PDFont for the font.
srcStr Source string.
dstStr Destination string.
srcBytesUsedP Source bytes used.
dstBytesUsedP Destination bytes used.
glyphCount Number of glyphs.
fontIndexP Font index.
printClient The PDPrintClient from which this is invoked.
PDF Library Supplement to the Acrobat Core API Reference 65
PDF Library-specific CallbacksEmitPageContents
EmitPageContents
ACCB1 void ACCB2 EmitPageContents (ASStm stm, ASInt32 pageNum,PDPage pdPage, PDPrintClient printClient);
Description
(Optional) Callback for PDPrintClient. Emit the page contents for printing. Broadcast a notification that the page has been printed:
NOTIFY(PDDocDidPrintPage) (doc, page, stm, error)
There is a default callback for PostScript printing.
Parameters
Return Value
None
Header File
PDFLExpT.h
Related Methods
PDDocPrintPages
stm The PostScript print stream for this page.
pageNum The number of the page whose contents is emitted.
pdPage The PDPage to print.
printClient The PDPrintClient from which this is invoked.
PDF Library Supplement to the Acrobat Core API Reference 66
PDF Library-specific CallbacksEmitPrologString
EmitPrologString
ACCB1 ASInt32 ACCB2 EmitPrologString (const char* s,ASInt32 nData, PDPrintClient printClient);
Description
(Optional) Callback for PDPrintClient. Emits prolog string.
Defaults to a method that calls FlushString.
Parameters
Return Value
If successful, result is greater than zero. If unsuccessful, result is negative.
Header File
PDFLExpT.h
Related Methods
PDDocPrintPages
s Pointer to the prolog string to emit.
nData Length of s in bytes.
printClient The PDPrintClient from which this is invoked.
PDF Library Supplement to the Acrobat Core API Reference 67
PDF Library-specific CallbacksEmitPSFontBegin
EmitPSFontBegin
ACCB1 void ACCB2 EmitPSFontBegin (ASStm stm, PDFont fontP,PDPrintClient printClient);
Description
(Optional) Callback for PDPrintClient. Called before a font is emitted (outside DSC comments).
Parameters
Return Value
None
Header File
PDFLExpT.h
Related Methods
PDDocPrintPages
stm The PostScript print stream for the current page.
fontP The font to emit.
printClient The PDPrintClient from which this is invoked.
PDF Library Supplement to the Acrobat Core API Reference 68
PDF Library-specific CallbacksEmitPSFontEncodingBegin
EmitPSFontEncodingBegin
ACCB1 ASBool ACCB2 EmitPSFontEncodingBegin (ASStm stm,PDFont fontP, PDPrintClient printClient);
Description
(Optional) Callback for PDPrintClient. Called before a font encoding is emitted.
Parameters
Return Value
Must be true.
Header File
PDFLExpT.h
Related Methods
PDDocPrintPages
stm The PostScript print stream for the current page.
fontP The font whose encoding is emitted.
printClient The PDPrintClient from which this is invoked.
PDF Library Supplement to the Acrobat Core API Reference 69
PDF Library-specific CallbacksEmitPSFontEncodingEnd
EmitPSFontEncodingEnd
ACCB1 void ACCB2 EmitPSFontEncodingEnd (ASStm stm,PDFont fontP, PDPrintClient printClient);
Description
(Optional) Callback for PDPrintClient. Called after a font encoding is emitted.
Parameters
Return Value
None
Header File
PDFLExpT.h
Related Methods
PDDocPrintPages
stm The PostScript print stream for the current page.
fontP The font whose encoding was emitted.
printClient The PDPrintClient from which this is invoked.
PDF Library Supplement to the Acrobat Core API Reference 70
PDF Library-specific CallbacksEmitPSFontEnd
EmitPSFontEnd
ACCB1 void ACCB2 EmitPSFontEnd (ASStm stm, PDFont fontP,PDPrintClient printClient);
Description
(Optional) Callback for PDPrintClient. Called after a font is emitted (outside DSC comments).
Parameters
Return Value
None
Header File
PDFLExpT.h
Related Methods
PDDocPrintPages
stm The PostScript print stream for the current page.
fontP The font that was emitted.
printClient The PDPrintClient from which this is invoked.
PDF Library Supplement to the Acrobat Core API Reference 71
PDF Library-specific CallbacksEmitPSResourceBegin
EmitPSResourceBegin
ACCB1 void ACCB2 EmitPSResourceBegin (ASStm stm, ASAtom resType, char* resName, CosObj resObj,PDPrintClient printClient);
Description
(Optional) Callback for PDPrintClient. Called before a PostScript resource is emitted.
Parameters
Return Value
None
Header File
PDFLExpT.h
Related Methods
PDDocPrintPages
stm The PostScript print stream for the current page.
resType An ASAtom representing the name of the resource type, such as ColorSpace or XObject, as defined in section 3.7.2 of the PDF Reference.
resName Name of the resource in the current page.
resObj The resource’s Cos object.
printClient The PDPrintClient from which this is invoked.
PDF Library Supplement to the Acrobat Core API Reference 72
PDF Library-specific CallbacksEmitPSResourceEnd
EmitPSResourceEnd
ACCB1 void ACCB2 EmitPSResourceEnd (ASStm stm, ASAtom resType,char* resName, CosObj resObj, PDPrintClient printClient);
Description
(Optional) Callback for PDPrintClient. Called after a PostScript resource is emitted.
Parameters
Return Value
None
Header File
PDFLExpT.h
Related Methods
PDDocPrintPages
stm The PostScript print stream for the current page.
resType An ASAtom representing the name of the resource type, such as ColorSpace or XObject as defined in section 3.7.2 of the PDF Reference.
resName Name of the resource in the current page.
resObj The resource’s Cos object.
printClient The PDPrintClient from which this is invoked.
PDF Library Supplement to the Acrobat Core API Reference 73
PDF Library-specific CallbacksEndSetup
EndSetup
ACCB1 void ACCB2 EndSetup (ASStm stm,PDPrintClient printClient);
Description
(Optional) Callback for PDPrintClient. End the setup for printing a document.
One task that might be performed here is to broadcast a notification for each range of pages that will be printed, as in this pseudo code:
for i = 0 to numRanges-1 ... {NOTIFY(PDDocWillPrintPages)(doc, fromPage, toPage, psLevel,
binaryOK);for pageNum = ranges[i]->startPage to ranges[i]->lastPage ...}
Parameters
Return Value
None
Header File
PDFLExpT.h
Related Methods
PDDocPrintPages
stm The PostScript print stream.
printClient The PDPrintClient from which this is invoked.
PDF Library Supplement to the Acrobat Core API Reference 74
PDF Library-specific CallbacksFlushIncrGlyphList
FlushIncrGlyphList
ACCB1 void ACCB2 FlushIncrGlyphList (ASStm stm,PDPrintClient printClient);
Description
(Required) Callback for PDPrintClient. FlushIncrGlyphList is called to flush the list of glyphs that have been incrementally download since the calls to EmitFont or the last call of FlushIncrGlyphList. This routine will be called if the caller generates PostScript code that would flush glyphs procedures that have been downloaded to the PostScript interpreter. For example, if at the beginning of each page a “save” is executed and then at the end of a page a “restore” is executed, any glyph procedures downloaded after the beginning of the page will be removed when the restore is executed.
The call to FlushIncrGlyphList indicates that all the glyphs need to be re-downloaded, by calls to EmitGlyphsIncr.
Parameters
Return Value
None
Header File
PDFLExpT.h
Related Methods
PDDocPrintPages
stm The PostScript print stream.
printClient The PDPrintClient from which this is invoked.
PDF Library Supplement to the Acrobat Core API Reference 75
PDF Library-specific CallbacksFlushString
FlushString
ACCB1 ASInt32 ACCB2 FlushString (char* data, ASInt32 nData,PDPrintClient printClient);
Description
(Required) Callback for PDPrintClient. Called when the ASStm buffer is full. Buffered data should be sent to the printer, driver, file, or other destination. Not used for non-PostScript printing.
Parameters
Return Value
None
Header File
PDFLExpT.h
Related Methods
PDDocPrintPages
data Pointer to data to send.
nData Length of data, in bytes.
printClient The PDPrintClient from which this is invoked.
PDF Library Supplement to the Acrobat Core API Reference 76
PDF Library-specific CallbacksGetComponentFontList
GetComponentFontList
ACCB1 void ACCB2 GetComponentFontList (PDFont fontP,PDPrintFontArray fontList, PDPrintClient printClient);
Description
(Required) Callback for PDPrintClient. GetComponentFontList is called to get the list of component font names used for substitution. For fonts that do not require substitution or are substituted by only one font, the list returned should only have one element. For a Type 0 font that requires several fonts for font substitution, the list will have multiple fonts. The fontnames returned are the names used by the font definitions downloaded to PostScript. The font definitions themselves are downloaded by a call to the EmitFont routine.
Parameters
Return Value
None
Header File
PDFLExpT.h
Related Methods
PDDocPrintPages
fontP The font.
fontList Font array.
printClient The PDPrintClient from which this is invoked.
PDF Library Supplement to the Acrobat Core API Reference 77
PDF Library-specific CallbacksGetFontVMUsage
GetFontVMUsage
ACCB1 ASInt32 ACCB2 GetFontVMUsage (ASStm stm, PDPrintClient printClient);
Description
(Optional) Callback for PDPrintClient. Asks client what the VM usage is for the font.
Parameters
Return Value
VM usage, in bytes.
Header File
PDFLExpT.h
Related Methods
PDDocPrintPages
stm The PostScript print stream.
printClient The PDPrintClient from which this is invoked.
PDF Library Supplement to the Acrobat Core API Reference 78
PDF Library-specific CallbacksNotifyNewPage
NotifyNewPage
ACCB1 void ACCB2 NotifyNewPage (ASInt32 pageNum, PDPrintClient printClient);
Description
(Optional) Callback for PDPrintClient. Called once for each page printed.
A client can use this notification to update the page number in the message pane, for example.
Parameters
Return Value
None
Header File
PDFLExpT.h
Related Methods
PDDocPrintPages
pageNum The number of the page to print.
printClient The PDPrintClient from which this is invoked.
PDF Library Supplement to the Acrobat Core API Reference 79
PDF Library-specific CallbacksOPIhandler
OPIhandler
ACCB1 ASBool ACCB2 OPIhandler (OPIDict* opi, ASStm stm,void* clientData);
Description
(Optional) Callback for PDPrintClient. If supplied, it is called during PostScript printing when a form or image containing an OPI dictionary is encountered. If it returns true, the client is presumed to have taken care of the entire form or image, and PDPrint emits nothing. Otherwise, PDPrint generates OPI comments based on the dictionary.
N O T E : The method may not store the OPIdict pointer or any pointers within it.
Parameters
Return Value
true if the client has taken care of the entire form or image, false otherwise.
Header File
PDFLExpT.h
Related Methods
PDDocPrintPages
opi The OPI dictionary.
stm The PostScript print stream.
clientData A pointer to the client data.
PDF Library Supplement to the Acrobat Core API Reference 80
PDF Library-specific CallbacksPageBegin
PageBegin
ACCB1 void ACCB2 PageBegin (ASStm stm, ASInt32 pageNum,const PDResTree pageTree, PDPrintClient printClient);
Description
(Optional) Callback for PDPrintClient. Called before a page begins printing.
Parameters
Return Value
None
Header File
PDFLExpT.h
Related Methods
PDDocPrintPages
stm The PostScript print stream for the current page.
pageNum The number of the page being printed.
pageTree Must be NULL.
printClient The PDPrintClient from which this is invoked.
PDF Library Supplement to the Acrobat Core API Reference 81
PDF Library-specific CallbacksPageCleanup
PageCleanup
ACCB1 void ACCB2 PageCleanup (ASStm stm, ASInt32 pageNum,PDPrintClient printClient);
Description
(Optional) Callback for PDPrintClient. Mirrors PageSetup, PageCleanup is called before we clean our dictionaries
Parameters
Return Value
None
Header File
PDFLExpT.h
Related Methods
PDDocPrintPages
stm The PostScript print stream for the current page.
pageNum The number of the page being printed.
printClient The PDPrintClient from which this is invoked.
PDF Library Supplement to the Acrobat Core API Reference 82
PDF Library-specific CallbacksPageEnd
PageEnd
ACCB1 void ACCB2 PageEnd (ASStm stm, ASInt32 pageNum,ASBool veryLastPage, PDPrintClient printClient);
Description
(Optional) Callback for PDPrintClient. Called after a page has printed. Broadcasts notification that page has printed:
NOTIFY(PDDocDidPrintPages)(doc, fromPage, toPage, error);
Parameters
Return Value
None
Header File
PDFLExpT.h
Related Methods
PDDocPrintPages
stm The PostScript print stream for the current page.
pageNum The number of the page just printed.
veryLastPage true only for the last page of the very last range, false otherwise.
printClient The PDPrintClient from which this is invoked.
PDF Library Supplement to the Acrobat Core API Reference 83
PDF Library-specific CallbacksPageSetup
PageSetup
ACCB1 ASBool ACCB2 PageSetup (ASStm stm, ASInt32 pageNum,PDPrintClient printClient);
Description
(Optional) Callback for PDPrintClient. Called before a page is printed to set it up.
Parameters
Return Value
true on success; otherwise, an error is raised.
Header File
PDFLExpT.h
Related Methods
PDDocPrintPages
stm The PostScript print stream for the current page.
pageNum The number of the page to set up.
printClient The PDPrintClient from which this is invoked.
PDF Library Supplement to the Acrobat Core API Reference 84
PDF Library-specific CallbacksPageSetupPostResource
PageSetupPostResource
ACCB1 void ACCB2 PageSetupPostResource (ASStm stm, ASInt32 pageNum, PDPrintClient printClient);
Description
Callback for PDPrintClient. PageSetupPostResource is called from PDPrintPageBegin after the resource tree has been processed (all fonts and other resources emitted into the PostScript stream).
Parameters
Return Value
None
Header File
PDFLExpT.h
Related Methods
PDDocPrintPages
stm The PostScript print stream for the current page.
pageNum The number of the page to set up.
printClient The PDPrintClient from which this is invoked.
PDF Library Supplement to the Acrobat Core API Reference 85
PDF Library-specific CallbacksPDFLPrintCancelProc
PDFLPrintCancelProc
ACCB1 ASBool ACCB2 PDFLPrintCancelProc (PDDoc pdDoc,void* clientData);
Description
This is called once per page of a document being printed.
In addition to giving the ability to cancel the print job, a developer can use this callback to return control briefly to an application to handle events, update UI elements, and so on. The library pauses printing until the return from this procedure, because it is single-threaded.
Parameters
Return Value
true to cancel the print job, false otherwise.
Header File
PDFLExpT.h
Related Callbacks
ASCancelProcCancelProc
Related Data
PDFLPrintUserParamsRec
Related Methods
None
pdDoc The document being printed.
clientData A pointer to the client data that was passed in the PDFLPrintUserParamsRec with the call to PDFLPrintDoc.
PDF Library Supplement to the Acrobat Core API Reference 86
PDF Library-specific CallbacksPDPrintCanEmitFontProc
PDPrintCanEmitFontProc
ACCB1 ASBool ACCB2 PDPrintCanEmitFontProc (PDFont fontP,PDPrintClient printClient);
Description
(Optional) Callback for PDPrintClient. Called to determine whether a font can be emitted into the print job. This is used to determine whether a font is a document-included resource. Only used for PostScript printing.
If NULL, the default is to assume that any font can be emitted.
Parameters
Return Value
true if client can emit specified font, false otherwise.
Header File
PDFLExpT.h
Related Methods
PDDocPrintPages
fontP The font to check.
printClient The PDPrintClient from which this is invoked.
PDF Library Supplement to the Acrobat Core API Reference 87
PDF Library-specific CallbacksPDPrintEmitFontProc
PDPrintEmitFontProc
ACCB1 ASBool ACCB2 PDPrintEmitFontProc (ASStm stm,PDFont fontP, PDPrintClient printClient);
Description
(Required) Callback for PDPrintClient. Emits a font. For Type0 fonts that require font substition this routine may emit multiple font definitions. The caller can get the list of fonts used by calling GetFontComponentList.
Parameters
Return Value
true if font emitted; false otherwise.
Header File
PDFLExpT.h
Related Methods
PDDocPrintPages
stm The PostScript print stream for the current page.
fontP Font to emit.
printClient The PDPrintClient from which this is invoked.
PDF Library Supplement to the Acrobat Core API Reference 88
PDF Library-specific CallbacksPDPrintEmitPrologResourceProc
PDPrintEmitPrologResourceProc
ACCB1 void ACCB2 PDPrintEmitPrologResourceProc (ASStm stm, ASInt32 resID, PDPrintClient printClient);
Description
(Required) Callback for PDPrintClient. Takes a resID and creates the PostScript prolog.
Parameters
Return Value
None
Header File
PDFLExpT.h
Related Methods
PDDocPrintPages
stm The PostScript print stream for the current page.
resID PostScript procset resource ID.
printClient The PDPrintClient from which this is invoked.
PDF Library Supplement to the Acrobat Core API Reference 89
PDF Library-specific CallbacksPDPrintGetFontEncodingMethodProc
PDPrintGetFontEncodingMethodProc
ACCB1 ASInt32 ACCB2 PDPrintGetFontEncodingMethodProc(PDFont fontP, PDPrintClient printClient);
Description
(Required for PostScript printing) Callback for PDPrintClient. Asks client which encoding method should be used for the font.
Parameters
Return Value
Encoding method, which must be one of the following:
● kPDDoReencode — Use for Type 1 fonts and substituted fonts.
● kPDDoNothing — Use for TrueType Windows font or built-in encoding font.
● kPDDoXlate — Use for a TrueType custom font or font with Macintosh encoding.
Header File
PDFLExpT.h
Related Methods
PDDocPrintPages
fontP The font whose encoding method is determined.
printClient The PDPrintClient from which this is invoked.
PDF Library Supplement to the Acrobat Core API Reference 90
PDF Library-specific CallbacksShouldCancel
ShouldCancel
ACCB1 ASBool ACCB2 ShouldCancel(PDPrintClient printClient);
Description
Callback for PDPrintClient. ShouldCancel is called at least once per page. It should return true if the print job should be cancelled (typically, the user hit key combination to cancel printing).
Parameters
Return Value
true if the print job should be cancelled, false otherwise.
Header File
PDFLExpT.h
Related Methods
PDDocPrintPages
printClient The PDPrintClient from which this is invoked.
PDF Library Supplement to the Acrobat Core API Reference 91
PDF Library-specific CallbacksTKResourceAcquireProc
TKResourceAcquireProc
ACCB1 void* ACCB2 TKResourceAcquireProc (char* resourceName,ASInt32 resType, void* registry, ASInt32* size,void* clientData, ASStm* rdStm);
Description
Callback in TKResourceProcs structure in the Adobe PDF Library. Acquires the specified resource and use it to fill in the rdStm parameter.
Parameters
Return Value
A void* of data that you want returned to you in TKResourceReleaseProc. This data can be used to determine what Resource to release. You can return NULL from TKResourceAcquireProc.
Header File
PDFInit.h
resourceName Name of resource to acquire.
resType One of the following from the resType enum: resCMapDataresCharTypeDataresCharRangeDataresFontPropDataresCJKNoteFontNormalresCJKNoteFontBoldresCJKNoteFontObliqueresFontDataresCMapLastID
registry One of the following.● Adobe-Japan1—Japanese● Adobe-Korea1—Korean● Adobe-CNS1—Traditional Chinese● Adobe-GB1—Simplified Chinese
size (Filled by the callback) Size of the ASStm returned.
clientData A pointer to the clientData specified in the TKResourceProcs structure.
rdStm (Filled by the callback) An ASStm for the data requested.
PDF Library Supplement to the Acrobat Core API Reference 92
PDF Library-specific CallbacksTKResourceAcquireProc
Related Callbacks
TKResourceReleaseProc
Related Methods
PDFLInit
PDF Library Supplement to the Acrobat Core API Reference 93
PDF Library-specific CallbacksTKResourceReleaseProc
TKResourceReleaseProc
ACCB1 void ACCB2 TKResourceReleaseProc (ASStm rdStm,void* data, void* clientData);
Description
Callback in TKResourceProcs structure in the Adobe PDF Library. Releases the resources previously acquired and closes the ASStm passed in as rdStm.
Parameters
Return Value
None
Header File
PDFInit.h
Related Callbacks
PMSetTextProc
Related Methods
PDFLInit
rdStm An ASStm for the resource to release and close with ASStmClose.
data The clientData returned from PMSetTextProc.
clientData A pointer to the clientData specified in the TKResourceProcs structure.
PDF Library Supplement to the Acrobat Core API Reference 94
PDF Library-specific CallbacksUndefineFont
UndefineFont
ACCB1 ASBool ACCB2 UndefineFont (ASStm stm, PDFont fontP, ASBool vmUndefine, PDPrintClient client)
Description
(Required) UndefineFont is called to remove the font from the list of fonts that have been downloaded and to undefine the font from PostScript VM. It may be called during a page, at the end of the page, or between pages. After this routine is called, if the font is required again, the EmitFont routine will be called.
Parameters
Return Value
true on success.
Header File
PDFLExpT.h
Related Methods
PDDocPrintPages
stm Stream to which the PostScript code to undefine the font will be written.
fontP PDFont for the font to be removed.
vmUndefine If true and this is a level 2 or greater PostScript interpreter, PostScript code will be emitted to undefine the font. If false, then it will just be removed from the list of fonts that have already been downloaded.
printClient The PDPrintClient from which this is invoked.
PDF Library Supplement to the Acrobat Core API Reference 95
PDF Library-specific Declarations
ASExtensionPhase
enum{
ASExtensionPhase_LOADING,ASExtensionPhase_EXPORTING,ASExtensionPhase_IMPORTING,ASExtensionPhase_INITIALIZING,ASExtensionPhase_UNLOADING
};typedef ASInt16 ASExtensionPhase;
Description
Selector indicating what phase of loading is happening.
Header File
PDFInit.h
Related Methods
None
Members
ASExtensionPhase_LOADING Loading phase.
ASExtensionPhase_EXPORTING Exporting phase.
ASExtensionPhase_IMPORTING Importing phase.
ASExtensionPhase_INITIALIZING Initializing phase.
ASExtensionPhase_UNLOADING Unloading phase.
PDF Library Supplement to the Acrobat Core API Reference 96
PDF Library-specific DeclarationsASReal
ASReal
typedef float ASReal;
Description
Real number values.
Header File
ASExpT.h
Related Structures
ASRealPoint
PDF Library Supplement to the Acrobat Core API Reference 97
PDF Library-specific DeclarationsASRealPoint
ASRealPoint
typedef struct _t_ASRealPoint {ASReal h, v;
} ASRealPoint;
Description
Real number coordinate values.
Header File
ASExpT.h
Related Structures
PDPrintStr
PDF Library Supplement to the Acrobat Core API Reference 98
PDF Library-specific DeclarationsOPIDict
OPIDict
typedef struct {OPIversion version; /* 1.3 or 2.0 */union {
OPI13dict *dict13;OPI20dict *dict20;
} dict;} OPIdict;
Description
Used to specify an OPI dictionary.
Header File
PDFLExpT.h
Related Callbacks
OPIhandler
PDF Library Supplement to the Acrobat Core API Reference 99
PDF Library-specific DeclarationsPDDuplexEnum
PDDuplexEnum
enum {kPDDuplexOff,kPDDuplexOnTumbleShort,kPDDuplexOnTumbleLong
};typedef ASEnum8 PDDuplexEnum;
Description
Duplex values.
Header File
PDFLExpT.h
Related Structures
PDPrintParams
PDF Library Supplement to the Acrobat Core API Reference 100
PDF Library-specific DeclarationsPDFarEastFont
PDFarEastFont
enum {PDPDFarEastFont_Download_All,PDPDFarEastFont_Download_None,PDPDFarEastFont_Print_As_Image
};typedef ASEnum8 PDFarEastFont;
Description
CJK font related option for PostScript printing.
Header File
PDFLExpT.h
Members
PDPDFarEastFont_Download_All Download all CJK fonts to printer.
PDPDFarEastFont_Download_None Download only embedded fonts to printer.
PDPDFarEastFont_Print_As_Image GDI/QuickDraw on PostScript option. PostScript should use this to print CJK
PDF Library Supplement to the Acrobat Core API Reference 101
PDF Library-specific DeclarationsPDFlatten
PDFlatten
PDFlattenRec
typedef struct {PDFlattenTilingMode tilingMode; ASBool useTextOutlines; ASBool allowShadingOutput;ASBool allowLevel3ShadingOutput;float internalDPI; float externalDPI; float pathDPI; ASUns32 tileSizePts; ASUns32 maxFltnrImageSize; ASUns32 adaptiveThreshold; ASBool preserveOverprint;
} PDFlattenRec, *PDFlatten;
Description
Controls tile flattening. Primarily of interest to resource limited (embedded) systems developers.
Header File
PDFLExpT.h
Members
tilingMode 0 = no tiling; 1 = constant tiling; 2 = adaptive tiling.
useTextOutlines Output text outlines instead of native text.
allowShadingOutput Allow shading ouput.
allowLevel3ShadingOutput Allow level 3 shading output.
internalDPI Resolution for flattening interior of atomic region.
externalDPI Resolution for flattening edges of atomic regions.
pathDPI Flattener path resolution, default is 800.
tileSizePts Target tile size in points.
maxFltnrImageSize Maximum image size when flattening. Default is 0.
PDF Library Supplement to the Acrobat Core API Reference 102
PDF Library-specific DeclarationsPDFlatten
Related Types
PDPrintParams
adaptiveThreshold Adaptive flattening threshold.
preserveOverprint Attempt to preserve overprint.
PDF Library Supplement to the Acrobat Core API Reference 103
PDF Library-specific DeclarationsPDFlattenTilingMode
PDFlattenTilingMode
typedef ASInt32 PDFlattenTilingMode;enum { kPDNoTiling = 0, kPDConstantTiling, kPDAdaptiveTiling, _MAX_FLATTENTILINGMODE = PDMAXENUM};
Description
Support for tiled flattening.
Header File
PDFLExpT.h
Members
kPDNoTiling No tiling.
kPDConstantTiling Constant tiling.
kPDAdaptiveTiling Adaptive tiling.
PDF Library Supplement to the Acrobat Core API Reference 104
PDF Library-specific DeclarationsPDFLData
PDFLData
Windows
typedef struct _t_PDFLData {ASSize_t size;ASUns32 flags;HINSTANCE inst;char** dirList;ASInt32 listLen;TKAllocatorProcsP allocator;TKResourceProcsP resProcs;TKExtensionProcsP extProcs;
} PDFLDataRec, *PDFLData;
Mac OS
typedef struct _t_PDFLData {ASSize_t size;ASUns32 flags;FSSpec** dirList;ASInt32 listLen;TKAllocatorProcsP allocator;short resFile;TKResourceProcsP resProcs;TKExtensionProcsP extProcs;
} PDFLDataRec, *PDFLData;
UNIX
typedef struct _t_PDFLData {ASSize_t size;ASUns32 flags;char** dirList;ASInt32 listLen;TKAllocatorProcsP allocator;TKResourceProcsP resProcs;TKExtensionProcsP extProcs;
} PDFLDataRec, *PDFLData;
Description
(Present only in Adobe PDF Library 1.0 or later)
Structure for PDFLInit.
Header File
PDFInit.h
PDF Library Supplement to the Acrobat Core API Reference 105
PDF Library-specific DeclarationsPDFLData
Related Methods
PDFLGetFlagsPDFLInit
Members
size Size of the data structure. Must be set to sizeof(PDFLDataRec).
flags The only flag currently supported is kPDFLInitIgnoreDefaultDirectories. When this flag is set, the initialization process does not search through the default font directories, but only in those specified in dirList.
inst(Windows only)
Location of resources for the Library. For a static library, you link them into your application and use NULL for inst. For a DLL version of the library, call LoadLibrary on the DLL and set inst equal to the HINSTANCE returned:libData.inst = LoadLibrary("PDFL50.DLL");
If you are linking the static library into a DLL, pass the HINSTANCE passed into DllMain or WinMain for inst and link the resources into the DLL.Free the HINSTANCE with FreeLibrary after you call PDFLTerm.
dirList List of directories with fonts. Here is an example for Windows:libData.listLen=3L;libData.dirList=(ASPathName *)malloc(sizeof(ASPathName)*3);
libData.dirList[0]=(ASPathName)"c:\\PSFonts";libData.dirList[1]=(ASPathName)"c:\\Fonts";libData.dirList[2]=(ASPathName)"c:\\CMap";
listLen Number of directories listed in dirList.
allocator The structure containing function pointers for memory allocation callbacks. The library manages its own memory. Most applications linking with the library should pass NULL for this member. Applications wishing more control over memory allocation can fill out this structure and will be responsible for providing and freeing memory as well as reporting available memory as requested by the library.
resFile(MacOS only)
Resources location, if they are not in the application itself. Set them using OpenResFile:libData.resFile = OpenResFile("\pMyResFileGoesHere")
PDF Library Supplement to the Acrobat Core API Reference 106
PDF Library-specific DeclarationsPDFLData
resProcs The structure containing function pointers for resource management callbacks. The library manages its own resources. Most applications linking with the library should pass NULL for this member. Applications wishing more control over resource allocation can fill out this structure and will be responsible for providing and freeing resources requested by the library.
extProcs The structure containing function pointers for ASExtension callbacks used by the PDF Library.
PDF Library Supplement to the Acrobat Core API Reference 107
PDF Library-specific DeclarationsPDFLPrintUserParamsRec
PDFLPrintUserParamsRec
Unix
typedef struct {ASInt32 size; PDPrintParams printParams; ASBool emitToFile; ASStm printStm; ASUns16 paperWidth;ASUns16 paperHeight; ASInt32 dontEmitListLen; char** dontEmitList;ASBool emitToPrinter; char* command; PDFLPrintCancelProc cancelProc;void* clientData;
} PDFLPrintUserParamsRec, *PDFLPrintUserParams;
Windows
typedef struct {ASInt32 size; ASBool emitToFile; PDPrintParams printParams;ASStm printStm; ASUns16 paperWidth;ASUns16 paperHeight; ASInt32 dontEmitListLen; char** dontEmitList; ASBool emitToPrinter; char* inFileName;char* outFileName;char* deviceName;char* driverName;char* portName;DEVMODE* pDevMode;int startPage;int endPage;int shrinkToFit;int printAnnots;int psLevel;int nCopies;int binaryOK;int emitHalftones;
PDF Library Supplement to the Acrobat Core API Reference 108
PDF Library-specific DeclarationsPDFLPrintUserParamsRec
int reverse;int farEastFontOpt;int transQuality;int doOPP;PDFLPrintCancelProc cancelProc;void* clientData;
} PDFLPrintUserParamsRec, *PDFLPrintUserParams;
MacOS
typedef struct {ASInt32 size; ASBool emitToFile;PDPrintParams printParams;ASStm printStm;ASUns16 paperWidth;ASUns16 paperHeight;ASInt32 dontEmitListLen;char** dontEmitList;ASBool emitToPrinter;void* printRecord;void* printession;void* printSettings;void* pageFormat;PDFLPrintCancelProc cancelProc;void* clientData;
} PDFLPrintUserParamsRec, *PDFLPrintUserParams;
Description
Used to control printing with PDFLPrintDoc. See PDFLPrint.h for details on printing on specific platforms.
N O T E : UNIX supports only PostScript, to file or printer, as controlled by the (mutually exclusive) emitToFile and emitToPrinter parameters.
Header File
PDFLPrint.h
Related Callbacks
PDFLPrintCancelProc
Related Methods
PDFLPrintDoc
PDF Library Supplement to the Acrobat Core API Reference 109
PDF Library-specific DeclarationsPDFLPrintUserParamsRec
Members
Unix
size Size of the data structure. Must be set to sizeof(PDFLPrintUserParamsRec).
printParams PDPrintParams structure. Used for both creating a PostScript file and printing to a printer.
emitToFile Create a PostScript file. You set either this parameter or emitToPrinter, but not both.
printStm Writable ASStm that points to file stm or proc stm. Applies to both PostScript printer and file.
paperWidth Width of paper in points. The default value is 612. Applies to PostScript printer.
paperHeight Height of paper in points. The default value is 792. Applies to PostScript printer.
dontEmitListLen Number of fonts that should not be downloaded. Applies to both PostScript printer and file.
dontEmitList List of fonts (T1, TT, CID) that should not be downloaded. Applies to both PostScript printer and file.
emitToPrinter Output PDF file to a PostScript printer. You set either this parameter or emitToFile, but not both.
command Optional command line arguments; used only if emitToPrinter is true. For example, “lp” or “lpr.” Applies to PostScript printer.
cancelProc Optional PDFLPrintCancelProc. Applies to both PostScript printer and file.
clientData Optional pointer to data passed to cancelProc. Applies to both PostScript printer and file.
Windows
size Size of the data structure. Must be set to sizeof(PDFLPrintUserParamsRec).
emitToFile Create a PostScript file. You set either this parameter or emitToPrinter, but not both.
printParams PDPrintParams structure. Applies to PostScript file.
PDF Library Supplement to the Acrobat Core API Reference 110
PDF Library-specific DeclarationsPDFLPrintUserParamsRec
printStm Writable ASStm that points to file stm or proc stm. Applies to PostScript file.
paperWidth Width of paper in points. The default value is 612. Applies to printer.
paperHeight Height of paper in points. The default value is 792. Applies to printer.
dontEmitListLen Number of fonts that should not be downloaded. Applies to PostScript printer or file.
dontEmitList List of fonts (T1, TT, CID) that should not be downloaded. Applies to PostScript printer or file.
emitToPrinter Output PDF file to either a PostScript printer or a non-PostScript printer. Set either this parameter or emitToFile, but not both.
inFileName Used for the Windows DOCINFO structure — lpszDocName that points to a null-terminated string that specifies the name of the document. Applies to printer.
outFileName Used for the Windows DOCINFO structure — lpszOutput. It points to a null-terminated string that specifies the name of an output file. If this pointer is NULL, the output will be sent to the device identified by deviceName, driverName, and portName. Applies to printer.
deviceName Name of device to print to. For example, “Distiller Assistant v3.01”. Available devices can be found in the Windows Registry at HKEY_CURRENT_USER\Software\Microsoft\WindowsNT\CurrentVersion\Devices. Applies to printer.
driverName Name of driver. For example, “winspool”. See registry key for deviceName. Applies to printer.
portName Name of Port. For example, “Ne00” See registry key for deviceName. Applies to printer.
Windows
PDF Library Supplement to the Acrobat Core API Reference 111
PDF Library-specific DeclarationsPDFLPrintUserParamsRec
pDevMode (Optional) Allows you to pass a DEVMODE structure in if you have one. Applies to printer. If you do not pass in your own DEVMODE structure, PDFL creates its own by calling OpenPrinter(), DocumentProperties(), and ClosePrinter(). PDFL never calls SetPrinter() and has no facility to offer the features provided by SetPrinter() (e.g., pause/resume, deleting jobs, changing printer status, etc.). DocumentProperties() is called only in the case where the client doesn’t provide a DEVMODE.
N O T E : If you provide your own DEVMODE, you will certainly want to call DocumentProperties() to populate it and/or display the print dialog.
startPage Page to start printing with, 0-based. Applies to printer.
endPage Page to finish printing on. Applies to printer.
shrinkToFit 1 turns on shrink to fit, 0 turns it off. Applies to PostScript printer.
printAnnots 1 turns on printing annots, 0 turns it off. Applies to printer.
psLevel PostScript level. Applies to PostScript printer.
nCopies Number of copies to print. Applies to printer.
binaryOK 1 turns on binary data, 0 turns it off. Applies to PostScript printer.
emitHalftones 1 turns on emit half-tones, 0 turns it off. Applies to PostScript printer.
reverse 1 reverses print order, 0 does regular order. Applies to printer.
farEastFontOpt One of PDFarEastFont.The default value is PDPDFarEastFont_Download_All. Applies to PostScript printer.
transQuality Transparency flattening quality control. 1 is fastest; 5 is best. Applies to printer.
doOPP 1 uses OverPrint Preview, 0 does not. Applies to printer.
cancelProc Optional PDFLPrintCancelProc. Applies to all.
clientData Optional pointer to data passed to cancelProc. Applies to all.
Windows
PDF Library Supplement to the Acrobat Core API Reference 112
PDF Library-specific DeclarationsPDFLPrintUserParamsRec
Macintosh
size Size of the data structure. Must be set to sizeof(PDFLPrintUserParamsRec).
emitToFile Create a PostScript file. You set either this parameter or emitToPrinter, but not both.
printParams PDPrintParams structure. Applies to PostScript file.
printStm Writable ASStm that points to file stm or proc stm.
paperWidth Width of paper in points. The default value is 612. Applies to printer.
paperHeight Height of paper in points. The default value is 792. Applies to printer.
dontEmitListLen Number of fonts that should not be downloaded. Applies to PostScript printer and file.
dontEmitList List of fonts (T1, TT, CID) that should not be downloaded. Applies to PostScript printer and file.
emitToPrinter Output PDF file to either a PostScript or a non-PostScript printer. You set either this parameter or emitToFile, but not both.
printRecord Classic print record handle (THPrint) - may be NULL Applies to printer.
printSession Carbon print session - may be NULL . Applies to printer.
printSettings Carbon print settings - may be NULL. Applies to printer.
pageFormat Carbon page format - may be NULL. Applies to printer.
cancelProc Optional PDFLPrintCancelProc. Applies to all.
clientData Optional pointer to data passed to cancelProc. Applies to all.
PDF Library Supplement to the Acrobat Core API Reference 113
PDF Library-specific DeclarationsPDFontDownloadContext
PDFontDownloadContext
typedef struct _t_PDFontDownloadContext *PDFontDownloadContext;
Description
Maintains information about the current print job and what fonts have been downloaded.
Header File
PDFLExpt.h
Related Methods
PDFontDownloadContextCreatePDFontDownloadContextDestroy
PDF Library Supplement to the Acrobat Core API Reference 114
PDF Library-specific DeclarationsPDFontStyle
PDFontStyle
enum {PDRoman = 0,PDItalic,PDBold,PDBoldItalic
};typedef ASUns8 PDFontStyle;
Description
Specifies a synthetic font style.
Header File
PDFLExpt.h
Related Types
PDPrintFontRec
PDF Library Supplement to the Acrobat Core API Reference 115
PDF Library-specific DeclarationsPDInclusion
PDInclusion
typedef ASEnum8 PDInclusion;enum {
kIncludeOncePerDoc,kIncludeOnEveryPage,kIncludeNever
};
Description
Specifies how to include a resource in a file.
Header File
PDFLExpt.h
Related Types
PDPrintParams
Related Methods
None
Members
kIncludeOncePerDoc Include the resource only once per file.
kIncludeOnEveryPage Include the resource on every page in the file.
kIncludeNever Never include the resource.
kIncludeWhenNeeded When needed.
PDF Library Supplement to the Acrobat Core API Reference 116
PDF Library-specific DeclarationsPDOutputType
PDOutputType
typedef ASEnum8 PDOutputType;enum {
PDOutput_PS, PDOutput_EPSNoPrev, PDOutput_EPSMacStdPrev, PDOutput_EPSMacExtPrev
};
Description
Specifies what kind of file to emit.
Header File
PDFLExpt.h
Related Types
PDPrintParams
Related Methods
None
Members
PDOutput_PS Emit a PostScript file.
PDOutput_EPSNoPrev Emit an EPS file with no preview.
PDOutput_EPSMacStdPrev Emit an EPS file with standard preview.
PDOutput_EPSMacExtPrev Emit an EPS file with extended preview.
PDF Library Supplement to the Acrobat Core API Reference 117
PDF Library-specific DeclarationsPDPageDrawSmoothFlags
PDPageDrawSmoothFlags
typedef ASUns32 PDPageDrawSmoothFlags;enum {
kPDPageDrawSmoothText = 0x00000001,kPDPageDrawSmoothLineArt = 0x00000002,kPDPageDrawSmoothImage = 0x00000004
};
Description
Bit flags indicating how a page is rendered.
Header File
PDFLExpt.h
Related Types
PDPageDrawFlags
Related Methods
PDPageDrawContentsToMemory
Members
kPDPageDrawSmoothText Draw smooth text.
kPDPageDrawSmoothLineArt Draw smooth line art.
kPDPageDrawSmoothImage Draw smooth image.
PDF Library Supplement to the Acrobat Core API Reference 118
PDF Library-specific DeclarationsPDPageMarkFlags
PDPageMarkFlags
typedef ASUns32 PDPageMarkFlags;enum {
kPDPageEmitColorBars = 0x0001,kPDPageEmitRegMarks = 0x0002,kPDPageEmitCropMarks = 0x0004,kPDPageEmitBleedMarks = 0x0008,kPDPageEmitPageInfo = 0x0010,kPDPageEmitTrimMarks = 0x0020,kPDPageEmitSlurMarks = 0x0040
};
Description
Bit flags indicating which page marks are emitted for color separations.
Header File
PDFLExpt.h
Related Types
PDPrintParams
Related Methods
PDFLPrintDocPDPageEmitPSOrient
AVDocPrintSeparationsPDPageMakeSeparations
PDF Library Supplement to the Acrobat Core API Reference 119
PDF Library-specific DeclarationsPDPrintClient
PDPrintClient
PDPrintClientRec
typedef struct _t_PDPrintClient {ASSize_t size;PDDoc pdDoc;PDPrintParams params;
/* CONTROL STRUCTURE: Print methods called in this order */DocBegin;DocSetup;EndSetup;NotifyNewPage;PageBegin;PageSetup;PageSetupPostResource;PageCleanup;EmitPageContents;PageEnd;DocEnd;
/* END OF CONTROL STRUCTURE */PDPrintGetFontEncodingMethodProc GetFontEncodingMethod;GetFontVMUsage;EmitPSFontBegin;EmitPSFontEnd;EmitPSFontEncodingBegin;EmitPSFontEncodingEnd;EmitPSResourceBegin;EmitPSResourceEnd;ShouldCancelCancelPrintJobFlushString;EmitPrologString;PDPrintEmitPrologResourceProc EmitPrologResource;PDPrintCanEmitFontProc CanEmitFont;PDPrintEmitFontProc EmitFont;EmitFontProcSet;EmitGlyphsIncr;GetComponentFontList;FlushIncrGlyphList;OPIhandler;DataSourceString;
PDF Library Supplement to the Acrobat Core API Reference 120
PDF Library-specific DeclarationsPDPrintClient
ASInt32 sequentialPageNum;void* clientData;void* fontDownloadContext;ASInt32 vmUsed;
} PDPrintClientRec, *PDPrintClient;
Description
Data structure used by PDDocPrintPages. Contains methods to be implemented by the client. Unless otherwise indicated, methods may be NULL, indicating that they do nothing. The methods are called in the order listed in this structure.
Header File
PDFLExpT.h
Related Methods
PDDocPrintPagesPDFontPSEmitGlyphsIncrPDFontPSFlushIncrGlyphListPDFontPSGetComponentFontList
Members
size Size of the structure.
pdDoc The document to print.
params A control structure describing how to print the document.
callbacks See individual descriptions.
sequentialPageNum Current page, starting at 1.
clientData Data for the client's use. This data is passed to the OPIhandler and DataSourceString methods.
fontDownloadContext For client's use to hold a font download context for the EmitFontProcSet.
vmUsed Amount of virtual memory used. Incremented by routines that download fonts and resources.
PDF Library Supplement to the Acrobat Core API Reference 121
PDF Library-specific DeclarationsPDPrintFontArray
PDPrintFontArray
PDPrintFontArrayP
typedef struct {
ASUns32 count;ASBool usesDisplayCTFont;PDPrintFontP arr;
} PDPrintFontArray, *PDPrintFontArrayP;
Description
An array of font pointers for use in PDFontPSGetComponentFontList.
Header File
PDFLExpt.h
Related Methods
PDFontPSGetComponentFontList
Members
count The number of fonts in arr.
usesDisplayCTFont Whether to use the Display CT Font.
arr The font array.
PDF Library Supplement to the Acrobat Core API Reference 122
PDF Library-specific DeclarationsPDPrintFontP
PDPrintFontP
PDPrintFontRec
typedef struct{
const char *name; const char *encoding;const char *cidFontName;ASInt16 style;PDFontStyle syntheticStyle;ASBool used;ASBool emitted;ASInt32 baseLineAdj;
} PDPrintFontRec, *PDPrintFontP;
Description
Font array.
Header File
PDFLExpt.h
Related Type
PDPrintFontArray
Members
name The font name.
encoding The font encoding.
cidFontName CID font name.
style Gothic or Mincho
syntheticStyle Roman, Italic, Bold, or BoldItalic.
used Set to true if glyphs from this component are used.
emitted Set to true if this component is emitted.
baseLineAdj Baseline adjustment.
PDF Library Supplement to the Acrobat Core API Reference 123
PDF Library-specific DeclarationsPDPrintParams
PDPrintParams
PDPrintParamsRec
typedef struct {ASSize_t size;PDPageRange* ranges; ASInt32 numRanges;ASBool shrinkToFit;ASBool expandToFit;ASBool rotateAndCenter;ASBool emitAnnotForms; ASBool emitPS; ASInt32 psLevel;PDOutputType outputType; PDInclusion incBaseFonts;PDInclusion incEmbeddedFonts; PDInclusion incType1Fonts; PDInclusion incType3Fonts; PDInclusion incTrueTypeFonts;PDInclusion incCIDFonts; PDInclusion incProcsets; PDInclusion incOtherResources;ASInt32 fontPerDocVM; ASBool emitShowpage;ASBool emitTTFontsFirst;ASBool setPageSize;ASBool emitDSC;ASBool setupProcsets;ASBool emitColorSeps;ASBool binaryOK;ASBool emitRawData;ASBool TTasT42;float scale;ASBool emitExternalStreamRef;ASBool emitHalftones;ASBool centerCropBox;ASBool emitSeparableImagesOnly;ASBool emitExtGState;ASFixedRect boundingBox;ASBool useFontAliasNames;ASBool emitPageRotation;
PDF Library Supplement to the Acrobat Core API Reference 124
PDF Library-specific DeclarationsPDPrintParams
/* New for PDF 1.3 */ASBool emitBBoxClip;ASBool reverse;ASFixedRect* tCropBox;ASBool emitPageClip;ASBool emitTransfer; ASBool emitBG;ASBool emitUCR;PDFarEastFont farEastFontOpt;ASBool suppressCJKSubstitution;float flexoX;float flexoY;ASBool suppressCSA;ASBool hostBased;ASAtom hostBasedOutputCS;PDDuplexEnum duplex;PDTile tileInfo;ASBool rotate;ASBool hostBasedCM;char destProfile[256];ASAtom destCSAtom;ASBool saveVM;ASInt32 transQuality;ASBool doOPP;ASBool optimizeForSpeed;ASBool brokenCRDs;ASBool useMaxVM;ASInt32 lastWidth;ASInt32 lastHeight;
/* New for PDF 1.4 */ASUns32 bitmapResolution;ASUns32 gradientResolution;ASUns32 transparencyQuality; PDOCContext ocContext; ASBool applyOCGPrintOverrides; ASBool useFullResolutionJP2KData;ASBool emitInRipSeps; PDPageMarkFlags whichMarks; ASBool westernMarksStyle; ASBool doProofing; ASBool useExecForm;PDFlatten flattenInfo;ASBool negative;
PDF Library Supplement to the Acrobat Core API Reference 125
PDF Library-specific DeclarationsPDPrintParams
ASEnum8 mirrorprint; ASUns32 numCollatedCopies; /* MacOS only */
} PDPrintParamsRec, *PDPrintParams;
Description
Data structure indicating how a document should be printed.
N O T E : All fields in the PDPrintParams structure apply only to PostScript file creation. PDPrintParams are ignored when printing to non-PostScript devices.
Header File
PDFLExpT.h
Related Methods
PDFLPrintDoc
Members
size Size of the data structure. Must be set to sizeof(PDPrintParams).
ranges Ranges of pages to print. Use NULL to print the entire document.
numRanges Number of ranges of pages to print in ranges. The default value is 0.
shrinkToFit true if the page is scaled to fit the printer page size, false otherwise. This field overrides scale. The default value is false.
expandToFit true if small pages are to be scaled up to fit the printer page size, false otherwise. Overrides scale. The default value is false.
rotateAndCenter true if page is to be rotated to fit printer’s orientation, and centered in printer’s page size; false otherwise.The default value is false. Rotation and centering (true) only occur, however, if the page contents are too wide to fit on a narrow page (or vice versa) and the page contents are less than an inch smaller than the target page in one direction.
emitAnnotForms Emit annotations that contain a Form XObject. The default value is true.
emitPS If true, emit a PostScript file. The default value is true.
PDF Library Supplement to the Acrobat Core API Reference 126
PDF Library-specific DeclarationsPDPrintParams
psLevel PostScript level: 1, 2, or 3. The default value is 2.
outputType Print PostScript or EPS with or without a preview.
N O T E : EPS preview generation is not currently available on UNIX.
N O T E : For fonts, the following 6 parameters are applied in the order in which they are appear in this table. For example, an embedded Type 1 font follows the rule for embedded fonts, not the rule for Type 1 fonts.
incBaseFonts Embed the base fonts. The default value is kIncludeNever.
incEmbeddedFonts Embed fonts that are embedded in the PDF file. This overrides the incType1Fonts, incTrueTypeFonts, and incCIDFonts fields. The default value is kIncludeOncePerDoc.
incType1Fonts Embed Type 1 fonts. The default value is kIncludeOncePerDoc.
incType3Fonts Embed Type 3 fonts. The default value is kIncludeOnEveryPage.
N O T E : This parameter must always be set to kIncludeOnEveryPage. PDF files exist with Type 3 fonts that contain different encodings on different pages.
incTrueTypeFonts Embed TrueType fonts. The default value is kIncludeOncePerDoc.
incCIDFonts Embed CID fonts. The default value is kIncludeOncePerDoc.
incProcsets Include Procsets in the file. The default value is kIncludeOncePerDoc.
incOtherResources Include all other types of resources in the file. The default value is kIncludeOncePerDoc.
fontPerDocVM Amount of VM available for font downloading at the document level. Ignored if <=0.
N O T E : This must be set to 0 for the toolkit; it is only used by the viewer.
emitShowpage Emit save and restore showpage in PostScript files. The default value is true.
PDF Library Supplement to the Acrobat Core API Reference 127
PDF Library-specific DeclarationsPDPrintParams
emitTTFontsFirst Emit TrueType fonts before any other fonts. The default value is false.
setPageSize (PostScript level 2 only) Set the page size on each page. Use the media box for outputting to PostScript files, use the crop box for EPS files. Default is false.
emitDSC Write DSC (Document Structuring Conventions) comments. The default value is true.
setupProcsets If procsets are included, also include init/term code. The default value is true.
N O T E : This must be set to true for the toolkit.
emitColorSeps Emit images for Level-1 separations. The default value is false.
binaryOK true if binary data is permitted in the PostScript file, false otherwise. The default value is true.
emitRawData true if add no unnecessary filters when emitting image data, false otherwise. The default value is true.
TTasT42 If including TrueType fonts, convert to Type 42 fonts instead of Type 1 fonts. The default value is false.
scale Document-wide scale factor. 100.0 = full size. The default value is 100.
emitExternalStreamRef If an Image resource uses an external stream, emit code that points to the external file. The default value is false.
N O T E : This must be set to false.
emitHalftones Preserve any halftone screening in the PDF file. The default value is false.
centerCropBox true if CropBox output is centered on the page when the CropBox < MediaBox, false otherwise. The default value is true.
emitSeparableImagesOnly If emitting EPS, include only CMYK and gray images.
emitExtGState Omit all extended graphic state parameters. This overrides emitHalftones. If false, halftones are not emitted. The default value is true.
PDF Library Supplement to the Acrobat Core API Reference 128
PDF Library-specific DeclarationsPDPrintParams
boundingBox If all zeroes, is ignored. Otherwise, is used for %%BoundingBox DSC comment and in centerCropBox calculations and for setpagedevice. The default value is [0 0 0 0].
useFontAliasNames Used when printing with system fonts. The default value is false.
emitPageRotation Emit a concat at the beginning of each page so that the page is properly rotated. Used when emitting EPS. The default value is false.
emitBBoxClip If true, emit a clipping box the size of the bounding box when printing an EPS file. This fixes problems with EPS files from certain applications.
reverse If set to true, reverse the order of page output.
tCropBox Temporary crop box to represent selected region.
emitPageClip Emit page clip.
emitTransfer Emit transfer.
emitBG Emit black generation.
emitUCR Emit undercolor removal.
farEastFontOpt GDI to PS or download CJK fonts.
suppressCJKSubstitution If true, do not do CJK substitution on the printer. This has an impact only when farEastFontOpt is PDPDFarEastFont_Download_None.
flexoX X, Y scale factors for anamorphic scaling. “flexo” refers to a market that prints on plastic media that stretches (e.g., toothpaste tubes)flexoY
suppressCSA Don't emit CSAs for 4 component (CMYK) colors.
hostBased For separator, do host-based color management.
hostBasedOutputCS The output color space when hostBased color management is true.
duplex For compatibility with IronCity.
tileInfo If non-NULL, tiling is desired with these parameters.
PDF Library Supplement to the Acrobat Core API Reference 129
PDF Library-specific DeclarationsPDPrintParams
rotate Enable the auto-rotating behavior from past versions of Acrobat.
hostBasedCM Default: false, do CSA generation for profiles instead of converting all colors on the host.
destProfile[256] If hostBase color management is true, use this profile.
destCSAtom An ASAtom representing the device color space (DeviceGray, DeviceRGB, etc.)
saveVM true means try to save VM when printing to PostScript.
transQuality Parameters for the flattener, 1 - 5, similar to what Illustrator does.
doOPP Do the overprint preview operation.
optimizeForSpeed If true, do it fast; false means PostScript code must be page independent. If set to true, font downloads are forced from kIncludeOnEveryPage to kIncludeOncePerDoc (see PDFLExpT.h)
brokenCRDs If true, don't set rendering intent in PostScript stream due to broken non-default CRDs.
useMaxVM If true, store all possible resources in VM.
lastWidth Used when setPageSize is true to prevent unneeded setpagedevice calls.
lastHeight Used when setPageSize is true to prevent unneeded setpagedevice calls.
bitmapResolution DPI for bitmaps. Default is 300.
gradientResolution DPI for gradients interior to the object (not edges). Can generally be lower than the bitmapResolution. Default is 150.
transparencyQuality The transparency level. Range is 1-100.
ocContext The optional-content context to use for visibility state information, or NULL to use the document's current states in the default context.
applyOCGPrintOverrides When true, apply print-specific visibility state settings from the optional-content group.
PDF Library Supplement to the Acrobat Core API Reference 130
PDF Library-specific DeclarationsPDPrintParams
useFullResolutionJP2KData Whether to use the maximum available JPEG2000 resolution.
emitInRipSeps When true, requests that separations, one sheet per ink, be generated in the RIP (printer).
whichMarks Page mark indication. A bit-wise OR of the PDPageMarkFlags values. Applies to print separations, which are available only in Adobe Acrobat Professional.
westernMarksStyle When true, use western style for page marks.Applies to print separations, which are available only in Adobe Acrobat Professional.
doProofing When true, print using proofing settings.
useExecForm When true, emit execform calls when emitting Form XObjects
flattenInfo A structure containing parameters that control tile flattening.
negative When true, invert the plate.
mirrorprint One of the following constants:kPDPrintFlipNone = 0x01, kPDPrintFlipX = 0x02, kPDPrintFlipY = 0x04, kPDPrintFlipXY = 0x08
Mirroring is done in the PostScript output stream.
numCollatedCopies MacOS only. Enables collation for viewer.
PDF Library Supplement to the Acrobat Core API Reference 131
PDF Library-specific DeclarationsPDPrintStr
PDPrintStr
PDPrintStrP
typedef struct {
char *str;ASUns32 len;ASRealPoint *displacements;ASUns32 numGlyphs;ASUns32 flags;
} PDPrintStr, *PDPrintStrP;
Description
Structure for controlling the printing of glyphs.
Header File
PDFLExpT.h
Related Methods
PDFontPSEmitGlyphsIncr
Members
str The string.
len Byte length.
displacements Displacements.
numGlyphs Number of glyphs.
flags Reserved for internal use.
PDF Library Supplement to the Acrobat Core API Reference 132
PDF Library-specific DeclarationsTKAllocatorProcs
TKAllocatorProcs
TKAllocatorProcsP
typedef struct _t_TKAllocatorProcs {ASMemAllocProc allocProc;ASMemReallocProc reallocProc;ASMemFreeProc freeProc;ASMemAvailProc memAvailProc;void* clientData;
} TKAllocatorProcs, *TKAllocatorProcsP;
Description
Structure for memory allocation callbacks used by the PDF Library.
Header File
PDFInit.h
Related Methods
PDFLInit
Members
allocProc Called when the PDF Library needs to allocate memory.
reallocProc Called when the PDF Library needs to reallocate a block of memory.
freeProc Called when the PDF Library needs to free a block of memory.
memAvailProc Called when the PDF Library needs to determine the amount of memory available.
clientData A pointer to data to pass into each of the memory management callbacks.
PDF Library Supplement to the Acrobat Core API Reference 133
PDF Library-specific DeclarationsTKExtensionProcs
TKExtensionProcs
TKExtensionProcsP
typedef struct _t_TKExtensionProcs {ASExtensionProgressProc progressProc;ASExtensionReportErrorProc reportErrProc;void *clientData;
} TKExtensionProcs, *TKExtensionProcsP;
Description
Structure containing function pointers for ASExtension callbacks used by the PDF Library.
Header File
PDFInit.h
Related Methods
PDFLInit
Members
progressProc Called when the PDF Library needs to allocate memory.
reportErrProc Called when the PDF Library needs to reallocate a block of memory.
clientData A pointer to data to pass into each of the memory management callbacks.
PDF Library Supplement to the Acrobat Core API Reference 134
PDF Library-specific DeclarationsTKResourceProcs
TKResourceProcs
TKResourceProcsP
typedef struct _t_TKResourceProcs {TKResourceAcquireProc acquireProc;TKResourceReleaseProc releaseProc;void* clientData;
} TKResourceProcs, *TKResourceProcsP;
Description
Structure for resource acquisition callbacks used by the PDF Library.
Header File
PDFInit.h
Related Methods
PDFLInit
Members
acquireProc Called when the PDF Library needs to acquire resources.
releaseProc Called when the PDF Library needs to release resources.
clientData A pointer to data to pass into every call to the PMSetTextProc or TKResourceReleaseProc as the clientData argument.