12.07.2015 Views

PDF Library Supplement to the Core API Reference - Datalogics

PDF Library Supplement to the Core API Reference - Datalogics

PDF Library Supplement to the Core API Reference - Datalogics

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

c<strong>PDF</strong> <strong>Library</strong><strong>Supplement</strong> <strong>to</strong> <strong>the</strong>Acrobat <strong>Core</strong> <strong>API</strong><strong>Reference</strong>Technical Note #5414Version: <strong>PDF</strong> <strong>Library</strong> 6.0ADOBE SYSTEMS INCORPORATEDCorporate Headquarters345 Park AvenueSan Jose, CA 95110-2704(408) 536-6000http://partners.adobe.comAugust 2003


Copyright 2003 Adobe Systems Incorporated. All rights reserved. Adobe® <strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> <strong>Core</strong> <strong>API</strong> <strong>Reference</strong>.If this guide is distributed with software that includes an end user agreement, this guide, as well as <strong>the</strong> software described in it, is furnished under licenseand may be used or copied only in accordance with <strong>the</strong> terms of such license. Except as permitted by any such license, no part of this guide may bereproduced, s<strong>to</strong>red in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, recording, or o<strong>the</strong>rwise, without <strong>the</strong> priorwritten permission of Adobe Systems Incorporated. Please note that <strong>the</strong> content in this guide is protected under copyright law even if it is not distributedwith software that includes an end user license agreement.Please remember that existing artwork or images that you may want <strong>to</strong> include in your project may be protected under copyright law. The unauthorizedincorporation of such material in<strong>to</strong> your new work could be a violation of <strong>the</strong> rights of <strong>the</strong> copyright owner. Please be sure <strong>to</strong> obtain any permissionrequired from <strong>the</strong> copyright owner.Any references <strong>to</strong> company names in sample templates are for demonstration purposes only and are not intended <strong>to</strong> refer <strong>to</strong> any actual organization.PostScript is a registered trademark of Adobe Systems Incorporated. All instances of <strong>the</strong> name PostScript in <strong>the</strong> text are references <strong>to</strong> <strong>the</strong> PostScriptlanguage as defined by Adobe Systems Incorporated unless o<strong>the</strong>rwise stated. The name PostScript also is used as a product trademark for Adobe Systems’implementation of <strong>the</strong> PostScript language interpreter.Except as o<strong>the</strong>rwise stated, any reference <strong>to</strong> a "PostScript printing device,” "PostScript display device,” or similar item refers <strong>to</strong> a printing device, displaydevice or item (respectively) that contains PostScript technology created or licensed by Adobe Systems Incorporated and not <strong>to</strong> devices or items thatpurport <strong>to</strong> be merely compatible with <strong>the</strong> PostScript language.Adobe, <strong>the</strong> Adobe logo, Acrobat, Acrobat Capture, <strong>the</strong> Adobe <strong>PDF</strong> logo, Distiller, PostScript, <strong>the</strong> PostScript logo and Reader are ei<strong>the</strong>r registeredtrademarks or trademarks of Adobe Systems Incorporated in <strong>the</strong> United States and/or o<strong>the</strong>r countries.Apple, Macin<strong>to</strong>sh, and Power Macin<strong>to</strong>sh are trademarks of Apple Computer, Inc., registered in <strong>the</strong> United States and o<strong>the</strong>r countries. PowerPC is aregistered trademark of IBM Corporation in <strong>the</strong> United States. ActiveX, Microsoft, Windows, and Windows NT are ei<strong>the</strong>r registered trademarks ortrademarks of Microsoft Corporation in <strong>the</strong> United States and/or o<strong>the</strong>r countries. UNIX is a registered trademark of The Open Group. All o<strong>the</strong>r trademarksare <strong>the</strong> property of <strong>the</strong>ir respective owners.This publication and <strong>the</strong> information herein is furnished AS IS, is subject <strong>to</strong> change without notice, and should not be construed as a commitment by AdobeSystems Incorporated. Adobe Systems Incorporated assumes no responsibility or liability for any errors or inaccuracies, makes no warranty of any kind(express, implied, or statu<strong>to</strong>ry) with respect <strong>to</strong> this publication, and expressly disclaims any and all warranties of merchantability, fitness for particularpurposes, and noninfringement of third party rights.Portions include software under <strong>the</strong> following terms:Portions derived from <strong>the</strong> RSA DataSecurity, Inc. MD5 Message-Digest Algorithm.Portions of <strong>the</strong> software were developed by <strong>the</strong> University of California, Berkeley.The author of this software is David M. Gay. Copyright (c) 1991 by AT&T. Permission <strong>to</strong> use, copy, modify, and distribute this software for any purposewithout 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 thissoftware and in all copies of <strong>the</strong> supporting documentation for such software. THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS ORIMPLIED WARRANTY. IN PARTICULAR, NEITHER THE AUTHOR NOR AT&T MAKES ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THEMERCHANTABILITY OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.Portions of <strong>the</strong> software were developed at Cygnus Solutions.Portions copyright (c) 1995-2003 International Business Machines Corporation and o<strong>the</strong>rs. All rights reserved. Permission is hereby granted, free ofcharge, <strong>to</strong> any person obtaining a copy of this software and associated documentation files (<strong>the</strong> "Software"), <strong>to</strong> deal in <strong>the</strong> Software without restriction,including without limitation <strong>the</strong> rights <strong>to</strong> use, copy, modify, merge, publish, distribute, and/or sell copies of <strong>the</strong> Software, and <strong>to</strong> permit persons <strong>to</strong>whom <strong>the</strong> Software is furnished <strong>to</strong> do so, provided that <strong>the</strong> above copyright notice(s) and this permission notice appear in all copies of <strong>the</strong> Softwareand that both <strong>the</strong> 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 APARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED INTHIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROMLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR INCONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. Except as contained in this notice, <strong>the</strong> name of a copyright holder shall not beused in advertising or o<strong>the</strong>rwise <strong>to</strong> promote <strong>the</strong> sale, use or o<strong>the</strong>r dealings in this Software without prior written authorization of <strong>the</strong> copyright holder.Portions copyright (c) 1994 Hewlett-Packard Company. Permission <strong>to</strong> use, copy, modify, distribute and sell this software and its documentation for anypurpose is hereby granted without fee, provided that <strong>the</strong> above copyright notice appear in all copies and that both that copyright notice and thispermission notice appear in supporting documentation. Hewlett-Packard Company makes no representations about <strong>the</strong> suitability of this software forany purpose. It is provided "as is" without express or implied warranty.Copyright (c) 1996 Silicon Graphics Computer Systems, Inc. Permission <strong>to</strong> use, copy, modify, distribute and sell this software and its documentation forany purpose is hereby granted without fee, provided that <strong>the</strong> above copyright notice appear in all copies and that both that copyright notice and thispermission notice appear in supporting documentation. Silicon Graphics makes no representations about <strong>the</strong> suitability of this software for anypurpose. It is provided "as is" without express or implied warranty.Contains an implementation of <strong>the</strong> LZW algorithm licensed under U.S. Patent 4,558,302.Adobe Systems Incorporated, 345 Park Avenue, San Jose, California 95110, USA. Notice <strong>to</strong> U.S. Government End Users. The Software and Documentationare “Commercial Items,” as that term is defined at 48 C.F.R. ß2.101, consisting of “Commercial Computer Software” and “Commercial Computer SoftwareDocumentation,” 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, <strong>the</strong> Commercial Computer Software and Commercial Computer Software Documentation are being licensed <strong>to</strong> U.S.Government end users (a) only as Commercial Items and (b) with only those rights as are granted <strong>to</strong> all o<strong>the</strong>r end users pursuant <strong>to</strong> <strong>the</strong> terms andconditions herein. Unpublished-rights reserved under <strong>the</strong> copyright laws of <strong>the</strong> United States.Adobe Systems Incorporated, 345 Park Avenue, San Jose, CA 95110-2704, USA. For U.S. Government End Users, Adobe agrees <strong>to</strong> comply with all applicableequal opportunity laws including, if appropriate, <strong>the</strong> provisions of Executive Order 11246, as amended, Section 402 of <strong>the</strong> Vietnam Era VeteransReadjustment Assistance Act of 1974 (38 USC 4212), and Section 503 of <strong>the</strong> Rehabilitation Act of 1973, as amended, and <strong>the</strong> regulations at 41 CFR Parts 60-1 through 60-60, 60-250, and 60-741. The affirmative action clause and regulations contained in <strong>the</strong> preceding sentence shall be incorporated by reference.


<strong>PDF</strong> <strong>Library</strong>-specific MethodsASA<strong>to</strong>mGetCountASInt32 ASA<strong>to</strong>mGetCount (void);DescriptionGets <strong>the</strong> number of ASA<strong>to</strong>ms that have been allocated. The maximum number ofASA<strong>to</strong>ms is 0xFFFFFFFF. (This was a 16-bit value in Acrobat 4.x, and changed <strong>to</strong> a 32-bitvalue in Acrobat 5.)ASA<strong>to</strong>ms cannot be deleted or freed. Use this method <strong>to</strong> determine if it is necessary <strong>to</strong> reinitialize<strong>the</strong> library before creating more ASA<strong>to</strong>ms.ParametersNoneReturn ValueNumber of ASA<strong>to</strong>ms currently allocated.Header File<strong>PDF</strong>LCalls.hRelated MethodsASA<strong>to</strong>mExistsForString<strong>PDF</strong>LInit<strong>PDF</strong>LTerm<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 3


<strong>PDF</strong> <strong>Library</strong>-specific MethodsASFileSysGetDefaultTempPathASFileSysGetDefaultTempPathASPathName ASFileSysGetDefaultTempPath (ASFileSys fileSys);DescriptionGets <strong>the</strong> default temporary path that was set by ASFileSysSetDefaultTempPath.ParametersfileSysThe file system in which <strong>the</strong> ASPathname is set.Return ValueThe ASPathName if <strong>the</strong> operation was successful, NULL o<strong>the</strong>rwise.Header File<strong>PDF</strong>LCalls.hRelated MethodsASFileSysSetDefaultTempPath<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 4


<strong>PDF</strong> <strong>Library</strong>-specific MethodsASFileSysSetDefaultTempPathASFileSysSetDefaultTempPathASBool ASFileSysSetDefaultTempPath (ASFileSys fileSys,ASPathName pathName);DescriptionSets <strong>the</strong> default temporary path for <strong>the</strong> specified file system <strong>to</strong> <strong>the</strong> specified pathname. Themethod copies <strong>the</strong> passed pathname object on success; <strong>the</strong> client is responsible forreleasing <strong>the</strong> object when it is no longer needed, using ASFileSysReleasePath.Pass a pathname of NULL <strong>to</strong> reset <strong>the</strong> default temporary path <strong>to</strong> <strong>the</strong> file system default.ParametersfileSyspathName(May be NULL) The file system in which <strong>to</strong> set <strong>the</strong> default temporarypath.The pathname for <strong>the</strong> new default temporary path, or NULL <strong>to</strong> reset <strong>to</strong><strong>the</strong> file system default.Return Valuefalse if <strong>the</strong> path provided is not writable, true o<strong>the</strong>rwise.Header File<strong>PDF</strong>LCalls.hRelated MethodsASFileSysGetDefaultTempPath<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 5


<strong>PDF</strong> <strong>Library</strong>-specific MethodsASGetRamFileSysASGetRamFileSysASFileSys ASGetRamFileSys (void);DescriptionGets <strong>the</strong> in-memory file system implementation for a platform.N OTE:This <strong>API</strong> is available only in <strong>the</strong> thread-safe version of <strong>the</strong> <strong>PDF</strong>L <strong>Library</strong>.ParametersNone.Return ValueThe platform's in-memory file system.Header FileASCalls.hRelated MethodsASRamFileSysSetLimitKB<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 6


<strong>PDF</strong> <strong>Library</strong>-specific MethodsASGetTempFileSysASGetTempFileSysASFileSys ASGetTempFileSys (void);DescriptionGets <strong>the</strong> file system <strong>to</strong> be used for temporary files. The default temporary file system is <strong>the</strong>default file system as returned by ASGetDefaultFileSys.N OTE:This <strong>API</strong> is available only in <strong>the</strong> thread-safe version of <strong>the</strong> <strong>PDF</strong>L <strong>Library</strong>.ParametersNone.Return ValueThe file system <strong>to</strong> be used for temporary files.Header FileASCalls.hRelated MethodsASGetRamFileSysASSetTempFileSys<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 7


<strong>PDF</strong> <strong>Library</strong>-specific MethodsASPurgeMemoryASPurgeMemoryASSize_t ASPurgeMemory (ASSize_t amount);DescriptionAttempts <strong>to</strong> free memory from <strong>the</strong> <strong>PDF</strong> <strong>Library</strong> caches.The caches in <strong>the</strong> <strong>PDF</strong> <strong>Library</strong> can grow in complex and unexpected ways. A client canmanage memory use with <strong>the</strong> <strong>PDF</strong>LInit memory callbacks, or by explicitly calling thisfunction after certain functions, such as PDDocClose.To manage memory use with <strong>the</strong> memory callbacks, a client can call ASPurgeMemoryduring <strong>the</strong> allocation callback if it is low on memory, or <strong>to</strong> limit <strong>the</strong> amount of memory usedby <strong>the</strong> library. Use this approach only with extreme caution and extensive testing. The runtimememory requirements are very document-specific.ParametersamountThe desired amount of memory <strong>to</strong> free.Return ValueThe approximate amount of memory freed.NotificationsNoneHeader File<strong>PDF</strong>LCalls.hRelated Methods<strong>PDF</strong>LInit<strong>PDF</strong>LTerm<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 8


<strong>PDF</strong> <strong>Library</strong>-specific MethodsASRamFileSysSetLimitKBASRamFileSysSetLimitKBvoid ASRamFileSysSetLimitKB (ASInt32 limit);DescriptionSets <strong>the</strong> in-memory file system size limit, in kilobytes.N OTE:This <strong>API</strong> is available only in <strong>the</strong> thread-safe version of <strong>the</strong> <strong>PDF</strong>L <strong>Library</strong>.ParameterslimitThe in-memory file system size limit, in kilobytes.Return ValueNone.Header FileASCalls.hRelated MethodsASGetRamFileSys<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 9


<strong>PDF</strong> <strong>Library</strong>-specific MethodsASSetTempFileSysASSetTempFileSysvoid ASSetTempFileSys (ASFileSys fileSys);DescriptionSets <strong>the</strong> file system <strong>to</strong> be used for temporary files.N OTE:This <strong>API</strong> is available only in <strong>the</strong> thread-safe version of <strong>the</strong> <strong>PDF</strong>L <strong>Library</strong>.ParametersfileSysThe file system that will become <strong>the</strong> temporary file system for <strong>the</strong>platform.Return ValueNone.Header FileASCalls.hRelated MethodsASGetRamFileSysASGetTempFileSys<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 10


<strong>PDF</strong> <strong>Library</strong>-specific MethodsAVExtensionMgrRegisterNotificationAVExtensionMgrRegisterNotificationvoid AVExtensionMgrRegisterNotification (NSelec<strong>to</strong>r nsel,ASExtension owner, void* proc, void* clientData);DescriptionRegisters a user-supplied procedure <strong>to</strong> call when <strong>the</strong> event of <strong>the</strong> specified type occurs.This is exactly <strong>the</strong> same as <strong>the</strong> AVAppRegisterNotification method. All of <strong>the</strong> PDlevel notifications are available with <strong>the</strong> Adobe <strong>PDF</strong> <strong>Library</strong>.ParametersnselownerprocclientDataNotification type. Must be one of <strong>the</strong> notification selec<strong>to</strong>rs. Thenotification selec<strong>to</strong>r is <strong>the</strong> name of <strong>the</strong> notification with <strong>the</strong>characters NSEL appended. For example, <strong>the</strong> selec<strong>to</strong>r forPDDocDidPrintPage is PDDocDidPrintPageNSEL.Only <strong>the</strong> PD-level notifications are available with <strong>the</strong> Adobe <strong>PDF</strong><strong>Library</strong>.Identifies <strong>the</strong> owner.For <strong>the</strong> Adobe <strong>PDF</strong> <strong>Library</strong>, if <strong>the</strong>re is only one owner of <strong>the</strong> <strong>PDF</strong>Editsubsystem, owner should be zero. If <strong>the</strong>re are multiple owners, eachshould specify a nonzero, non-negative owner. (A negative owneris reserved for <strong>the</strong> implementation.)User-supplied callback <strong>to</strong> call when <strong>the</strong> notification occurs. Itsdeclaration depends on <strong>the</strong> notification type (see <strong>the</strong> Notificationssection in <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong>).Pointer <strong>to</strong> user-supplied data <strong>to</strong> pass <strong>to</strong> proc each time it is called.Return ValueNoneHeader File<strong>PDF</strong>LCalls.hRelated MethodsAVExtensionMgrUnregisterNotificationAVAppRegisterNotification<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 11


<strong>PDF</strong> <strong>Library</strong>-specific MethodsAVExtensionMgrRegisterNotificationExamplevoid myWillPrintDoc(PDDoc doc, ASStm stm, ASInt32 level,void* clientData);ASCallback myWillPrintDocCB = ASCallbackCreateNotification(PDDocWillPrintDoc, myWillPrintDoc);AVExtensionMgrRegisterNotification (PDDocWillPrintDocNSEL,(ASExtension)1, myWillPrintDocCB, NULL);<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 12


<strong>PDF</strong> <strong>Library</strong>-specific MethodsAVExtensionMgrUnregisterNotificationAVExtensionMgrUnregisterNotificationvoid AVExtensionMgrUnregisterNotification (NSelec<strong>to</strong>r nsel,ASExtension owner, void* proc, void* clientData);DescriptionUnregisters a user-supplied procedure <strong>to</strong> call when <strong>the</strong> specified event occurs. This isexactly <strong>the</strong> same as <strong>the</strong> AVAppUnregisterNotification method, as documented in<strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong>.ParametersnselownerprocclientDataNotification type. Must be one of <strong>the</strong> notification selec<strong>to</strong>rs. Thenotification selec<strong>to</strong>r is <strong>the</strong> name of <strong>the</strong> notification with <strong>the</strong>characters NSEL appended. For example, <strong>the</strong> selec<strong>to</strong>r forPDDocDidOpen is PDDocDidOpenNSEL.Identifies <strong>the</strong> owner with which <strong>the</strong> notification was registered.User-supplied callback with which <strong>the</strong> notification was registered.Pointer <strong>to</strong> user-supplied data that was used when <strong>the</strong> notificationwas registered.Return ValueNoneHeader File<strong>PDF</strong>Calls.hRelated MethodsAVExtensionMgrRegisterNotificationAVAppUnregisterNotificationExampleAVExtensionMgrUnregisterNotification (PDDocWillPrintDocNSEL,(ASExtension)1, myWillPrintDocCB, NULL);<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 13


<strong>PDF</strong> <strong>Library</strong>-specific MethodsPDDocPrintPagesPDDocPrintPagesvoid PDDocPrintPages (PDPrintClient client);DescriptionPrints a range of pages from a document, controlled by a structure of data and callbacks.ParametersN OTE:This low-level method should be avoided; use <strong>the</strong> higher-level <strong>PDF</strong>LPrintDocinstead.clientControl structure for <strong>the</strong> operation, containing data and callbackprocedures.Return ValueNoneKnown ExceptionsgenErrBadParmNotificationsPSPrintAfterBeginPageSetupPSPrintAfterBeginPrologPSPrintAfterBeginSetupPSPrintAfterEmitExtGStatePSPrintAfterPageTrailerPSPrintAfterTrailerPSPrintBeforeEndCommentsPSPrintBeforeEndSetupHeader File<strong>PDF</strong>LCalls.hRelated Methods<strong>PDF</strong>LInit<strong>PDF</strong>LPrintDoc<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 14


<strong>PDF</strong> <strong>Library</strong>-specific Methods<strong>PDF</strong>LGet<strong>Core</strong>HFT<strong>PDF</strong>LGet<strong>Core</strong>HFTHFT <strong>PDF</strong>LGet<strong>Core</strong>HFT (void);DescriptionGets <strong>the</strong> <strong>Core</strong> HFT.ParametersNoneReturn ValueThe <strong>Core</strong> HFT object.Header File<strong>PDF</strong>Init.hRelated Methods<strong>PDF</strong>LInit<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 15


<strong>PDF</strong> <strong>Library</strong>-specific Methods<strong>PDF</strong>LGetFlags<strong>PDF</strong>LGetFlagsASUns32 <strong>PDF</strong>LGetFlags (void);DescriptionGets <strong>the</strong> flags set when <strong>the</strong> <strong>PDF</strong> <strong>Library</strong> was initialized. The only flag currently supported isk<strong>PDF</strong>LInitIgnoreDefaultDirec<strong>to</strong>ries.When this flag is set, <strong>the</strong> initialization process does not search through <strong>the</strong> default fontdirec<strong>to</strong>ries, but only searches for fonts in those direc<strong>to</strong>ries specified in dirList.ParametersNoneReturn ValueThe initialization flags value.Header File<strong>PDF</strong>Init.hRelated Methods<strong>PDF</strong>LInit<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 16


<strong>PDF</strong> <strong>Library</strong>-specific Methods<strong>PDF</strong>LGetInitCount<strong>PDF</strong>LGetInitCountASUns32 <strong>PDF</strong>LGetInitCount (void);DescriptionGets <strong>the</strong> number of times <strong>the</strong> <strong>PDF</strong> <strong>Library</strong> has been initialized.ParametersNoneReturn ValueThe number of times <strong>the</strong> <strong>PDF</strong> <strong>Library</strong> has been initialized.Header File<strong>PDF</strong>Init.hRelated Methods<strong>PDF</strong>LInit<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 17


<strong>PDF</strong> <strong>Library</strong>-specific Methods<strong>PDF</strong>LGetVersion<strong>PDF</strong>LGetVersionDescriptionParametersNoneASUns32 <strong>PDF</strong>LGetVersion (void);N OTE: Obsolete in <strong>PDF</strong> <strong>Library</strong> 6.0. Use HFTGetVersion instead.Gets <strong>the</strong> value of <strong>the</strong> Adobe <strong>PDF</strong> <strong>Library</strong> version—k<strong>PDF</strong>LVersion. The most significant16 bits are <strong>the</strong> major version number; <strong>the</strong> least significant 16 bits are <strong>the</strong> minor versionnumber. The major version number indicates whe<strong>the</strong>r any incompatible <strong>API</strong> changes havebeen made. The minor version number indicates <strong>the</strong> <strong>API</strong> has changed, but in a compatiblefashion.Return ValueAdobe <strong>PDF</strong> <strong>Library</strong> version—k<strong>PDF</strong>LVersion.Header File<strong>PDF</strong>Init.hRelated Methods<strong>PDF</strong>LTerm<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 18


<strong>PDF</strong> <strong>Library</strong>-specific Methods<strong>PDF</strong><strong>Library</strong>RegisterNotification<strong>PDF</strong><strong>Library</strong>RegisterNotificationvoid <strong>PDF</strong><strong>Library</strong>RegisterNotification (NSelec<strong>to</strong>r nsel,ASExtension owner, void *proc, void *clientData);DescriptionRegisters a user-supplied procedure <strong>to</strong> call when <strong>the</strong> specified event occurs. This is exactly<strong>the</strong> same as <strong>the</strong> AVAppRegisterNotification method. All of <strong>the</strong> PD levelnotifications are available with <strong>the</strong> Adobe <strong>PDF</strong> <strong>Library</strong>.ParametersnselownerprocclientDataNotification type. Must be one of <strong>the</strong> notification selec<strong>to</strong>rs. Thenotification selec<strong>to</strong>r is <strong>the</strong> name of <strong>the</strong> notification with <strong>the</strong>characters NSEL appended. For example, <strong>the</strong> selec<strong>to</strong>r forPDDocDidPrintPage is PDDocDidPrintPageNSEL.Only <strong>the</strong> PD-level notifications are available with <strong>the</strong> Adobe <strong>PDF</strong><strong>Library</strong>.Identifies <strong>the</strong> owner.For <strong>the</strong> Adobe <strong>PDF</strong> <strong>Library</strong>, if <strong>the</strong>re is only one owner of <strong>the</strong> <strong>PDF</strong>Editsubsystem, owner should be zero. If <strong>the</strong>re are multiple owners, eachshould specify a nonzero, non-negative owner. (A negative owneris reserved for <strong>the</strong> implementation.)User-supplied callback <strong>to</strong> call when <strong>the</strong> notification occurs. Itsdeclaration depends on <strong>the</strong> notification type (see <strong>the</strong> Notificationssection in <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong>).Pointer <strong>to</strong> user-supplied data <strong>to</strong> pass <strong>to</strong> proc each time it is called.Return ValueNoneHeader File<strong>PDF</strong>LHFT.hRelated MethodsAVExtensionMgrRegisterNotificationAVAppRegisterNotification<strong>PDF</strong><strong>Library</strong>UnregisterNotification<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 19


<strong>PDF</strong> <strong>Library</strong>-specific Methods<strong>PDF</strong><strong>Library</strong>UnregisterNotification<strong>PDF</strong><strong>Library</strong>UnregisterNotificationvoid <strong>PDF</strong><strong>Library</strong>UnregisterNotification (NSelec<strong>to</strong>r nsel,ASExtension owner, void* proc, void* clientData);DescriptionUnregisters a user-supplied procedure <strong>to</strong> call when <strong>the</strong> specified event occurs. This isexactly <strong>the</strong> same as <strong>the</strong> AVAppUnregisterNotification method, as documented in<strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong>.ParametersnselownerprocclientDataNotification type. Must be one of <strong>the</strong> notification selec<strong>to</strong>rs. Thenotification selec<strong>to</strong>r is <strong>the</strong> name of <strong>the</strong> notification with <strong>the</strong>characters NSEL appended. For example, <strong>the</strong> selec<strong>to</strong>r forPDDocDidOpen is PDDocDidOpenNSEL.Identifies <strong>the</strong> owner.For <strong>the</strong> Adobe <strong>PDF</strong> <strong>Library</strong>, if <strong>the</strong>re is only one owner of <strong>the</strong> <strong>PDF</strong>Editsubsystem, owner should be zero. If <strong>the</strong>re are multiple owners, eachshould specify a nonzero, non-negative owner. (A negative owneris reserved for <strong>the</strong> implementation.)User-supplied callback <strong>to</strong> call when <strong>the</strong> notification occurs. Itsdeclaration depends on <strong>the</strong> notification type (see <strong>the</strong> Notificationssection in <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong>).You must use <strong>the</strong> same callback that you calledAVExtensionMgrRegisterNotification with.Pointer <strong>to</strong> user-supplied data <strong>to</strong> pass <strong>to</strong> proc each time it is called.Return ValueNoneHeader File<strong>PDF</strong>LHFT.hRelated Methods<strong>PDF</strong><strong>Library</strong>RegisterNotificationAVAppUnregisterNotification<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 20


<strong>PDF</strong> <strong>Library</strong>-specific Methods<strong>PDF</strong>LInit<strong>PDF</strong>LInitASInt32 <strong>PDF</strong>LInit (<strong>PDF</strong>LData data);DescriptionInitializes <strong>the</strong> Adobe <strong>PDF</strong> <strong>Library</strong>. This method must be called before any o<strong>the</strong>r <strong>Library</strong> callscan be made, printing or o<strong>the</strong>rwise.ParametersdataInitialization data for Adobe <strong>PDF</strong> <strong>Library</strong>.Return Value0 if initialization was successful, or an error code if it was not. Use ASGetErrorString <strong>to</strong>convert any error code <strong>to</strong> a string.Header File<strong>PDF</strong>Init.hRelated Methods<strong>PDF</strong>LGetFlags<strong>PDF</strong>LGetInitCount<strong>PDF</strong>LTerm<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 21


<strong>PDF</strong> <strong>Library</strong>-specific Methods<strong>PDF</strong>LPrintDoc<strong>PDF</strong>LPrintDocvoid <strong>PDF</strong>LPrintDoc (PDDoc doc,<strong>PDF</strong>LPrintUserParamsRec userParams);DescriptionPrints a <strong>PDF</strong> document or pages from a <strong>PDF</strong> document allowing <strong>the</strong> caller <strong>to</strong> specifyoptions such as page size, rotation, and shrink-<strong>to</strong>-fit.ParametersN OTE:Users of <strong>the</strong> <strong>PDF</strong>LPrintDoc method do not have <strong>to</strong> create <strong>the</strong> PDPrintClientcallbacks. That detail is handled by <strong>the</strong> library.docuserParamsThe PDDoc for <strong>the</strong> document <strong>to</strong> print.Parameters <strong>to</strong> control printing.Return ValueNoneKnown ExceptionscosErrWriteErrorpdErrOpNotPermittedgenErrBadParmNotificationsPSPrintAfterBeginPageSetupPSPrintAfterBeginPrologPSPrintAfterBeginSetupPSPrintAfterEmitExtGStatePSPrintAfterPageTrailerPSPrintAfterTrailerPSPrintBeforeEndCommentsPSPrintBeforeEndSetupHeader File<strong>PDF</strong>LPrint.hRelated Methods<strong>PDF</strong>LPrintDocExample<strong>PDF</strong>LPrintDoc(doc, userParams);<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 22


<strong>PDF</strong> <strong>Library</strong>-specific Methods<strong>PDF</strong>LTerm<strong>PDF</strong>LTermvoid <strong>PDF</strong>LTerm (void);DescriptionTerminates <strong>the</strong> Adobe <strong>PDF</strong> <strong>Library</strong>. Call this method after you are completely done using<strong>the</strong> library. Call this once <strong>to</strong> terminate and release memory used by <strong>the</strong> library. After <strong>the</strong>library has been shut down, <strong>the</strong> process should terminate.ParametersNoneReturn ValueNoneHeader File<strong>PDF</strong>Init.hRelated Methods<strong>PDF</strong>LInit<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 23


<strong>PDF</strong> <strong>Library</strong>-specific Methods<strong>PDF</strong>ontDownloadContextCreate<strong>PDF</strong>ontDownloadContextCreate<strong>PDF</strong>ontDownloadContext <strong>PDF</strong>ontDownloadContextCreate(PDPrintClient client);DescriptionCreates a font download context object. This object keeps track of <strong>the</strong> fonts downloadedduring a print job and whe<strong>the</strong>r or not substitution fonts have already been downloaded.Also tracks <strong>the</strong> font download parameters, such as binaryOK and “emit TrueType as Type42.” For use in <strong>the</strong> <strong>PDF</strong>ontStreamPS method.ParametersclientThe client record <strong>to</strong> pass <strong>to</strong> PDDocPrintPages.Return ValueThe newly-created context.Header File<strong>PDF</strong>LCalls.hRelated MethodsPDDocPrintPages<strong>PDF</strong>ontDownloadContextDestroy<strong>PDF</strong>ontStreamPS<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 24


<strong>PDF</strong> <strong>Library</strong>-specific Methods<strong>PDF</strong>ontDownloadContextDestroy<strong>PDF</strong>ontDownloadContextDestroyvoid <strong>PDF</strong>ontDownloadContextDestroy(<strong>PDF</strong>ontDownloadContext context);DescriptionDestroys a font download context object. Call this method after PDDocPrintPagesreturns.ParameterscontextThe context <strong>to</strong> destroy.Return ValueNoneHeader File<strong>PDF</strong>LCalls.hRelated MethodsPDDocPrintPages<strong>PDF</strong>ontDownloadContextCreate<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 25


<strong>PDF</strong> <strong>Library</strong>-specific Methods<strong>PDF</strong>ontPSEmitGlyphsIncr<strong>PDF</strong>ontPSEmitGlyphsIncrASBool <strong>PDF</strong>ontPSEmitGlyphsIncr (ASStm stm, <strong>PDF</strong>ont fontP,PDPrintStrP srcStr, PDPrintStrP dstStr,ASUns32* srcBytesUsedP, ASUns32* dstBytesUsedP,ASUns32* glyphCount, ASUns16* fontIndexP,PDPrintClient printClient );DescriptionEmit glyphs incrementally. This is <strong>the</strong> default EmitGlyphsIncr callback procedure for<strong>the</strong> PDPrintClient structure.ParametersstmfontPsrcStrdstStrsrcBytesUsedPdstBytesUsedPglyphCountfontIndexPprintClientThe stream.The font.Source string.Destination string.Source bytes used.Destination bytes used.Number of glyphs.Font index.Control structure.Return Valuetrue if successful; false o<strong>the</strong>rwise.Header File<strong>PDF</strong>LCalls.hRelated MethodsPDDocPrintPages<strong>PDF</strong>ontPSFlushIncrGlyphList<strong>PDF</strong>ontPSGetComponentFontList<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 26


<strong>PDF</strong> <strong>Library</strong>-specific Methods<strong>PDF</strong>ontPSFlushIncrGlyphList<strong>PDF</strong>ontPSFlushIncrGlyphListvoid <strong>PDF</strong>ontPSFlushIncrGlyphList (ASStm stm,PDPrintClient printClient);DescriptionFlush <strong>the</strong> incremental glyphs list from a stream. This is <strong>the</strong> defaultFlushIncrGlyphList callback procedure for <strong>the</strong> PDPrintClient structure.ParametersstmprintClientThe stream.Control structure.Return ValueNoneHeader File<strong>PDF</strong>LCalls.hRelated Methods<strong>PDF</strong>ontPSEmitGlyphsIncr<strong>PDF</strong>ontPSGetComponentFontList<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 27


<strong>PDF</strong> <strong>Library</strong>-specific Methods<strong>PDF</strong>ontPSGetComponentFontList<strong>PDF</strong>ontPSGetComponentFontListvoid <strong>PDF</strong>ontPSGetComponentFontList(<strong>PDF</strong>ont fontP,PDPrintFontArrayP pdFontArr, PDPrintClient printClient);DescriptionGet <strong>the</strong> component font list. This is <strong>the</strong> default GetComponentFontList callbackprocedure for <strong>the</strong> PDPrintClient structure.ParametersfontPpdFontArrprintClientThe font.Font array.Control structure.Return ValueNoneHeader File<strong>PDF</strong>LCalls.hRelated Methods<strong>PDF</strong>ontPSEmitGlyphsIncr<strong>PDF</strong>ontPSFlushIncrGlyphList<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 28


<strong>PDF</strong> <strong>Library</strong>-specific Methods<strong>PDF</strong>ontStreamPS<strong>PDF</strong>ontStreamPSASBool <strong>PDF</strong>ontStreamPS (<strong>PDF</strong>ont fontP, ASStm stm,<strong>PDF</strong>ontDownloadContext context);DescriptionEmits a font in<strong>to</strong> a specified stream. The font is in a format suitable for downloading <strong>to</strong> aPostScript VM. For example, a TrueType font is converted in<strong>to</strong> a Type 1 or Type 42 font.For use in <strong>the</strong> EmitFont callback for PDDocPrintPages.ParametersfontPstmcontextThe font <strong>to</strong> emit.The ASStm in<strong>to</strong> which <strong>the</strong> font is emitted.A context created by <strong>PDF</strong>ontDownloadContextCreate.Return Valuetrue if successful, false o<strong>the</strong>rwise.Header File<strong>PDF</strong>LCalls.hRelated MethodsPDDocPrintPages<strong>PDF</strong>ontDownloadContextCreate<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 29


<strong>PDF</strong> <strong>Library</strong>-specific Methods<strong>PDF</strong>ontWasExtracted<strong>PDF</strong>ontWasExtractedASBool <strong>PDF</strong>ontWasExtracted (<strong>PDF</strong>ont fontP);DescriptionTests whe<strong>the</strong>r or not <strong>the</strong> specified font is embedded in <strong>the</strong> <strong>PDF</strong> file and has already beenextracted <strong>to</strong> display or print <strong>the</strong> file.ParametersfontPThe font <strong>to</strong> test.Return Valuetrue if <strong>the</strong> font is embedded in <strong>the</strong> <strong>PDF</strong> file and has been extracted, false o<strong>the</strong>rwise.Header File<strong>PDF</strong>LCalls.hRelated Methods<strong>PDF</strong>ontDownloadContextCreate<strong>PDF</strong>ontWasFauxed<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 30


<strong>PDF</strong> <strong>Library</strong>-specific Methods<strong>PDF</strong>ontWasFauxed<strong>PDF</strong>ontWasFauxedASBool <strong>PDF</strong>ontWasFauxed (<strong>PDF</strong>ont font);DescriptionTests whe<strong>the</strong>r or not <strong>the</strong> specified font is embedded in <strong>the</strong> <strong>PDF</strong> file or is installed in <strong>the</strong>user’s system. If this is <strong>the</strong> case, <strong>the</strong> correct font can be used for display and printing.If <strong>the</strong> font is not embedded or installed, <strong>the</strong> Acrobat viewer has used a multiple master font<strong>to</strong> create a substitute font, called a faux font.ParametersfontPThe font <strong>to</strong> test.Return Valuetrue if <strong>the</strong> font has been substituted, false o<strong>the</strong>rwise.Header File<strong>PDF</strong>LCalls.hRelated Methods<strong>PDF</strong>ontWasExtracted<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 31


<strong>PDF</strong> <strong>Library</strong>-specific MethodsPDPageDrawContentsPlacedToWindowPDPageDrawContentsPlacedToWindowvoid PDPageDrawContentsPlacedToWindow (PDPage page,void* window, void* displayContext, ASBool isDPS,ASFixedMatrix* matrix, ASFixedRect* updateRect,ASCancelProc cancelProc, void* cancelProcClientData);DescriptionDraws <strong>the</strong> page <strong>to</strong> <strong>the</strong> window or display context. The window and display context areimplementation dependent.This method is <strong>the</strong> same as PDPageDrawContentsToWindow, except that it raises anexception if <strong>the</strong> pdPermCopy (see PDPerms) permission is not set in <strong>the</strong> document.ParameterspagewindowdisplayContextisDPSmatrixupdateRectcancelProccancelProcClientDataThe page <strong>to</strong> draw in<strong>to</strong> window.The platform window <strong>to</strong> which <strong>to</strong> render.In Mac OS, <strong>the</strong> window is a WindowPtr or GrafPtr orCGrafPtr.In Windows, <strong>the</strong> window is an HWND.The platform display context <strong>to</strong> which <strong>to</strong> render.In Mac OS, currently unused.In Windows, displayContext is an HDC.Currently unused. Always set <strong>to</strong> false.Pointer <strong>to</strong> <strong>the</strong> matrix <strong>to</strong> concatenate on<strong>to</strong> <strong>the</strong> default pagematrix. It is useful for converting from page <strong>to</strong> windowcoordinates and for scaling.Pointer <strong>to</strong> <strong>the</strong> rectangle <strong>to</strong> draw, defined in user spacecoordinates. Any objects outside of updateRect will not bedrawn. All objects are drawn if updateRect is NULL.A method called <strong>to</strong> check whe<strong>the</strong>r drawing should be canceled.If <strong>the</strong> method returns true, drawing is s<strong>to</strong>pped, nothing iserased, and <strong>the</strong> window contains whatever was drawn up <strong>to</strong> <strong>the</strong>current state.Pointer <strong>to</strong> user-supplied data <strong>to</strong> pass <strong>to</strong> cancelProc eachtime it is called. Should be NULL if cancelProc is NULL.Return ValueNone<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 32


<strong>PDF</strong> <strong>Library</strong>-specific MethodsPDPageDrawContentsPlacedToWindowKnown ExceptionsRaises pdErrOpNotPermitted if <strong>the</strong> pdPermCopy permission in PDPermReqObj for<strong>the</strong> document is not set.Header File<strong>PDF</strong>LCalls.hRelated MethodsPDPageDrawContentsToWindow<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 33


<strong>PDF</strong> <strong>Library</strong>-specific MethodsPDPageDrawContentsToMemoryPDPageDrawContentsToMemoryASInt32 PDPageDrawContentsToMemory (PDPage page,ASUns32 flags, ASFixedMatrix* matrix,ASFixedRect* updateRect, ASUns32 smoothFlags,ASA<strong>to</strong>m csA<strong>to</strong>m, ASInt32 bpc, ASFixedRect* destRect,char* buffer, ASInt32 bufferSize, CancelProc cancelProc,void* cancelProcData);DescriptionRenders a page <strong>to</strong> memory. The width of <strong>the</strong> 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 componentParameterspageflagsmatrixThe page <strong>to</strong> render.A bit field of PDPageDrawFlags. Must be an OR of <strong>the</strong>following flags:● kPDPageDoLazyErase—If set, erases <strong>the</strong> bitmap if <strong>the</strong>first object drawn does not cover <strong>the</strong> page's entire cropbox.● kPDPageUseAnnotFaces—If set, draws annotationsthat have a default face, such as <strong>the</strong> visible fields in anAcrobat form. Text and link annotations are not drawn.● kPDPageIsPrinting— If set, <strong>the</strong>n Form annotationsare rendered as if <strong>the</strong>y are being printed. This means thatform fields marked as “Hidden but printable” arerendered, but fields marked as “Visible but doesn’t print”will not be rendered. If not set, <strong>the</strong>n Form annotations arerendered as if <strong>the</strong>y are being viewed. This means thatform fields marked as “Hidden but printable” are notrendered, but fields marked as “Visible but doesn’t print”will be.Pointer <strong>to</strong> <strong>the</strong> matrix <strong>to</strong> be concatenated on<strong>to</strong> <strong>the</strong> defaultpage matrix.<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 34


<strong>PDF</strong> <strong>Library</strong>-specific MethodsPDPageDrawContentsToMemoryupdateRectsmoothFlagscsA<strong>to</strong>mbpcdestRectbufferbufferSizecancelProccancelProcDataPointer <strong>to</strong> <strong>the</strong> rectangle <strong>to</strong> draw, defined in user spacecoordinates. Any objects outside of updateRect will not bedrawn. All objects are drawn if updateRect is NULL.A bit field of PDPageDrawSmoothFlags. Must be an OR of<strong>the</strong> following flags:● kPDPageDrawSmoothText● kPDPageDrawSmoothLineArt● kPDPageDrawSmoothImageThe color space in which <strong>the</strong> bitmap data is represented. Itmust be one of DeviceGray, DeviceRGB, orDeviceCMYK.The number of bits per color component in <strong>the</strong> bitmap data.8 is <strong>the</strong> only valid value for DeviceCMYK and DeviceRGBcolor space.1, 8, and 24 are valid for DeviceGray.Pointer <strong>to</strong> <strong>the</strong> rectangle of <strong>the</strong> bitmap. Defined in devicespace coordinates.Pointer <strong>to</strong> <strong>the</strong> bitmap data. If NULL, this function returns <strong>the</strong>size of buffer needed for <strong>the</strong> bitmap.The size of <strong>the</strong> buffer.A method <strong>to</strong> call <strong>to</strong> check whe<strong>the</strong>r drawing should becanceled. If <strong>the</strong> method returns true, drawing is s<strong>to</strong>pped;nothing is erased, and <strong>the</strong> buffer contains whatever wasdrawn up <strong>to</strong> <strong>the</strong> current state.User-supplied data <strong>to</strong> pass <strong>to</strong> CancelProc each time it iscalled.Return ValueThe size of <strong>the</strong> bitmap in bytes.Header File<strong>PDF</strong>LCalls.hRelated MethodsPDPageDrawContentsPlacedWithParams<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 35


<strong>PDF</strong> <strong>Library</strong>-specific MethodsPDPageEmitPSOrientPDPageEmitPSOrientDescriptionvoid PDPageEmitPSOrient (PDPage pdPage, ASInt16 paperHeight,ASInt16 paperWidth, ASStm stm, PDPrintParams params);N OTE:Obsolete in <strong>PDF</strong>L 6.0. Do not use.Header File<strong>PDF</strong>LCalls.hRelated Methods<strong>PDF</strong>LPrintDocPDDocPrintPages<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 36


<strong>PDF</strong> <strong>Library</strong>-specific MethodsPDPageGetSizePDPageGetSizevoid PDPageGetSize (PDPage page, ASFixed* width,ASFixed* height);DescriptionReturns <strong>the</strong> width and height of <strong>the</strong> page, which could be rotated or defaulted.ParameterspagewidthheightThe page whose size is being obtained.(Filled by <strong>the</strong> method) Width of <strong>the</strong> page.(Filled by <strong>the</strong> method) Height of <strong>the</strong> page.Return ValueNoneHeader File<strong>PDF</strong>LCalls.h<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 37


<strong>PDF</strong> <strong>Library</strong>-specific MethodsPDPrefGetAntialiasLevelPDPrefGetAntialiasLevelASInt16 PDPrefGetAntialiasLevel (void);DescriptionReturns <strong>the</strong> antialias level, in pixels.ParametersNoneReturn ValueThe antialias level set by PDPrefSetAntialiasLevel.Header File<strong>PDF</strong>LCalls.hRelated MethodsPDPrefSetAntialiasLevel<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 38


<strong>PDF</strong> <strong>Library</strong>-specific MethodsPDPrefGetBlackPointCompensationPDPrefGetBlackPointCompensationASBool PDPrefGetBlackPointCompensation (void);DescriptionReturns <strong>the</strong> black-point compensation flag.ParametersNoneReturn Valuetrue if black-point compensation is done.Header File<strong>PDF</strong>LCalls.hRelated MethodsPDPrefSetBlackPointCompensation<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 39


<strong>PDF</strong> <strong>Library</strong>-specific MethodsPDPrefGetGreekLevelPDPrefGetGreekLevelASInt16 PDPrefGetGreekLevel (void);DescriptionReturns <strong>the</strong> greek level.ParametersNoneReturn ValueThe greek level set by PDPrefSetGreekLevel.Header File<strong>PDF</strong>LCalls.hRelated MethodsPDPrefSetGreekLevel<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 40


<strong>PDF</strong> <strong>Library</strong>-specific MethodsPDPrefGetSuppressICCSpacesPDPrefGetSuppressICCSpacesASBool PDPrefGetSuppressICCSpaces (ASUns32 nComponents);DescriptionReturns <strong>the</strong> value of <strong>the</strong> suppress flag for ICC-based spaces with <strong>the</strong> specified number ofcomponents.ParametersnComponentsThe number of ICC-based space components that are suppressed ornot, according <strong>to</strong> <strong>the</strong> flag value.Return ValueThe suppress flag value.Header File<strong>PDF</strong>LCalls.hRelated MethodsPDPrefSetSuppressICCSpaces<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 41


<strong>PDF</strong> <strong>Library</strong>-specific MethodsPDPrefGetUseOutputIntentsPDPrefGetUseOutputIntentsASBool PDPrefGetUseOutputIntents (void);DescriptionReturns <strong>the</strong> value of <strong>the</strong> Output Intent flag. When this flag is true, <strong>the</strong> system overridesworking space with <strong>the</strong> Output Intent, if it is present.ParametersNone.Return ValueThe Output Intent flag value.Header File<strong>PDF</strong>LCalls.hRelated MethodsPDPrefSetUseOutputIntents<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 42


<strong>PDF</strong> <strong>Library</strong>-specific MethodsPDPrefSetAntialiasLevelPDPrefSetAntialiasLevelvoid PDPrefSetAntialiasLevel (ASInt16 antialiasPixelLevel);DescriptionSets <strong>the</strong> default smooth text and smooth images global flags for subsequent renderingmethods.If <strong>the</strong> function PDPageDrawContentsToMemory is used for drawing, <strong>the</strong>smoothFlags value passed <strong>to</strong> that function supercedes <strong>the</strong> preference value for <strong>the</strong>duration of <strong>the</strong> call.ParametersantialiasPixelLevelThe anitalias level, in pixels. An OR of <strong>the</strong> followingflags:● PDPrefAASmoothText● PDPrefAASmoothLineArt● PDPrefAASmoothImageReturn ValueNoneHeader File<strong>PDF</strong>LCalls.hRelated MethodsPDPrefGetAntialiasLevel<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 43


<strong>PDF</strong> <strong>Library</strong>-specific MethodsPDPrefSetBlackPointCompensationPDPrefSetBlackPointCompensationvoid PDPrefGetBlackPointCompensation (ASBool kbpc);DescriptionSets <strong>the</strong> black-point compensation flag, which controls whe<strong>the</strong>r <strong>to</strong> adjust for differences inblack points when converting colors between color spaces. When enabled, <strong>the</strong> full dynamicrange of <strong>the</strong> source space is mapped in<strong>to</strong> <strong>the</strong> full dynamic range of <strong>the</strong> destination space.When disabled, <strong>the</strong> dynamic range of <strong>the</strong> source space is simulated in <strong>the</strong> destination space(which can result in blocked or gray shadows).Parameterskbpctrue <strong>to</strong> enable black-point compensation, false o<strong>the</strong>rwise.Return ValueNone.Header File<strong>PDF</strong>LCalls.hRelated MethodsPDPrefGetBlackPointCompensation<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 44


<strong>PDF</strong> <strong>Library</strong>-specific MethodsPDPrefSetGreekLevelPDPrefSetGreekLevelvoid PDPrefSetGreekLevel (ASInt16 greekPixelLevel);DescriptionSets <strong>the</strong> greek level. The greek level is a text height below which text characters are notrendered. Instead, text-like glyphs that have no meaning but look good at very small sizeare used. This is known as "greeking".ParametersgreekPixelLevelThe greek level, in pixels.Return ValueNoneHeader File<strong>PDF</strong>LCalls.hRelated MethodsPDPrefGetGreekLevel<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 45


<strong>PDF</strong> <strong>Library</strong>-specific MethodsPDPrefSetSuppressICCSpacesPDPrefSetSuppressICCSpacesvoid PDPrefSetSuppressICCSpaces (ASUns32 nComponents,ASBool value);DescriptionSpecifies use of a default colorspace ra<strong>the</strong>r an ICC-based colorspace.ParametersnComponentsvalueThe number of ICC colorspace components.When true, use DefaultCMYK, DefaultRGB, or DefaultGraycolorspace instead of an ICC-based colorspace with <strong>the</strong> samenumber of components.Return ValueNoneHeader File<strong>PDF</strong>LCalls.hRelated MethodsPDPrefGetSuppressICCSpaces<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 46


<strong>PDF</strong> <strong>Library</strong>-specific MethodsPDPrefSetUseLocalFontsPDPrefSetUseLocalFontsvoid PDPrefSetUseLocalFonts (ASBool useLocalFonts);DescriptionEnables or disables use of local fonts.ParametersuseLocalFontsWhen true, use local fonts. when false, use global fonts.Return ValueNoneHeader File<strong>PDF</strong>LCalls.hRelated MethodsNone<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 47


<strong>PDF</strong> <strong>Library</strong>-specific MethodsPDPrefSetUseOutputIntentsPDPrefSetUseOutputIntentsvoid PDPrefSetUseLocalFonts (ASBool flag);DescriptionSets <strong>the</strong> Output Intent flag.ParametersflagWhen true, use Output Intent <strong>to</strong> override a working space, if it is present.Return ValueNoneHeader File<strong>PDF</strong>LCalls.hRelated MethodsPDPrefGetUseOutputIntents<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 48


<strong>PDF</strong> <strong>Library</strong>-specific MethodsPDPrefSetWorkingCMYKPDPrefSetWorkingCMYKvoid PDPrefSetWorkingCMYK (void* profile,ASUns32 profileLength);DescriptionSets <strong>the</strong> current CMYK working space <strong>to</strong> a given ICC profile. A CMYK working space in <strong>PDF</strong> isdefined as a profile <strong>to</strong> substitute for a corresponding /DeviceCMYK space.ParametersprofileprofileLengthA pointer <strong>to</strong> a buffer containing <strong>the</strong> ICC color profile.The length in bytes of <strong>the</strong> profile.Return ValueNoneHeader File<strong>PDF</strong>LCalls.hRelated MethodsPDPrefSetWorkingGrayPDPrefSetWorkingRGB<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 49


<strong>PDF</strong> <strong>Library</strong>-specific MethodsPDPrefSetWorkingGrayPDPrefSetWorkingGrayvoid PDPrefSetWorkingGray (void* profile,ASUns32 profileLength);DescriptionSets <strong>the</strong> current gray working space <strong>to</strong> a given ICC profile. A Gray working space in <strong>PDF</strong> isdefined as a profile <strong>to</strong> substitute for a corresponding /DeviceGray space. When renderingwith overprint preview, <strong>the</strong> gray substitution is suppressed, <strong>to</strong> avoid converting grayscale<strong>to</strong> "rich black."ParametersprofileprofileLengthA pointer <strong>to</strong> a buffer containing <strong>the</strong> ICC color profile.The length in bytes of <strong>the</strong> profile.Return ValueNoneHeader File<strong>PDF</strong>LCalls.hRelated MethodsPDPrefSetWorkingCMYKPDPrefSetWorkingRGB<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 50


<strong>PDF</strong> <strong>Library</strong>-specific MethodsPDPrefSetWorkingRGBPDPrefSetWorkingRGBvoid PDPrefSetWorkingRGB (void* profile,ASUns32 profileLength);DescriptionSet <strong>the</strong> current RGB working space <strong>to</strong> a given ICC profile. An RGB working space in <strong>PDF</strong> isdefined as a profile <strong>to</strong> substitute for a corresponding /DeviceRGB space.ParametersprofileprofileLengthA pointer <strong>to</strong> a buffer containing <strong>the</strong> ICC color profile.The length in bytes of <strong>the</strong> profile.Return ValueNoneHeader File<strong>PDF</strong>LCalls.hRelated MethodsPDPrefSetWorkingCMYKPDPrefSetWorkingGray<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 51


<strong>PDF</strong> <strong>Library</strong>-specific CallbacksASExtensionProgressProcACCB1 void ACCB2 ASExtensionProgressProc(ASExtension extension, ASExtensionPhase phase,void* clientData);DescriptionCalled periodically during plug-in loading with <strong>the</strong> ASExtension currently being loaded.N OTE:Extensions <strong>to</strong> <strong>the</strong> <strong>PDF</strong> <strong>Library</strong> are very similar <strong>to</strong> plugins <strong>to</strong> <strong>the</strong> Adobe Acrobatapplication. However, Adobe does not currently supply any extensions or support<strong>the</strong>ir creation.ParametersextensionphaseclientDataThe plug-in.The context of <strong>the</strong> load, which determines <strong>the</strong> sequence ofoperations during <strong>the</strong> load operation. One of <strong>the</strong>se constants:ASExtensionPhase_LOADINGASExtensionPhase_EXPORTINGASExtensionPhase_IMPORTINGASExtensionPhase_INITIALIZINGASExtensionPhase_UNLOADINGA pointer <strong>to</strong> <strong>the</strong> client data.Return ValueNoneHeader File<strong>PDF</strong>Init.hRelated CallbacksASExtensionReportErrorProcRelated MethodsNone<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 52


<strong>PDF</strong> <strong>Library</strong>-specific CallbacksASExtensionReportErrorProcASExtensionReportErrorProcACCB1 void ACCB2 ASExtensionReportErrorProc(ASExtension extension, ASExtensionPhase phase,ASInt32 error, void* clientData);DescriptionCalled during ASExtension initialization whenever an error occurs.ParametersextensionphaseerrorclientDataThe plug-in.Phase.The error code.A pointer <strong>to</strong> <strong>the</strong> client data.Return ValueNoneHeader File<strong>PDF</strong>Init.hRelated CallbacksASExtensionProgressProcRelated MethodsNone<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 53


<strong>PDF</strong> <strong>Library</strong>-specific CallbacksASMemAllocProcASMemAllocProcACCB1 void* ACCB2 ASMemAllocProc (void* clientData,ASSize_t size);DescriptionCalled when <strong>the</strong> <strong>PDF</strong> <strong>Library</strong> needs <strong>to</strong> allocate memory. Callback should allocate <strong>the</strong>requested amount of memory and return it as a void*.ParametersclientDatasizeThe clientData specified in <strong>the</strong> TKAlloca<strong>to</strong>rProcsstructure.The amount of memory <strong>to</strong> be allocated.Return ValuePointer <strong>to</strong> <strong>the</strong> allocated block of memory.Header File<strong>PDF</strong>Init.hRelated CallbacksASMemAvailProcASMemFreeProcASMemReallocProcRelated Methods<strong>PDF</strong>LInitExamplevoid* StdMemAllocProc(void* clientData, void* p, ASSize_t size){return malloc(p, size);}<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 54


<strong>PDF</strong> <strong>Library</strong>-specific CallbacksASMemAvailProcASMemAvailProcACCB1 ASSize_t* ACCB2 ASMemAvailProc (void* clientData);DescriptionCalled when <strong>the</strong> <strong>PDF</strong> <strong>Library</strong> needs <strong>to</strong> determine <strong>the</strong> amount of available free memory.ParametersclientDataA pointer <strong>to</strong> <strong>the</strong> clientData specified in <strong>the</strong>TKAlloca<strong>to</strong>rProcs structure.Return ValueAmount of available free memory.Header File<strong>PDF</strong>Init.hRelated CallbacksASMemAllocProcASMemFreeProcASMemReallocProcRelated Methods<strong>PDF</strong>LInitExampleos_size_t sys_memavail(void){MEMORYSTATUS ms;ms.dwLength = sizeof(ms);GlobalMemoryStatus(&ms);return ms.dwAvailPhys + ms.dwAvailPageFile;}<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 55


<strong>PDF</strong> <strong>Library</strong>-specific CallbacksASMemFreeProcASMemFreeProcACCB1 void* ACCB2 ASMemFreeProc (void* clientData, void* p);DescriptionCalled when <strong>the</strong> <strong>PDF</strong> <strong>Library</strong> needs <strong>to</strong> free memory. Callback should free <strong>the</strong> requestedblock of memory.ParametersclientDatapA pointer <strong>to</strong> <strong>the</strong> clientData specified in <strong>the</strong>TKAlloca<strong>to</strong>rProcs structure.A pointer <strong>to</strong> memory <strong>to</strong> free.Return ValueNoneHeader File<strong>PDF</strong>Init.hRelated CallbacksASMemAllocProcASMemAvailProcASMemReallocProcRelated Methods<strong>PDF</strong>LInitExamplevoid StdMemFreeProc(void* clientData, void* p){free(p);}<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 56


<strong>PDF</strong> <strong>Library</strong>-specific CallbacksASMemReallocProcASMemReallocProcACCB1 void* ACCB2 ASMemReallocProc (void* clientData, void* p,ASSize_t size);DescriptionCalled when <strong>the</strong> <strong>PDF</strong> <strong>Library</strong> needs <strong>to</strong> reallocate memory. Callback should reallocate <strong>the</strong>requested amount of memory and return it as a void*.ParametersclientDatapsizeA pointer <strong>to</strong> <strong>the</strong> clientData specified in <strong>the</strong>TKAlloca<strong>to</strong>rProcs structure.A pointer <strong>to</strong> memory <strong>to</strong> reallocate.The amount of memory requested.Return ValuePointer <strong>to</strong> allocated block of memory.Header File<strong>PDF</strong>Init.hRelated CallbacksASMemAllocProcASMemAvailProcASMemFreeProcRelated Methods<strong>PDF</strong>LInitExamplevoid* StdMemReallocProc(void* clientData, void* p, ASSize_t size){return realloc(p, size);}<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 57


<strong>PDF</strong> <strong>Library</strong>-specific CallbacksCancelPrintJobCancelPrintJobACCB1 ASBool ACCB2 CancelPrintJob (PDPrintClient printClient);DescriptionCallback for PDPrintClient. CancelPrintJob is called <strong>to</strong> actually cause <strong>the</strong> print job<strong>to</strong> be cancelled. It should s<strong>to</strong>p fur<strong>the</strong>r printing and preferably should remove <strong>the</strong>incomplete print job.ParametersprintClientThe PDPrintClient from which this is invoked.Return ValueReturns true if <strong>the</strong> print job was successfully cancelled.Header File<strong>PDF</strong>LExpT.hRelated MethodsPDDocPrintPages<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 58


<strong>PDF</strong> <strong>Library</strong>-specific CallbacksDataSourceStringDataSourceStringACCB1 ASUns32 ACCB2 DataSourceString (<strong>PDF</strong>ileSpec f, char* buf,ASUns32 bufSize, void* clientData);Description(Optional) If this method is supplied, and <strong>the</strong> emitExternalStreamRef parameter in<strong>the</strong> PDPrintParamsRec is true, <strong>the</strong>n during PostScript printing this method will becalled when an external stream is encountered. If <strong>the</strong> method is not supplied, or if it returnsNULL, <strong>the</strong>n <strong>the</strong> “simple pathname” will be written as <strong>the</strong> DataSource for <strong>the</strong> stream;o<strong>the</strong>rwise, <strong>the</strong> returned string will be written as <strong>the</strong> DataSource.The DataSource is used thus:/DataSource (xxxxx) (r) filewhere xxxxx is <strong>the</strong> returned string or <strong>the</strong> simple pathname.N OTE:The method may not s<strong>to</strong>re <strong>the</strong> <strong>PDF</strong>FileSpec pointer or any pointers (strings)within it.ParametersfbufbufSizeclientDataAn object of type <strong>PDF</strong>ileSpec.(Filled by <strong>the</strong> callback) The buffer.The buffer size in bytes.A pointer <strong>to</strong> <strong>the</strong> client data.Return ValueLength of <strong>the</strong> string written info buf.Header File<strong>PDF</strong>LExpT.hRelated MethodsPDDocPrintPages<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 59


<strong>PDF</strong> <strong>Library</strong>-specific CallbacksDocBeginDocBeginACCB1 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.ParametersrangesnumRangesstmdocTreeprintClientRanges of pages in document <strong>to</strong> print.Number of page ranges in document <strong>to</strong> print.The PostScript print stream.Must be NULL.The PDPrintClient from which this is invoked.Return ValueNoneHeader File<strong>PDF</strong>LExpT.hRelated MethodsPDDocPrintPages<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 60


<strong>PDF</strong> <strong>Library</strong>-specific CallbacksDocEndDocEndACCB1 void ACCB2 DocEnd (ASStm stm,PDPrintClient printClient);Description(Optional) Callback for PDPrintClient. End processing a document for printing.ParametersstmprintClientThe PostScript print stream.The PDPrintClient from which this is invoked.Return ValueNoneHeader File<strong>PDF</strong>LExpT.hRelated MethodsPDDocPrintPages<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 61


<strong>PDF</strong> <strong>Library</strong>-specific CallbacksDocSetupDocSetupACCB1 ASBool ACCB2 DocSetup (const PDPageRange ranges[],ASInt32 numRanges, ASStm prologStm,PDPrintClient printClient);Description(Optional) Callback for PDPrintClient. Set up a document for printing.ParametersrangesnumRangesprologStmprintClientRanges of pages in document <strong>to</strong> print.Number of page ranges in document <strong>to</strong> print.The prolog stream.The PDPrintClient from which this is invoked.Return Valuefalse if you don’t want PDDocPrintPages <strong>to</strong> emit procsets and o<strong>the</strong>r resources.Header File<strong>PDF</strong>LExpT.hRelated MethodsPDDocPrintPages<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 62


<strong>PDF</strong> <strong>Library</strong>-specific CallbacksEmitFontProcSetEmitFontProcSetACCB1 ASBool ACCB2 EmitFontProcSet(ASStm stm, <strong>PDF</strong>ont fontP,PDPrintClient printClient);Description(Optional) Callback for PDPrintClient. EmitFontProcSet is called while emitting<strong>the</strong> document prolog. It should emit any procsets required <strong>to</strong> download <strong>the</strong> font. Theroutine will be called once for each font in <strong>the</strong> document. However, each procset onlyneeds <strong>to</strong> be downloaded once per document.ParametersstmfontPprintClientThe stream where <strong>the</strong> procset should be written.<strong>PDF</strong>ont for <strong>the</strong> font.The PDPrintClient from which this is invoked.Return Valuefalse if fontDownloadContext is not specified in <strong>the</strong> PDPrintClient; trueo<strong>the</strong>rwise.Header File<strong>PDF</strong>LExpT.hRelated MethodsPDDocPrintPages<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 63


<strong>PDF</strong> <strong>Library</strong>-specific CallbacksEmitGlyphsIncrEmitGlyphsIncrACCB1 ASBool ACCB2 EmitGlyphsIncr (ASStm stm, <strong>PDF</strong>ont fontP,PDPrintStrP srcStr, PDPrintStrP dstStr,ASUns32* srcBytesUsed, ASUns32* dstBytesUsed,ASUns32* glyphCount, ASUns16* fontIndex,PDPrintClient printClient);DescriptionCallback for PDPrintClient. Emit glyphs incrementally.ParametersstmfontPsrcStrdstStrsrcBytesUsedPdstBytesUsedPglyphCountfontIndexPprintClientThe PostScript print stream for this page.<strong>PDF</strong>ont for <strong>the</strong> font.Source string.Destination string.Source bytes used.Destination bytes used.Number of glyphs.Font index.The PDPrintClient from which this is invoked.Return Valuetrue if <strong>the</strong> glyphs successfully download, false o<strong>the</strong>rwise.Header File<strong>PDF</strong>LExpT.hRelated MethodsPDDocPrintPages<strong>PDF</strong>ontPSEmitGlyphsIncr<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 64


<strong>PDF</strong> <strong>Library</strong>-specific CallbacksEmitPageContentsEmitPageContentsACCB1 void ACCB2 EmitPageContents (ASStm stm, ASInt32 pageNum,PDPage pdPage, PDPrintClient printClient);Description(Optional) Callback for PDPrintClient. Emit <strong>the</strong> page contents for printing. Broadcast anotification that <strong>the</strong> page has been printed:ParametersNOTIFY(PDDocDidPrintPage)(doc, page, stm, error)There is a default callback for PostScript printing.stmpageNumpdPageprintClientThe PostScript print stream for this page.The number of <strong>the</strong> page whose contents is emitted.The PDPage <strong>to</strong> print.The PDPrintClient from which this is invoked.Return ValueNoneHeader File<strong>PDF</strong>LExpT.hRelated MethodsPDDocPrintPages<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 65


<strong>PDF</strong> <strong>Library</strong>-specific CallbacksEmitPrologStringEmitPrologStringACCB1 ASInt32 ACCB2 EmitPrologString (const char* s,ASInt32 nData, PDPrintClient printClient);Description(Optional) Callback for PDPrintClient. Emits prolog string.Defaults <strong>to</strong> a method that calls FlushString.ParameterssnDataprintClientPointer <strong>to</strong> <strong>the</strong> prolog string <strong>to</strong> emit.Length of s in bytes.The PDPrintClient from which this is invoked.Return ValueIf successful, result is greater than zero. If unsuccessful, result is negative.Header File<strong>PDF</strong>LExpT.hRelated MethodsPDDocPrintPages<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 66


<strong>PDF</strong> <strong>Library</strong>-specific CallbacksEmitPSFontBeginEmitPSFontBeginACCB1 void ACCB2 EmitPSFontBegin (ASStm stm, <strong>PDF</strong>ont fontP,PDPrintClient printClient);Description(Optional) Callback for PDPrintClient. Called before a font is emitted (outside DSCcomments).ParametersstmfontPprintClientThe PostScript print stream for <strong>the</strong> current page.The font <strong>to</strong> emit.The PDPrintClient from which this is invoked.Return ValueNoneHeader File<strong>PDF</strong>LExpT.hRelated MethodsPDDocPrintPages<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 67


<strong>PDF</strong> <strong>Library</strong>-specific CallbacksEmitPSFontEncodingBeginEmitPSFontEncodingBeginACCB1 ASBool ACCB2 EmitPSFontEncodingBegin (ASStm stm,<strong>PDF</strong>ont fontP, PDPrintClient printClient);Description(Optional) Callback for PDPrintClient. Called before a font encoding is emitted.ParametersstmfontPprintClientThe PostScript print stream for <strong>the</strong> current page.The font whose encoding is emitted.The PDPrintClient from which this is invoked.Return ValueMust be true.Header File<strong>PDF</strong>LExpT.hRelated MethodsPDDocPrintPages<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 68


<strong>PDF</strong> <strong>Library</strong>-specific CallbacksEmitPSFontEncodingEndEmitPSFontEncodingEndACCB1 void ACCB2 EmitPSFontEncodingEnd (ASStm stm,<strong>PDF</strong>ont fontP, PDPrintClient printClient);Description(Optional) Callback for PDPrintClient. Called after a font encoding is emitted.ParametersstmfontPprintClientThe PostScript print stream for <strong>the</strong> current page.The font whose encoding was emitted.The PDPrintClient from which this is invoked.Return ValueNoneHeader File<strong>PDF</strong>LExpT.hRelated MethodsPDDocPrintPages<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 69


<strong>PDF</strong> <strong>Library</strong>-specific CallbacksEmitPSFontEndEmitPSFontEndACCB1 void ACCB2 EmitPSFontEnd (ASStm stm, <strong>PDF</strong>ont fontP,PDPrintClient printClient);Description(Optional) Callback for PDPrintClient. Called after a font is emitted (outside DSCcomments).ParametersstmfontPprintClientThe PostScript print stream for <strong>the</strong> current page.The font that was emitted.The PDPrintClient from which this is invoked.Return ValueNoneHeader File<strong>PDF</strong>LExpT.hRelated MethodsPDDocPrintPages<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 70


<strong>PDF</strong> <strong>Library</strong>-specific CallbacksEmitPSResourceBeginEmitPSResourceBeginACCB1 void ACCB2 EmitPSResourceBegin (ASStm stm,ASA<strong>to</strong>m resType, char* resName, CosObj resObj,PDPrintClient printClient);Description(Optional) Callback for PDPrintClient. Called before a PostScript resource is emitted.ParametersstmresTyperesNameresObjprintClientThe PostScript print stream for <strong>the</strong> current page.An ASA<strong>to</strong>m representing <strong>the</strong> name of <strong>the</strong> resource type, such asColorSpace or XObject, as defined in section 3.7.2 of <strong>the</strong> <strong>PDF</strong><strong>Reference</strong>.Name of <strong>the</strong> resource in <strong>the</strong> current page.The resource’s Cos object.The PDPrintClient from which this is invoked.Return ValueNoneHeader File<strong>PDF</strong>LExpT.hRelated MethodsPDDocPrintPages<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 71


<strong>PDF</strong> <strong>Library</strong>-specific CallbacksEmitPSResourceEndEmitPSResourceEndACCB1 void ACCB2 EmitPSResourceEnd (ASStm stm, ASA<strong>to</strong>m resType,char* resName, CosObj resObj, PDPrintClient printClient);Description(Optional) Callback for PDPrintClient. Called after a PostScript resource is emitted.ParametersstmresTyperesNameresObjprintClientThe PostScript print stream for <strong>the</strong> current page.An ASA<strong>to</strong>m representing <strong>the</strong> name of <strong>the</strong> resource type, such asColorSpace or XObject as defined in section 3.7.2 of <strong>the</strong> <strong>PDF</strong><strong>Reference</strong>.Name of <strong>the</strong> resource in <strong>the</strong> current page.The resource’s Cos object.The PDPrintClient from which this is invoked.Return ValueNoneHeader File<strong>PDF</strong>LExpT.hRelated MethodsPDDocPrintPages<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 72


<strong>PDF</strong> <strong>Library</strong>-specific CallbacksEndSetupEndSetupACCB1 void ACCB2 EndSetup (ASStm stm,PDPrintClient printClient);Description(Optional) Callback for PDPrintClient. End <strong>the</strong> setup for printing a document.One task that might be performed here is <strong>to</strong> broadcast a notification for each range ofpages that will be printed, as in this pseudo code:Parametersfor i = 0 <strong>to</strong> numRanges-1 ...{NOTIFY(PDDocWillPrintPages)(doc, fromPage, <strong>to</strong>Page, psLevel,binaryOK);for pageNum = ranges[i]->startPage <strong>to</strong> ranges[i]->lastPage ...}stmprintClientThe PostScript print stream.The PDPrintClient from which this is invoked.Return ValueNoneHeader File<strong>PDF</strong>LExpT.hRelated MethodsPDDocPrintPages<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 73


<strong>PDF</strong> <strong>Library</strong>-specific CallbacksFlushIncrGlyphListFlushIncrGlyphListACCB1 void ACCB2 FlushIncrGlyphList (ASStm stm,PDPrintClient printClient);Description(Required) Callback for PDPrintClient. FlushIncrGlyphList is called <strong>to</strong> flush <strong>the</strong>list of glyphs that have been incrementally download since <strong>the</strong> calls <strong>to</strong> EmitFont or <strong>the</strong>last call of FlushIncrGlyphList. This routine will be called if <strong>the</strong> caller generatesPostScript code that would flush glyphs procedures that have been downloaded <strong>to</strong> <strong>the</strong>PostScript interpreter. For example, if at <strong>the</strong> beginning of each page a “save” is executedand <strong>the</strong>n at <strong>the</strong> end of a page a “res<strong>to</strong>re” is executed, any glyph procedures downloadedafter <strong>the</strong> beginning of <strong>the</strong> page will be removed when <strong>the</strong> res<strong>to</strong>re is executed.The call <strong>to</strong> FlushIncrGlyphList indicates that all <strong>the</strong> glyphs need <strong>to</strong> be redownloaded,by calls <strong>to</strong> EmitGlyphsIncr.ParametersstmprintClientThe PostScript print stream.The PDPrintClient from which this is invoked.Return ValueNoneHeader File<strong>PDF</strong>LExpT.hRelated MethodsPDDocPrintPages<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 74


<strong>PDF</strong> <strong>Library</strong>-specific CallbacksFlushStringFlushStringACCB1 ASInt32 ACCB2 FlushString (char* data, ASInt32 nData,PDPrintClient printClient);Description(Required) Callback for PDPrintClient. Called when <strong>the</strong> ASStm buffer is full. Buffereddata should be sent <strong>to</strong> <strong>the</strong> printer, driver, file, or o<strong>the</strong>r destination. Not used for non-PostScript printing.ParametersdatanDataprintClientPointer <strong>to</strong> data <strong>to</strong> send.Length of data, in bytes.The PDPrintClient from which this is invoked.Return ValueNoneHeader File<strong>PDF</strong>LExpT.hRelated MethodsPDDocPrintPages<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 75


<strong>PDF</strong> <strong>Library</strong>-specific CallbacksGetComponentFontListGetComponentFontListACCB1 void ACCB2 GetComponentFontList (<strong>PDF</strong>ont fontP,PDPrintFontArray fontList, PDPrintClient printClient);Description(Required) Callback for PDPrintClient. GetComponentFontList is called <strong>to</strong> get <strong>the</strong>list of component font names used for substitution. For fonts that do not requiresubstitution or are substituted by only one font, <strong>the</strong> list returned should only have oneelement. For a Type 0 font that requires several fonts for font substitution, <strong>the</strong> list will havemultiple fonts. The fontnames returned are <strong>the</strong> names used by <strong>the</strong> font definitionsdownloaded <strong>to</strong> PostScript. The font definitions <strong>the</strong>mselves are downloaded by a call <strong>to</strong> <strong>the</strong>EmitFont routine.ParametersfontPfontListprintClientThe font.Font array.The PDPrintClient from which this is invoked.Return ValueNoneHeader File<strong>PDF</strong>LExpT.hRelated MethodsPDDocPrintPages<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 76


<strong>PDF</strong> <strong>Library</strong>-specific CallbacksGetFontVMUsageGetFontVMUsageACCB1 ASInt32 ACCB2 GetFontVMUsage (ASStm stm,PDPrintClient printClient);Description(Optional) Callback for PDPrintClient. Asks client what <strong>the</strong> VM usage is for <strong>the</strong> font.ParametersstmprintClientThe PostScript print stream.The PDPrintClient from which this is invoked.Return ValueVM usage, in bytes.Header File<strong>PDF</strong>LExpT.hRelated MethodsPDDocPrintPages<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 77


<strong>PDF</strong> <strong>Library</strong>-specific CallbacksNotifyNewPageNotifyNewPageACCB1 void ACCB2 NotifyNewPage (ASInt32 pageNum,PDPrintClient printClient);Description(Optional) Callback for PDPrintClient. Called once for each page printed.A client can use this notification <strong>to</strong> update <strong>the</strong> page number in <strong>the</strong> message pane, forexample.ParameterspageNumprintClientThe number of <strong>the</strong> page <strong>to</strong> print.The PDPrintClient from which this is invoked.Return ValueNoneHeader File<strong>PDF</strong>LExpT.hRelated MethodsPDDocPrintPages<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 78


<strong>PDF</strong> <strong>Library</strong>-specific CallbacksOPIhandlerOPIhandlerACCB1 ASBool ACCB2 OPIhandler (OPIDict* opi, ASStm stm,void* clientData);Description(Optional) Callback for PDPrintClient. If supplied, it is called during PostScript printingwhen a form or image containing an OPI dictionary is encountered. If it returns true, <strong>the</strong>client is presumed <strong>to</strong> have taken care of <strong>the</strong> entire form or image, and PDPrint emitsnothing. O<strong>the</strong>rwise, PDPrint generates OPI comments based on <strong>the</strong> dictionary.N OTE:The method may not s<strong>to</strong>re <strong>the</strong> OPIdict pointer or any pointers within it.ParametersopistmclientDataThe OPI dictionary.The PostScript print stream.A pointer <strong>to</strong> <strong>the</strong> client data.Return Valuetrue if <strong>the</strong> client has taken care of <strong>the</strong> entire form or image, false o<strong>the</strong>rwise.Header File<strong>PDF</strong>LExpT.hRelated MethodsPDDocPrintPages<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 79


<strong>PDF</strong> <strong>Library</strong>-specific CallbacksPageBeginPageBeginACCB1 void ACCB2 PageBegin (ASStm stm, ASInt32 pageNum,const PDResTree pageTree, PDPrintClient printClient);Description(Optional) Callback for PDPrintClient. Called before a page begins printing.ParametersstmpageNumpageTreeprintClientThe PostScript print stream for <strong>the</strong> current page.The number of <strong>the</strong> page being printed.Must be NULL.The PDPrintClient from which this is invoked.Return ValueNoneHeader File<strong>PDF</strong>LExpT.hRelated MethodsPDDocPrintPages<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 80


<strong>PDF</strong> <strong>Library</strong>-specific CallbacksPageCleanupPageCleanupACCB1 void ACCB2 PageCleanup (ASStm stm, ASInt32 pageNum,PDPrintClient printClient);Description(Optional) Callback for PDPrintClient. Mirrors PageSetup, PageCleanup is calledbefore we clean our dictionariesParametersstmpageNumprintClientThe PostScript print stream for <strong>the</strong> current page.The number of <strong>the</strong> page being printed.The PDPrintClient from which this is invoked.Return ValueNoneHeader File<strong>PDF</strong>LExpT.hRelated MethodsPDDocPrintPages<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 81


<strong>PDF</strong> <strong>Library</strong>-specific CallbacksPageEndPageEndACCB1 void ACCB2 PageEnd (ASStm stm, ASInt32 pageNum,ASBool veryLastPage, PDPrintClient printClient);Description(Optional) Callback for PDPrintClient. Called after a page has printed. Broadcastsnotification that page has printed:ParametersNOTIFY(PDDocDidPrintPages)(doc, fromPage, <strong>to</strong>Page, error);stmpageNumveryLastPageprintClientThe PostScript print stream for <strong>the</strong> current page.The number of <strong>the</strong> page just printed.true only for <strong>the</strong> last page of <strong>the</strong> very last range, false o<strong>the</strong>rwise.The PDPrintClient from which this is invoked.Return ValueNoneHeader File<strong>PDF</strong>LExpT.hRelated MethodsPDDocPrintPages<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 82


<strong>PDF</strong> <strong>Library</strong>-specific CallbacksPageSetupPageSetupACCB1 ASBool ACCB2 PageSetup (ASStm stm, ASInt32 pageNum,PDPrintClient printClient);Description(Optional) Callback for PDPrintClient. Called before a page is printed <strong>to</strong> set it up.ParametersstmpageNumprintClientThe PostScript print stream for <strong>the</strong> current page.The number of <strong>the</strong> page <strong>to</strong> set up.The PDPrintClient from which this is invoked.Return Valuetrue on success; o<strong>the</strong>rwise, an error is raised.Header File<strong>PDF</strong>LExpT.hRelated MethodsPDDocPrintPages<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 83


<strong>PDF</strong> <strong>Library</strong>-specific CallbacksPageSetupPostResourcePageSetupPostResourceACCB1 void ACCB2 PageSetupPostResource (ASStm stm,ASInt32 pageNum, PDPrintClient printClient);DescriptionCallback for PDPrintClient. PageSetupPostResource is called fromPDPrintPageBegin after <strong>the</strong> resource tree has been processed (all fonts and o<strong>the</strong>rresources emitted in<strong>to</strong> <strong>the</strong> PostScript stream).ParametersstmpageNumprintClientThe PostScript print stream for <strong>the</strong> current page.The number of <strong>the</strong> page <strong>to</strong> set up.The PDPrintClient from which this is invoked.Return ValueNoneHeader File<strong>PDF</strong>LExpT.hRelated MethodsPDDocPrintPages<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 84


<strong>PDF</strong> <strong>Library</strong>-specific Callbacks<strong>PDF</strong>LPrintCancelProc<strong>PDF</strong>LPrintCancelProcACCB1 ASBool ACCB2 <strong>PDF</strong>LPrintCancelProc (PDDoc pdDoc,void* clientData);DescriptionThis is called once per page of a document being printed.In addition <strong>to</strong> giving <strong>the</strong> ability <strong>to</strong> cancel <strong>the</strong> print job, a developer can use this callback <strong>to</strong>return control briefly <strong>to</strong> an application <strong>to</strong> handle events, update UI elements, and so on.The library pauses printing until <strong>the</strong> return from this procedure, because it is singlethreaded.ParameterspdDocclientDataThe document being printed.A pointer <strong>to</strong> <strong>the</strong> client data that was passed in <strong>the</strong><strong>PDF</strong>LPrintUserParamsRec with <strong>the</strong> call <strong>to</strong> <strong>PDF</strong>LPrintDoc.Return Valuetrue <strong>to</strong> cancel <strong>the</strong> print job, false o<strong>the</strong>rwise.Header File<strong>PDF</strong>LExpT.hRelated CallbacksASCancelProcCancelProcRelated Data<strong>PDF</strong>LPrintUserParamsRecRelated MethodsNone<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 85


<strong>PDF</strong> <strong>Library</strong>-specific CallbacksPDPrintCanEmitFontProcPDPrintCanEmitFontProcACCB1 ASBool ACCB2 PDPrintCanEmitFontProc (<strong>PDF</strong>ont fontP,PDPrintClient printClient);Description(Optional) Callback for PDPrintClient. Called <strong>to</strong> determine whe<strong>the</strong>r a font can beemitted in<strong>to</strong> <strong>the</strong> print job. This is used <strong>to</strong> determine whe<strong>the</strong>r a font is a document-includedresource. Only used for PostScript printing.If NULL, <strong>the</strong> default is <strong>to</strong> assume that any font can be emitted.ParametersfontPprintClientThe font <strong>to</strong> check.The PDPrintClient from which this is invoked.Return Valuetrue if client can emit specified font, false o<strong>the</strong>rwise.Header File<strong>PDF</strong>LExpT.hRelated MethodsPDDocPrintPages<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 86


<strong>PDF</strong> <strong>Library</strong>-specific CallbacksPDPrintEmitFontProcPDPrintEmitFontProcACCB1 ASBool ACCB2 PDPrintEmitFontProc (ASStm stm,<strong>PDF</strong>ont fontP, PDPrintClient printClient);Description(Required) Callback for PDPrintClient. Emits a font. For Type0 fonts that require fontsubstition this routine may emit multiple font definitions. The caller can get <strong>the</strong> list of fontsused by calling GetFontComponentList.ParametersstmfontPprintClientThe PostScript print stream for <strong>the</strong> current page.Font <strong>to</strong> emit.The PDPrintClient from which this is invoked.Return Valuetrue if font emitted; false o<strong>the</strong>rwise.Header File<strong>PDF</strong>LExpT.hRelated MethodsPDDocPrintPages<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 87


<strong>PDF</strong> <strong>Library</strong>-specific CallbacksPDPrintEmitPrologResourceProcPDPrintEmitPrologResourceProcACCB1 void ACCB2 PDPrintEmitPrologResourceProc (ASStm stm,ASInt32 resID, PDPrintClient printClient);Description(Required) Callback for PDPrintClient. Takes a resID and creates <strong>the</strong> PostScriptprolog.ParametersstmresIDprintClientThe PostScript print stream for <strong>the</strong> current page.PostScript procset resource ID.The PDPrintClient from which this is invoked.Return ValueNoneHeader File<strong>PDF</strong>LExpT.hRelated MethodsPDDocPrintPages<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 88


<strong>PDF</strong> <strong>Library</strong>-specific CallbacksPDPrintGetFontEncodingMethodProcPDPrintGetFontEncodingMethodProcACCB1 ASInt32 ACCB2 PDPrintGetFontEncodingMethodProc(<strong>PDF</strong>ont fontP, PDPrintClient printClient);Description(Required for PostScript printing) Callback for PDPrintClient. Asks client which encodingmethod should be used for <strong>the</strong> font.ParametersfontPprintClientThe font whose encoding method is determined.The PDPrintClient from which this is invoked.Return ValueEncoding method, which must be one of <strong>the</strong> following:●●●Header File<strong>PDF</strong>LExpT.hkPDDoReencode — Use for Type 1 fonts and substituted fonts.kPDDoNothing — Use for TrueType Windows font or built-in encoding font.kPDDoXlate — Use for a TrueType cus<strong>to</strong>m font or font with Macin<strong>to</strong>sh encoding.Related MethodsPDDocPrintPages<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 89


<strong>PDF</strong> <strong>Library</strong>-specific CallbacksShouldCancelShouldCancelACCB1 ASBool ACCB2 ShouldCancel(PDPrintClient printClient);DescriptionCallback for PDPrintClient. ShouldCancel is called at least once per page. It shouldreturn true if <strong>the</strong> print job should be cancelled (typically, <strong>the</strong> user hit key combination <strong>to</strong>cancel printing).ParametersprintClientThe PDPrintClient from which this is invoked.Return Valuetrue if <strong>the</strong> print job should be cancelled, false o<strong>the</strong>rwise.Header File<strong>PDF</strong>LExpT.hRelated MethodsPDDocPrintPages<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 90


<strong>PDF</strong> <strong>Library</strong>-specific CallbacksTKResourceAcquireProcTKResourceAcquireProcACCB1 void* ACCB2 TKResourceAcquireProc (char* resourceName,ASInt32 resType, void* registry, ASInt32* size,void* clientData, ASStm* rdStm);DescriptionCallback in TKResourceProcs structure in <strong>the</strong> Adobe <strong>PDF</strong> <strong>Library</strong>. Acquires <strong>the</strong>specified resource and use it <strong>to</strong> fill in <strong>the</strong> rdStm parameter.ParametersresourceNameresTyperegistrysizeclientDatardStmName of resource <strong>to</strong> acquire.One of <strong>the</strong> following from <strong>the</strong> resType enum:resCMapDataresCharTypeDataresCharRangeDataresFontPropDataresCJKNoteFontNormalresCJKNoteFontBoldresCJKNoteFontObliqueresFontDataresCMapLastIDOne of <strong>the</strong> following.● Adobe-Japan1—Japanese● Adobe-Korea1—Korean● Adobe-CNS1—Traditional Chinese● Adobe-GB1—Simplified Chinese(Filled by <strong>the</strong> callback) Size of <strong>the</strong> ASStm returned.A pointer <strong>to</strong> <strong>the</strong> clientData specified in <strong>the</strong>TKResourceProcs structure.(Filled by <strong>the</strong> callback) An ASStm for <strong>the</strong> data requested.Return ValueA void* of data that you want returned <strong>to</strong> you in TKResourceReleaseProc. Thisdata can be used <strong>to</strong> determine what Resource <strong>to</strong> release. You can return NULL fromTKResourceAcquireProc.Header File<strong>PDF</strong>Init.h<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 91


<strong>PDF</strong> <strong>Library</strong>-specific CallbacksTKResourceAcquireProcRelated CallbacksTKResourceReleaseProcRelated Methods<strong>PDF</strong>LInit<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 92


<strong>PDF</strong> <strong>Library</strong>-specific CallbacksTKResourceReleaseProcTKResourceReleaseProcACCB1 void ACCB2 TKResourceReleaseProc (ASStm rdStm,void* data, void* clientData);DescriptionCallback in TKResourceProcs structure in <strong>the</strong> Adobe <strong>PDF</strong> <strong>Library</strong>. Releases <strong>the</strong>resources previously acquired and closes <strong>the</strong> ASStm passed in as rdStm.ParametersrdStmdataclientDataAn ASStm for <strong>the</strong> resource <strong>to</strong> release and close with ASStmClose.The clientData returned from PMSetTextProc.A pointer <strong>to</strong> <strong>the</strong> clientData specified in <strong>the</strong>TKResourceProcs structure.Return ValueNoneHeader File<strong>PDF</strong>Init.hRelated CallbacksPMSetTextProcRelated Methods<strong>PDF</strong>LInit<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 93


<strong>PDF</strong> <strong>Library</strong>-specific CallbacksUndefineFontUndefineFontACCB1 ASBool ACCB2 UndefineFont (ASStm stm, <strong>PDF</strong>ont fontP,ASBool vmUndefine, PDPrintClient client)Description(Required) UndefineFont is called <strong>to</strong> remove <strong>the</strong> font from <strong>the</strong> list of fonts that havebeen downloaded and <strong>to</strong> undefine <strong>the</strong> font from PostScript VM. It may be called during apage, at <strong>the</strong> end of <strong>the</strong> page, or between pages. After this routine is called, if <strong>the</strong> font isrequired again, <strong>the</strong> EmitFont routine will be called.ParametersstmfontPvmUndefineprintClientStream <strong>to</strong> which <strong>the</strong> PostScript code <strong>to</strong> undefine <strong>the</strong> font will bewritten.<strong>PDF</strong>ont for <strong>the</strong> font <strong>to</strong> be removed.If true and this is a level 2 or greater PostScript interpreter,PostScript code will be emitted <strong>to</strong> undefine <strong>the</strong> font. If false, <strong>the</strong>nit will just be removed from <strong>the</strong> list of fonts that have already beendownloaded.The PDPrintClient from which this is invoked.Return Valuetrue on success.Header File<strong>PDF</strong>LExpT.hRelated MethodsPDDocPrintPages<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 94


<strong>PDF</strong> <strong>Library</strong>-specific DeclarationsASExtensionPhaseenum{ASExtensionPhase_LOADING,ASExtensionPhase_EXPORTING,ASExtensionPhase_IMPORTING,ASExtensionPhase_INITIALIZING,ASExtensionPhase_UNLOADING};typedef ASInt16 ASExtensionPhase;DescriptionSelec<strong>to</strong>r indicating what phase of loading is happening.Header File<strong>PDF</strong>Init.hRelated MethodsNoneMembersASExtensionPhase_LOADINGASExtensionPhase_EXPORTINGASExtensionPhase_IMPORTINGASExtensionPhase_INITIALIZINGASExtensionPhase_UNLOADINGLoading phase.Exporting phase.Importing phase.Initializing phase.Unloading phase.<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 95


<strong>PDF</strong> <strong>Library</strong>-specific DeclarationsASRealASRealtypedef float ASReal;DescriptionReal number values.Header FileASExpT.hRelated StructuresASRealPoint<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 96


<strong>PDF</strong> <strong>Library</strong>-specific DeclarationsASRealPointASRealPointtypedef struct _t_ASRealPoint {ASReal h, v;} ASRealPoint;DescriptionReal number coordinate values.Header FileASExpT.hRelated StructuresPDPrintStr<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 97


<strong>PDF</strong> <strong>Library</strong>-specific DeclarationsOPIDictOPIDicttypedef struct {OPIversion version; /* 1.3 or 2.0 */union {OPI13dict *dict13;OPI20dict *dict20;} dict;} OPIdict;DescriptionUsed <strong>to</strong> specify an OPI dictionary.Header File<strong>PDF</strong>LExpT.hRelated CallbacksOPIhandler<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 98


<strong>PDF</strong> <strong>Library</strong>-specific DeclarationsPDDuplexEnumPDDuplexEnumenum {kPDDuplexOff,kPDDuplexOnTumbleShort,kPDDuplexOnTumbleLong};typedef ASEnum8 PDDuplexEnum;DescriptionDuplex values.Header File<strong>PDF</strong>LExpT.hRelated StructuresPDPrintParams<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 99


<strong>PDF</strong> <strong>Library</strong>-specific Declarations<strong>PDF</strong>arEastFont<strong>PDF</strong>arEastFontenum {PD<strong>PDF</strong>arEastFont_Download_All,PD<strong>PDF</strong>arEastFont_Download_None,PD<strong>PDF</strong>arEastFont_Print_As_Image};typedef ASEnum8 <strong>PDF</strong>arEastFont;DescriptionCJK font related option for PostScript printing.Header File<strong>PDF</strong>LExpT.hMembersPD<strong>PDF</strong>arEastFont_Download_AllPD<strong>PDF</strong>arEastFont_Download_NonePD<strong>PDF</strong>arEastFont_Print_As_ImageDownload all CJK fonts <strong>to</strong> printer.Download only embedded fonts <strong>to</strong>printer.GDI/QuickDraw on PostScript option.PostScript should use this <strong>to</strong> print CJK<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 100


<strong>PDF</strong> <strong>Library</strong>-specific Declarations<strong>PDF</strong>latten<strong>PDF</strong>latten<strong>PDF</strong>lattenRectypedef struct {<strong>PDF</strong>lattenTilingMode tilingMode;ASBooluseTextOutlines;ASBoolallowShadingOutput;ASBoolallowLevel3ShadingOutput;floatinternalDPI;floatexternalDPI;floatpathDPI;ASUns32tileSizePts;ASUns32maxFltnrImageSize;ASUns32adaptiveThreshold;ASBoolpreserveOverprint;} <strong>PDF</strong>lattenRec, *<strong>PDF</strong>latten;DescriptionControls tile flattening. Primarily of interest <strong>to</strong> resource limited (embedded) systemsdevelopers.Header File<strong>PDF</strong>LExpT.hMemberstilingModeuseTextOutlinesallowShadingOutputallowLevel3ShadingOutputinternalDPIexternalDPI0 = no tiling; 1 = constant tiling; 2 = adaptivetiling.Output text outlines instead of native text.Allow shading ouput.Allow level 3 shading output.Resolution for flattening interior of a<strong>to</strong>mic region.Resolution for flattening edges of a<strong>to</strong>mic regions.pathDPI Flattener path resolution, default is 800.tileSizePtsTarget tile size in points.maxFltnrImageSize Maximum image size when flattening. Default is 0.<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 101


<strong>PDF</strong> <strong>Library</strong>-specific Declarations<strong>PDF</strong>lattenadaptiveThresholdpreserveOverprintAdaptive flattening threshold.Attempt <strong>to</strong> preserve overprint.Related TypesPDPrintParams<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 102


<strong>PDF</strong> <strong>Library</strong>-specific Declarations<strong>PDF</strong>lattenTilingMode<strong>PDF</strong>lattenTilingModetypedef ASInt32 <strong>PDF</strong>lattenTilingMode;enum {kPDNoTiling = 0,kPDConstantTiling,kPDAdaptiveTiling,_MAX_FLATTENTILINGMODE = PDMAXENUM};DescriptionSupport for tiled flattening.Header File<strong>PDF</strong>LExpT.hMemberskPDNoTilingkPDConstantTilingkPDAdaptiveTilingNo tiling.Constant tiling.Adaptive tiling.<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 103


<strong>PDF</strong> <strong>Library</strong>-specific Declarations<strong>PDF</strong>LData<strong>PDF</strong>LDataWindowstypedef struct _t_<strong>PDF</strong>LData {ASSize_t size;ASUns32 flags;HINSTANCE inst;char** dirList;ASInt32 listLen;TKAlloca<strong>to</strong>rProcsP alloca<strong>to</strong>r;TKResourceProcsP resProcs;TKExtensionProcsP extProcs;} <strong>PDF</strong>LDataRec, *<strong>PDF</strong>LData;Mac OStypedef struct _t_<strong>PDF</strong>LData {ASSize_t size;ASUns32 flags;FSSpec** dirList;ASInt32 listLen;TKAlloca<strong>to</strong>rProcsP alloca<strong>to</strong>r;short resFile;TKResourceProcsP resProcs;TKExtensionProcsP extProcs;} <strong>PDF</strong>LDataRec, *<strong>PDF</strong>LData;UNIXtypedef struct _t_<strong>PDF</strong>LData {ASSize_t size;ASUns32 flags;char** dirList;ASInt32 listLen;TKAlloca<strong>to</strong>rProcsP alloca<strong>to</strong>r;TKResourceProcsP resProcs;TKExtensionProcsP extProcs;} <strong>PDF</strong>LDataRec, *<strong>PDF</strong>LData;Description(Present only in Adobe <strong>PDF</strong> <strong>Library</strong> 1.0 or later)Structure for <strong>PDF</strong>LInit.Header File<strong>PDF</strong>Init.h<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 104


<strong>PDF</strong> <strong>Library</strong>-specific Declarations<strong>PDF</strong>LDataRelated Methods<strong>PDF</strong>LGetFlags<strong>PDF</strong>LInitMemberssizeflagsinst(Windowsonly)dirListlistLenalloca<strong>to</strong>rresFile(MacOS only)Size of <strong>the</strong> data structure. Must be set <strong>to</strong> sizeof(<strong>PDF</strong>LDataRec).The only flag currently supported isk<strong>PDF</strong>LInitIgnoreDefaultDirec<strong>to</strong>ries. When this flag is set,<strong>the</strong> initialization process does not search through <strong>the</strong> default fontdirec<strong>to</strong>ries, but only in those specified in dirList.Location of resources for <strong>the</strong> <strong>Library</strong>. For a static library, you link <strong>the</strong>min<strong>to</strong> your application and use NULL for inst. For a DLL version of <strong>the</strong>library, call Load<strong>Library</strong> on <strong>the</strong> DLL and set inst equal <strong>to</strong> <strong>the</strong>HINSTANCE returned:libData.inst = Load<strong>Library</strong>("<strong>PDF</strong>L50.DLL");If you are linking <strong>the</strong> static library in<strong>to</strong> a DLL, pass <strong>the</strong> HINSTANCEpassed in<strong>to</strong> DllMain or WinMain for inst and link <strong>the</strong> resources in<strong>to</strong><strong>the</strong> DLL.Free <strong>the</strong> HINSTANCE with Free<strong>Library</strong> after you call <strong>PDF</strong>LTerm.List of direc<strong>to</strong>ries 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";Number of direc<strong>to</strong>ries listed in dirList.The structure containing function pointers for memory allocationcallbacks. The library manages its own memory. Most applicationslinking with <strong>the</strong> library should pass NULL for this member. Applicationswishing more control over memory allocation can fill out this structureand will be responsible for providing and freeing memory as well asreporting available memory as requested by <strong>the</strong> library.Resources location, if <strong>the</strong>y are not in <strong>the</strong> application itself. Set <strong>the</strong>musing OpenResFile:libData.resFile = OpenResFile("\pMyResFileGoesHere")<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 105


<strong>PDF</strong> <strong>Library</strong>-specific Declarations<strong>PDF</strong>LDataresProcsextProcsThe structure containing function pointers for resource managementcallbacks. The library manages its own resources. Most applicationslinking with <strong>the</strong> library should pass NULL for this member. Applicationswishing more control over resource allocation can fill out this structureand will be responsible for providing and freeing resources requestedby <strong>the</strong> library.The structure containing function pointers for ASExtension callbacksused by <strong>the</strong> <strong>PDF</strong> <strong>Library</strong>.<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 106


<strong>PDF</strong> <strong>Library</strong>-specific Declarations<strong>PDF</strong>LPrintUserParamsRec<strong>PDF</strong>LPrintUserParamsRecUnixtypedef struct {ASInt32 size;PDPrintParams printParams;ASBool emitToFile;ASStm printStm;ASUns16 paperWidth;ASUns16 paperHeight;ASInt32 dontEmitListLen;char** dontEmitList;ASBool emitToPrinter;char* command;<strong>PDF</strong>LPrintCancelProc cancelProc;void* clientData;} <strong>PDF</strong>LPrintUserParamsRec, *<strong>PDF</strong>LPrintUserParams;Windowstypedef 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 emitHalf<strong>to</strong>nes;<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 107


<strong>PDF</strong> <strong>Library</strong>-specific Declarations<strong>PDF</strong>LPrintUserParamsRecint reverse;int farEastFontOpt;int transQuality;int doOPP;<strong>PDF</strong>LPrintCancelProc cancelProc;void* clientData;} <strong>PDF</strong>LPrintUserParamsRec, *<strong>PDF</strong>LPrintUserParams;MacOStypedef 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;<strong>PDF</strong>LPrintCancelProc cancelProc;void* clientData;} <strong>PDF</strong>LPrintUserParamsRec, *<strong>PDF</strong>LPrintUserParams;DescriptionUsed <strong>to</strong> control printing with <strong>PDF</strong>LPrintDoc. See <strong>PDF</strong>LPrint.h for details on printingon specific platforms.N OTE:Header File<strong>PDF</strong>LPrint.hUNIX supports only PostScript, <strong>to</strong> file or printer, as controlled by <strong>the</strong> (mutuallyexclusive) emitToFile and emitToPrinter parameters.Related Callbacks<strong>PDF</strong>LPrintCancelProcRelated Methods<strong>PDF</strong>LPrintDoc<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 108


<strong>PDF</strong> <strong>Library</strong>-specific Declarations<strong>PDF</strong>LPrintUserParamsRecMembersUnixsizeprintParamsemitToFileprintStmpaperWidthpaperHeightdontEmitListLendontEmitListemitToPrintercommandcancelProcclientDataSize of <strong>the</strong> data structure. Must be set <strong>to</strong>sizeof(<strong>PDF</strong>LPrintUserParamsRec).PDPrintParams structure. Used for both creating aPostScript file and printing <strong>to</strong> a printer.Create a PostScript file. You set ei<strong>the</strong>r this parameter oremitToPrinter, but not both.Writable ASStm that points <strong>to</strong> file stm or proc stm. Applies <strong>to</strong>both PostScript printer and file.Width of paper in points. The default value is 612. Applies <strong>to</strong>PostScript printer.Height of paper in points. The default value is 792. Applies <strong>to</strong>PostScript printer.Number of fonts that should not be downloaded. Applies <strong>to</strong>both PostScript printer and file.List of fonts (T1, TT, CID) that should not be downloaded.Applies <strong>to</strong> both PostScript printer and file.Output <strong>PDF</strong> file <strong>to</strong> a PostScript printer. You set ei<strong>the</strong>r thisparameter or emitToFile, but not both.Optional command line arguments; used only ifemitToPrinter is true. For example, “lp” or “lpr.” Applies <strong>to</strong>PostScript printer.Optional <strong>PDF</strong>LPrintCancelProc. Applies <strong>to</strong> bothPostScript printer and file.Optional pointer <strong>to</strong> data passed <strong>to</strong> cancelProc. Applies <strong>to</strong>both PostScript printer and file.WindowssizeemitToFileprintParamsSize of <strong>the</strong> data structure. Must be set <strong>to</strong>sizeof(<strong>PDF</strong>LPrintUserParamsRec).Create a PostScript file. You set ei<strong>the</strong>r this parameter oremitToPrinter, but not both.PDPrintParams structure. Applies <strong>to</strong> PostScript file.<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 109


<strong>PDF</strong> <strong>Library</strong>-specific Declarations<strong>PDF</strong>LPrintUserParamsRecWindowsprintStmpaperWidthpaperHeightdontEmitListLendontEmitListemitToPrinterinFileNameoutFileNamedeviceNamedriverNameportNameWritable ASStm that points <strong>to</strong> file stm or proc stm. Applies <strong>to</strong>PostScript file.Width of paper in points. The default value is 612. Applies <strong>to</strong>printer.Height of paper in points. The default value is 792. Applies <strong>to</strong>printer.Number of fonts that should not be downloaded. Applies <strong>to</strong>PostScript printer or file.List of fonts (T1, TT, CID) that should not be downloaded. Applies<strong>to</strong> PostScript printer or file.Output <strong>PDF</strong> file <strong>to</strong> ei<strong>the</strong>r a PostScript printer or a non-PostScriptprinter. Set ei<strong>the</strong>r this parameter or emitToFile, but notboth.Used for <strong>the</strong> Windows DOCINFO structure — lpszDocNamethat points <strong>to</strong> a null-terminated string that specifies <strong>the</strong> name of<strong>the</strong> document. Applies <strong>to</strong> printer.Used for <strong>the</strong> Windows DOCINFO structure — lpszOutput. Itpoints <strong>to</strong> a null-terminated string that specifies <strong>the</strong> name of anoutput file. If this pointer is NULL, <strong>the</strong> output will be sent <strong>to</strong> <strong>the</strong>device identified by deviceName, driverName, andportName. Applies <strong>to</strong> printer.Name of device <strong>to</strong> print <strong>to</strong>. For example, “Distiller Assistantv3.01”. Available devices can be found in <strong>the</strong> Windows Registry atHKEY_CURRENT_USER\Software\Microsoft\WindowsNT\CurrentVersion\Devices. Applies <strong>to</strong> printer.Name of driver. For example, “winspool”. See registry key fordeviceName. Applies <strong>to</strong> printer.Name of Port. For example, “Ne00” See registry key fordeviceName. Applies <strong>to</strong> printer.<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 110


<strong>PDF</strong> <strong>Library</strong>-specific Declarations<strong>PDF</strong>LPrintUserParamsRecWindowspDevModestartPageendPageshrinkToFitprintAnnotspsLevelnCopiesbinaryOKemitHalf<strong>to</strong>nesreversefarEastFontOpttransQualitydoOPPcancelProcclientData(Optional) Allows you <strong>to</strong> pass a DEVMODE structure in if you haveone. Applies <strong>to</strong> printer. If you do not pass in your own DEVMODEstructure, <strong>PDF</strong>L creates its own by calling OpenPrinter(),DocumentProperties(), and ClosePrinter(). <strong>PDF</strong>Lnever calls SetPrinter() and has no facility <strong>to</strong> offer <strong>the</strong>features provided by SetPrinter() (e.g., pause/resume,deleting jobs, changing printer status, etc.).DocumentProperties() is called only in <strong>the</strong> case where <strong>the</strong>client doesn’t provide a DEVMODE.N OTE: If you provide your own DEVMODE, you will certainly want<strong>to</strong> call DocumentProperties() <strong>to</strong> populate it and/ordisplay <strong>the</strong> print dialog.Page <strong>to</strong> start printing with, 0-based. Applies <strong>to</strong> printer.Page <strong>to</strong> finish printing on. Applies <strong>to</strong> printer.1 turns on shrink <strong>to</strong> fit, 0 turns it off. Applies <strong>to</strong> PostScriptprinter.1 turns on printing annots, 0 turns it off. Applies <strong>to</strong> printer.PostScript level. Applies <strong>to</strong> PostScript printer.Number of copies <strong>to</strong> print. Applies <strong>to</strong> printer.1 turns on binary data, 0 turns it off. Applies <strong>to</strong> PostScript printer.1 turns on emit half-<strong>to</strong>nes, 0 turns it off. Applies <strong>to</strong> PostScriptprinter.1 reverses print order, 0 does regular order. Applies <strong>to</strong> printer.One of <strong>PDF</strong>arEastFont.The default value isPD<strong>PDF</strong>arEastFont_Download_All. Applies <strong>to</strong> PostScriptprinter.Transparency flattening quality control. 1 is fastest; 5 is best.Applies <strong>to</strong> printer.1 uses OverPrint Preview, 0 does not. Applies <strong>to</strong> printer.Optional <strong>PDF</strong>LPrintCancelProc. Applies <strong>to</strong> all.Optional pointer <strong>to</strong> data passed <strong>to</strong> cancelProc. Applies <strong>to</strong> all.<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 111


<strong>PDF</strong> <strong>Library</strong>-specific Declarations<strong>PDF</strong>LPrintUserParamsRecMacin<strong>to</strong>shsizeemitToFileprintParamsprintStmpaperWidthpaperHeightdontEmitListLendontEmitListemitToPrinterprintRecordprintSessionprintSettingspageFormatcancelProcclientDataSize of <strong>the</strong> data structure. Must be set <strong>to</strong>sizeof(<strong>PDF</strong>LPrintUserParamsRec).Create a PostScript file. You set ei<strong>the</strong>r this parameter oremitToPrinter, but not both.PDPrintParams structure. Applies <strong>to</strong> PostScript file.Writable ASStm that points <strong>to</strong> file stm or proc stm.Width of paper in points. The default value is 612. Applies <strong>to</strong>printer.Height of paper in points. The default value is 792. Applies <strong>to</strong>printer.Number of fonts that should not be downloaded. Applies <strong>to</strong>PostScript printer and file.List of fonts (T1, TT, CID) that should not be downloaded.Applies <strong>to</strong> PostScript printer and file.Output <strong>PDF</strong> file <strong>to</strong> ei<strong>the</strong>r a PostScript or a non-PostScriptprinter. You set ei<strong>the</strong>r this parameter or emitToFile, butnot both.Classic print record handle (THPrint) - may be NULL Applies <strong>to</strong>printer.Carbon print session - may be NULL . Applies <strong>to</strong> printer.Carbon print settings - may be NULL. Applies <strong>to</strong> printer.Carbon page format - may be NULL. Applies <strong>to</strong> printer.Optional <strong>PDF</strong>LPrintCancelProc. Applies <strong>to</strong> all.Optional pointer <strong>to</strong> data passed <strong>to</strong> cancelProc. Applies <strong>to</strong>all.<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 112


<strong>PDF</strong> <strong>Library</strong>-specific Declarations<strong>PDF</strong>ontDownloadContext<strong>PDF</strong>ontDownloadContexttypedef struct _t_<strong>PDF</strong>ontDownloadContext *<strong>PDF</strong>ontDownloadContext;DescriptionMaintains information about <strong>the</strong> current print job and what fonts have been downloaded.Header File<strong>PDF</strong>LExpt.hRelated Methods<strong>PDF</strong>ontDownloadContextCreate<strong>PDF</strong>ontDownloadContextDestroy<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 113


<strong>PDF</strong> <strong>Library</strong>-specific Declarations<strong>PDF</strong>ontStyle<strong>PDF</strong>ontStyleenum {PDRoman = 0,PDItalic,PDBold,PDBoldItalic};typedef ASUns8 <strong>PDF</strong>ontStyle;DescriptionSpecifies a syn<strong>the</strong>tic font style.Header File<strong>PDF</strong>LExpt.hRelated TypesPDPrintFontRec<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 114


<strong>PDF</strong> <strong>Library</strong>-specific DeclarationsPDInclusionPDInclusiontypedef ASEnum8 PDInclusion;enum {kIncludeOncePerDoc,kIncludeOnEveryPage,kIncludeNever};DescriptionSpecifies how <strong>to</strong> include a resource in a file.Header File<strong>PDF</strong>LExpt.hRelated TypesPDPrintParamsRelated MethodsNoneMemberskIncludeOncePerDockIncludeOnEveryPagekIncludeNeverkIncludeWhenNeededInclude <strong>the</strong> resource only once per file.Include <strong>the</strong> resource on every page in <strong>the</strong> file.Never include <strong>the</strong> resource.When needed.<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 115


<strong>PDF</strong> <strong>Library</strong>-specific DeclarationsPDOutputTypePDOutputTypetypedef ASEnum8 PDOutputType;enum {PDOutput_PS,PDOutput_EPSNoPrev,PDOutput_EPSMacStdPrev,PDOutput_EPSMacExtPrev};DescriptionSpecifies what kind of file <strong>to</strong> emit.Header File<strong>PDF</strong>LExpt.hRelated TypesPDPrintParamsRelated MethodsNoneMembersPDOutput_PSPDOutput_EPSNoPrevPDOutput_EPSMacStdPrevPDOutput_EPSMacExtPrevEmit a PostScript file.Emit an EPS file with no preview.Emit an EPS file with standard preview.Emit an EPS file with extended preview.<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 116


<strong>PDF</strong> <strong>Library</strong>-specific DeclarationsPDPageDrawSmoothFlagsPDPageDrawSmoothFlagstypedef ASUns32 PDPageDrawSmoothFlags;enum {kPDPageDrawSmoothText = 0x00000001,kPDPageDrawSmoothLineArt = 0x00000002,kPDPageDrawSmoothImage = 0x00000004};DescriptionBit flags indicating how a page is rendered.Header File<strong>PDF</strong>LExpt.hRelated TypesPDPageDrawFlagsRelated MethodsPDPageDrawContentsToMemoryMemberskPDPageDrawSmoothTextkPDPageDrawSmoothLineArtkPDPageDrawSmoothImageDraw smooth text.Draw smooth line art.Draw smooth image.<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 117


<strong>PDF</strong> <strong>Library</strong>-specific DeclarationsPDPageMarkFlagsPDPageMarkFlagstypedef ASUns32 PDPageMarkFlags;enum {kPDPageEmitColorBars = 0x0001,kPDPageEmitRegMarks = 0x0002,kPDPageEmitCropMarks = 0x0004,kPDPageEmitBleedMarks = 0x0008,kPDPageEmitPageInfo = 0x0010,kPDPageEmitTrimMarks = 0x0020,kPDPageEmitSlurMarks = 0x0040};DescriptionBit flags indicating which page marks are emitted for color separations.Header File<strong>PDF</strong>LExpt.hRelated TypesPDPrintParamsRelated Methods<strong>PDF</strong>LPrintDocPDPageEmitPSOrientAVDocPrintSeparationsPDPageMakeSeparations<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 118


<strong>PDF</strong> <strong>Library</strong>-specific DeclarationsPDPrintClientPDPrintClientPDPrintClientRectypedef 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;<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 119


<strong>PDF</strong> <strong>Library</strong>-specific DeclarationsPDPrintClientASInt32 sequentialPageNum;void* clientData;void* fontDownloadContext;ASInt32 vmUsed;} PDPrintClientRec, *PDPrintClient;DescriptionData structure used by PDDocPrintPages. Contains methods <strong>to</strong> be implemented by <strong>the</strong>client. Unless o<strong>the</strong>rwise indicated, methods may be NULL, indicating that <strong>the</strong>y do nothing.The methods are called in <strong>the</strong> order listed in this structure.Header File<strong>PDF</strong>LExpT.hRelated MethodsPDDocPrintPages<strong>PDF</strong>ontPSEmitGlyphsIncr<strong>PDF</strong>ontPSFlushIncrGlyphList<strong>PDF</strong>ontPSGetComponentFontListMemberssizepdDocparamscallbacksSize of <strong>the</strong> structure.The document <strong>to</strong> print.A control structure describing how <strong>to</strong> print <strong>the</strong>document.See individual descriptions.sequentialPageNum Current page, starting at 1.clientDatafontDownloadContextvmUsedData for <strong>the</strong> client's use. This data is passed <strong>to</strong> <strong>the</strong>OPIhandler and DataSourceString methods.For client's use <strong>to</strong> hold a font download context for <strong>the</strong>EmitFontProcSet.Amount of virtual memory used. Incremented byroutines that download fonts and resources.<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 120


<strong>PDF</strong> <strong>Library</strong>-specific DeclarationsPDPrintFontArrayPDPrintFontArrayPDPrintFontArrayPtypedef struct{ASUns32 count;ASBool usesDisplayCTFont;PDPrintFontP arr;} PDPrintFontArray, *PDPrintFontArrayP;DescriptionAn array of font pointers for use in <strong>PDF</strong>ontPSGetComponentFontList.Header File<strong>PDF</strong>LExpt.hRelated Methods<strong>PDF</strong>ontPSGetComponentFontListMemberscountusesDisplayCTFontarrThe number of fonts in arr.Whe<strong>the</strong>r <strong>to</strong> use <strong>the</strong> Display CT Font.The font array.<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 121


<strong>PDF</strong> <strong>Library</strong>-specific DeclarationsPDPrintFontPPDPrintFontPPDPrintFontRecDescriptionFont array.typedef struct{const char *name;const char *encoding;const char *cidFontName;ASInt16 style;<strong>PDF</strong>ontStyle syn<strong>the</strong>ticStyle;ASBool used;ASBool emitted;ASInt32 baseLineAdj;} PDPrintFontRec, *PDPrintFontP;Header File<strong>PDF</strong>LExpt.hRelated TypePDPrintFontArrayMembersnameencodingcidFontNamestylesyn<strong>the</strong>ticStyleusedemittedbaseLineAdjThe font name.The font encoding.CID font name.Gothic or MinchoRoman, Italic, Bold, or BoldItalic.Set <strong>to</strong> true if glyphs from this component are used.Set <strong>to</strong> true if this component is emitted.Baseline adjustment.<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 122


<strong>PDF</strong> <strong>Library</strong>-specific DeclarationsPDPrintParamsPDPrintParamsPDPrintParamsRectypedef 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 incO<strong>the</strong>rResources;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 emitHalf<strong>to</strong>nes;ASBool centerCropBox;ASBool emitSeparableImagesOnly;ASBool emitExtGState;ASFixedRect boundingBox;ASBool useFontAliasNames;ASBool emitPageRotation;<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 123


<strong>PDF</strong> <strong>Library</strong>-specific DeclarationsPDPrintParams/* New for <strong>PDF</strong> 1.3 */ASBool emitBBoxClip;ASBool reverse;ASFixedRect* tCropBox;ASBool emitPageClip;ASBool emitTransfer;ASBool emitBG;ASBool emitUCR;<strong>PDF</strong>arEastFont farEastFontOpt;ASBool suppressCJKSubstitution;float flexoX;float flexoY;ASBool suppressCSA;ASBool hostBased;ASA<strong>to</strong>m hostBasedOutputCS;PDDuplexEnum duplex;PDTile tileInfo;ASBool rotate;ASBool hostBasedCM;char destProfile[256];ASA<strong>to</strong>m destCSA<strong>to</strong>m;ASBool saveVM;ASInt32 transQuality;ASBool doOPP;ASBool optimizeForSpeed;ASBool brokenCRDs;ASBool useMaxVM;ASInt32 lastWidth;ASInt32 lastHeight;/* New for <strong>PDF</strong> 1.4 */ASUns32 bitmapResolution;ASUns32 gradientResolution;ASUns32 transparencyQuality;PDOCContext ocContext;ASBool applyOCGPrintOverrides;ASBool useFullResolutionJP2KData;ASBool emitInRipSeps;PDPageMarkFlags whichMarks;ASBool westernMarksStyle;ASBool doProofing;ASBool useExecForm;<strong>PDF</strong>latten flattenInfo;ASBool negative;<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 124


<strong>PDF</strong> <strong>Library</strong>-specific DeclarationsPDPrintParamsASEnum8 mirrorprint;ASUns32 numCollatedCopies; /* MacOS only */} PDPrintParamsRec, *PDPrintParams;DescriptionData structure indicating how a document should be printed.N OTE:All fields in <strong>the</strong> PDPrintParams structure apply only <strong>to</strong> PostScript file creation.PDPrintParams are ignored when printing <strong>to</strong> non-PostScript devices.Header File<strong>PDF</strong>LExpT.hRelated Methods<strong>PDF</strong>LPrintDocMemberssizerangesnumRangesshrinkToFitexpandToFitrotateAndCenteremitAnnotFormsemitPSSize of <strong>the</strong> data structure. Must be set <strong>to</strong>sizeof(PDPrintParams).Ranges of pages <strong>to</strong> print. Use NULL <strong>to</strong> print <strong>the</strong>entire document.Number of ranges of pages <strong>to</strong> print in ranges.The default value is 0.true if <strong>the</strong> page is scaled <strong>to</strong> fit <strong>the</strong> printer pagesize, false o<strong>the</strong>rwise. This field overridesscale. The default value is false.true if small pages are <strong>to</strong> be scaled up <strong>to</strong> fit <strong>the</strong>printer page size, false o<strong>the</strong>rwise. Overridesscale. The default value is false.true if page is <strong>to</strong> be rotated <strong>to</strong> fit printer’sorientation, and centered in printer’s page size;false o<strong>the</strong>rwise.The default value is false.Rotation and centering (true) only occur,however, if <strong>the</strong> page contents are <strong>to</strong>o wide <strong>to</strong> fi<strong>to</strong>n a narrow page (or vice versa) and <strong>the</strong> pagecontents are less than an inch smaller than <strong>the</strong>target page in one direction.Emit annotations that contain a Form XObject.The default value is true.If true, emit a PostScript file. The default value istrue.<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 125


<strong>PDF</strong> <strong>Library</strong>-specific DeclarationsPDPrintParamspsLevel PostScript level: 1, 2, or 3. The default value is 2.outputTypePrint PostScript or EPS with or without a preview.N OTE: EPS preview generation is not currentlyavailable on UNIX.N OTE: For fonts, <strong>the</strong> following 6 parameters are applied in <strong>the</strong> order in which <strong>the</strong>y areappear in this table. For example, an embedded Type 1 font follows <strong>the</strong> rule forembedded fonts, not <strong>the</strong> rule for Type 1 fonts.incBaseFontsincEmbeddedFontsincType1FontsincType3FontsincTrueTypeFontsincCIDFontsincProcsetsincO<strong>the</strong>rResourcesfontPerDocVMemitShowpageEmbed <strong>the</strong> base fonts. The default value iskIncludeNever.Embed fonts that are embedded in <strong>the</strong> <strong>PDF</strong> file.This overrides <strong>the</strong> incType1Fonts,incTrueTypeFonts, and incCIDFontsfields. The default value iskIncludeOncePerDoc.Embed Type 1 fonts. The default value iskIncludeOncePerDoc.Embed Type 3 fonts. The default value iskIncludeOnEveryPage.N OTE: This parameter must always be set <strong>to</strong>kIncludeOnEveryPage. <strong>PDF</strong> files existwith Type 3 fonts that contain differentencodings on different pages.Embed TrueType fonts. The default value iskIncludeOncePerDoc.Embed CID fonts. The default value iskIncludeOncePerDoc.Include Procsets in <strong>the</strong> file. The default value iskIncludeOncePerDoc.Include all o<strong>the</strong>r types of resources in <strong>the</strong> file. Thedefault value is kIncludeOncePerDoc.Amount of VM available for font downloading at<strong>the</strong> document level. Ignored if


<strong>PDF</strong> <strong>Library</strong>-specific DeclarationsPDPrintParamsemitTTFontsFirstsetPageSizeemitDSCsetupProcsetsemitColorSepsbinaryOKemitRawDataEmit TrueType fonts before any o<strong>the</strong>r fonts. Thedefault value is false.(PostScript level 2 only) Set <strong>the</strong> page size on eachpage. Use <strong>the</strong> media box for outputting <strong>to</strong>PostScript files, use <strong>the</strong> crop box for EPS files.Default is false.Write DSC (Document Structuring Conventions)comments. The default value is true.If procsets are included, also include init/termcode. The default value is true.N OTE: This must be set <strong>to</strong> true for <strong>the</strong> <strong>to</strong>olkit.Emit images for Level-1 separations. The defaultvalue is false.true if binary data is permitted in <strong>the</strong> PostScriptfile, false o<strong>the</strong>rwise. The default value is true.true if add no unnecessary filters when emittingimage data, false o<strong>the</strong>rwise. The default valueis true.TTasT42 If including TrueType fonts, convert <strong>to</strong> Type 42fonts instead of Type 1 fonts. The default value isfalse.scaleemitExternalStreamRefemitHalf<strong>to</strong>nescenterCropBoxemitSeparableImagesOnlyemitExtGStateDocument-wide scale fac<strong>to</strong>r. 100.0 = full size. Thedefault value is 100.If an Image resource uses an external stream, emitcode that points <strong>to</strong> <strong>the</strong> external file. The defaultvalue is false.N OTE: This must be set <strong>to</strong> false.Preserve any half<strong>to</strong>ne screening in <strong>the</strong> <strong>PDF</strong> file.The default value is false.true if CropBox output is centered on <strong>the</strong> pagewhen <strong>the</strong> CropBox < MediaBox, falseo<strong>the</strong>rwise. The default value is true.If emitting EPS, include only CMYK and grayimages.Omit all extended graphic state parameters. Thisoverrides emitHalf<strong>to</strong>nes. If false, half<strong>to</strong>nes arenot emitted. The default value is true.<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 127


<strong>PDF</strong> <strong>Library</strong>-specific DeclarationsPDPrintParamsboundingBoxuseFontAliasNamesemitPageRotationemitBBoxClipreversetCropBoxemitPageClipemitTransferemitBGemitUCRfarEastFontOptsuppressCJKSubstitutionIf all zeroes, is ignored. O<strong>the</strong>rwise, is used for%%BoundingBox DSC comment and incenterCropBox calculations and forsetpagedevice. The default value is [0 0 0 0].Used when printing with system fonts. Thedefault value is false.Emit a concat at <strong>the</strong> beginning of each page sothat <strong>the</strong> page is properly rotated. Used whenemitting EPS. The default value is false.If true, emit a clipping box <strong>the</strong> size of <strong>the</strong>bounding box when printing an EPS file. This fixesproblems with EPS files from certain applications.If set <strong>to</strong> true, reverse <strong>the</strong> order of page output.Temporary crop box <strong>to</strong> represent selected region.Emit page clip.Emit transfer.Emit black generation.Emit undercolor removal.GDI <strong>to</strong> PS or download CJK fonts.If true, do not do CJK substitution on <strong>the</strong> printer.This has an impact only whenfarEastFontOpt isPD<strong>PDF</strong>arEastFont_Download_None.flexoX X, Y scale fac<strong>to</strong>rs for anamorphic scaling. “flexo”flexoYrefers <strong>to</strong> a market that prints on plastic media thatstretches (e.g., <strong>to</strong>othpaste tubes)suppressCSAhostBasedhostBasedOutputCSduplextileInfoDon't emit CSAs for 4 component (CMYK) colors.For separa<strong>to</strong>r, do host-based color management.The output color space when hostBased colormanagement is true.For compatibility with IronCity.If non-NULL, tiling is desired with <strong>the</strong>separameters.<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 128


<strong>PDF</strong> <strong>Library</strong>-specific DeclarationsPDPrintParamsrotatehostBasedCMdestProfile[256]destCSA<strong>to</strong>msaveVMtransQualitydoOPPoptimizeForSpeedbrokenCRDsuseMaxVMlastWidthlastHeightEnable <strong>the</strong> au<strong>to</strong>-rotating behavior from pastversions of Acrobat.Default: false, do CSA generation for profilesinstead of converting all colors on <strong>the</strong> host.If hostBase color management is true, use thisprofile.An ASA<strong>to</strong>m representing <strong>the</strong> device color space(DeviceGray, DeviceRGB, etc.)true means try <strong>to</strong> save VM when printing <strong>to</strong>PostScript.Parameters for <strong>the</strong> flattener, 1 - 5, similar <strong>to</strong> whatIllustra<strong>to</strong>r does.Do <strong>the</strong> overprint preview operation.If true, do it fast; false means PostScript codemust be page independent. If set <strong>to</strong> true, fontdownloads are forced fromkIncludeOnEveryPage <strong>to</strong>kIncludeOncePerDoc (see <strong>PDF</strong>LExpT.h)If true, don't set rendering intent in PostScriptstream due <strong>to</strong> broken non-default CRDs.If true, s<strong>to</strong>re all possible resources in VM.Used when setPageSize is true <strong>to</strong> preventunneeded setpagedevice calls.Used when setPageSize is true <strong>to</strong> preventunneeded setpagedevice calls.bitmapResolution DPI for bitmaps. Default is 300.gradientResolutionDPI for gradients interior <strong>to</strong> <strong>the</strong> object (notedges). Can generally be lower than <strong>the</strong>bitmapResolution. Default is 150.transparencyQuality The transparency level. Range is 1-100.ocContextapplyOCGPrintOverridesThe optional-content context <strong>to</strong> use for visibilitystate information, or NULL <strong>to</strong> use <strong>the</strong> document'scurrent states in <strong>the</strong> default context.When true, apply print-specific visibility statesettings from <strong>the</strong> optional-content group.<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 129


<strong>PDF</strong> <strong>Library</strong>-specific DeclarationsPDPrintParamsuseFullResolutionJP2KDataemitInRipSepswhichMarkswesternMarksStyledoProofinguseExecFormflattenInfonegativemirrorprintnumCollatedCopiesWhe<strong>the</strong>r <strong>to</strong> use <strong>the</strong> maximum available JPEG2000resolution.When true, requests that separations, one sheetper ink, be generated in <strong>the</strong> RIP (printer).Page mark indication. A bit-wise OR of <strong>the</strong>PDPageMarkFlags values.Applies <strong>to</strong> print separations, which are availableonly in Adobe Acrobat Professional.When true, use western style for page marks.Applies <strong>to</strong> print separations, which are availableonly in Adobe Acrobat Professional.When true, print using proofing settings.When true, emit execform calls when emittingForm XObjectsA structure containing parameters that controltile flattening.When true, invert <strong>the</strong> plate.One of <strong>the</strong> following constants:kPDPrintFlipNone = 0x01,kPDPrintFlipX = 0x02,kPDPrintFlipY = 0x04,kPDPrintFlipXY = 0x08Mirroring is done in <strong>the</strong> PostScript output stream.MacOS only. Enables collation for viewer.<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 130


<strong>PDF</strong> <strong>Library</strong>-specific DeclarationsPDPrintStrPDPrintStrPDPrintStrPtypedef struct{char *str;ASUns32 len;ASRealPoint *displacements;ASUns32 numGlyphs;ASUns32 flags;} PDPrintStr, *PDPrintStrP;DescriptionStructure for controlling <strong>the</strong> printing of glyphs.Header File<strong>PDF</strong>LExpT.hRelated Methods<strong>PDF</strong>ontPSEmitGlyphsIncrMembersstrlendisplacementsnumGlyphsflagsThe string.Byte length.Displacements.Number of glyphs.Reserved for internal use.<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 131


<strong>PDF</strong> <strong>Library</strong>-specific DeclarationsTKAlloca<strong>to</strong>rProcsTKAlloca<strong>to</strong>rProcsTKAlloca<strong>to</strong>rProcsPtypedef struct _t_TKAlloca<strong>to</strong>rProcs {ASMemAllocProc allocProc;ASMemReallocProc reallocProc;ASMemFreeProc freeProc;ASMemAvailProc memAvailProc;void* clientData;} TKAlloca<strong>to</strong>rProcs, *TKAlloca<strong>to</strong>rProcsP;DescriptionStructure for memory allocation callbacks used by <strong>the</strong> <strong>PDF</strong> <strong>Library</strong>.Header File<strong>PDF</strong>Init.hRelated Methods<strong>PDF</strong>LInitMembersallocProcreallocProcfreeProcmemAvailProcclientDataCalled when <strong>the</strong> <strong>PDF</strong> <strong>Library</strong> needs <strong>to</strong> allocate memory.Called when <strong>the</strong> <strong>PDF</strong> <strong>Library</strong> needs <strong>to</strong> reallocate a block of memory.Called when <strong>the</strong> <strong>PDF</strong> <strong>Library</strong> needs <strong>to</strong> free a block of memory.Called when <strong>the</strong> <strong>PDF</strong> <strong>Library</strong> needs <strong>to</strong> determine <strong>the</strong> amount ofmemory available.A pointer <strong>to</strong> data <strong>to</strong> pass in<strong>to</strong> each of <strong>the</strong> memory managementcallbacks.<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 132


<strong>PDF</strong> <strong>Library</strong>-specific DeclarationsTKExtensionProcsTKExtensionProcsTKExtensionProcsPtypedef struct _t_TKExtensionProcs {ASExtensionProgressProc progressProc;ASExtensionReportErrorProc reportErrProc;void *clientData;} TKExtensionProcs, *TKExtensionProcsP;DescriptionStructure containing function pointers for ASExtension callbacks used by <strong>the</strong> <strong>PDF</strong><strong>Library</strong>.Header File<strong>PDF</strong>Init.hRelated Methods<strong>PDF</strong>LInitMembersprogressProcreportErrProcclientDataCalled when <strong>the</strong> <strong>PDF</strong> <strong>Library</strong> needs <strong>to</strong> allocate memory.Called when <strong>the</strong> <strong>PDF</strong> <strong>Library</strong> needs <strong>to</strong> reallocate a block ofmemory.A pointer <strong>to</strong> data <strong>to</strong> pass in<strong>to</strong> each of <strong>the</strong> memory managementcallbacks.<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 133


<strong>PDF</strong> <strong>Library</strong>-specific DeclarationsTKResourceProcsTKResourceProcsTKResourceProcsPtypedef struct _t_TKResourceProcs {TKResourceAcquireProc acquireProc;TKResourceReleaseProc releaseProc;void* clientData;} TKResourceProcs, *TKResourceProcsP;DescriptionStructure for resource acquisition callbacks used by <strong>the</strong> <strong>PDF</strong> <strong>Library</strong>.Header File<strong>PDF</strong>Init.hRelated Methods<strong>PDF</strong>LInitMembersacquireProcreleaseProcclientDataCalled when <strong>the</strong> <strong>PDF</strong> <strong>Library</strong> needs <strong>to</strong> acquire resources.Called when <strong>the</strong> <strong>PDF</strong> <strong>Library</strong> needs <strong>to</strong> release resources.A pointer <strong>to</strong> data <strong>to</strong> pass in<strong>to</strong> every call <strong>to</strong> <strong>the</strong> PMSetTextProc orTKResourceReleaseProc as <strong>the</strong> clientData argument.<strong>PDF</strong> <strong>Library</strong> <strong>Supplement</strong> <strong>to</strong> <strong>the</strong> Acrobat <strong>Core</strong> <strong>API</strong> <strong>Reference</strong> 134

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!