DLI Implementation and Reference Guide - Datalogics
DLI Implementation and Reference Guide - Datalogics
DLI Implementation and Reference Guide - Datalogics
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
<strong>Implementation</strong> <strong>and</strong><br />
<strong>Reference</strong> <strong>Guide</strong><br />
<strong>Datalogics</strong> Interface<br />
<strong>Datalogics</strong> ®
<strong>Datalogics</strong><br />
DATALOGICS INTERFACE<br />
<strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong>
This guide is part of the Adobe® PDF Library v6.1.1Plus suite; 02/15/05.<br />
Copyright 1999-2005 <strong>Datalogics</strong> Incorporated. All Rights Reserved.<br />
Use of <strong>Datalogics</strong> software is subject to the applicable license agreement.<br />
DL Interface is a trademark of <strong>Datalogics</strong> Incorporated. Other products mentioned herein as <strong>Datalogics</strong> products<br />
are also trademarks or registered trademarks of <strong>Datalogics</strong>, Incorporated.<br />
Adobe, Adobe PDF Library, Portable Document Format (PDF), PostScript, Acrobat, Distiller, Exchange <strong>and</strong><br />
Reader are trademarks of Adobe Systems Incorporated.<br />
HP <strong>and</strong> HP-UX are registered trademarks of Hewlett Packard Corporation.<br />
IBM, AIX, AS/400, OS/400, MVS, <strong>and</strong> OS/390 are registered trademarks of International Business Machines.<br />
Java, J2EE, J2SE, J2ME, all Java-based marks, Sun <strong>and</strong> Solaris are trademarks or registered trademarks of Sun<br />
Microsystems, Inc. in the United States <strong>and</strong> other countries.<br />
Linux is a registered trademark of Linus Torvalds.<br />
Microsoft, Windows <strong>and</strong> Windows NT are trademarks or registered trademarks of Microsoft Corporation.<br />
SAS/C is a registered trademark of SAS Institute Inc.<br />
UNIX is a registered trademark of The Open Group.<br />
VeriSign® is a registered trademark of VeriSign, Inc. in the United States <strong>and</strong>/or other countries.<br />
All other trademarks <strong>and</strong> registered trademarks are the property of their respective owners.<br />
For additional information, contact:<br />
<strong>Datalogics</strong>, Incorporated<br />
101 North Wacker Drive, Suite 1800<br />
Chicago, Illinois 60606-7301<br />
Phone: 312-853-8200<br />
Fax: 312-853-8282<br />
www.datalogics.com<br />
dlcomments@datalogics.com
Table of Contents<br />
i<br />
Table of Contents<br />
1 Getting Started 1.1<br />
An Introduction to <strong>DLI</strong> 1.2<br />
How to Create a PDF Document with <strong>DLI</strong> 1.2<br />
How to Use this Book 1.5<br />
What’s New in This Release 1.11<br />
Enhancements in Prior Releases 1.20<br />
2 Initializing <strong>and</strong> Terminating the Library 2.1<br />
Overview 2.2<br />
Adobe PDF Library Data Structure 2.2<br />
Adobe PDF Library Version Control 2.6<br />
Files In Memory Activation 2.8<br />
Initializing <strong>and</strong> Terminating via <strong>DLI</strong> 2.8<br />
Writing PDF Output to Memory 2.15<br />
API Comparison 2.17<br />
3 Beginning <strong>and</strong> Ending a Document 3.1<br />
Overview 3.2<br />
4 Fonts 4.1<br />
PDF Font Overview 4.2<br />
Structure of a <strong>DLI</strong> Font 4.4<br />
Font Creation Calls 4.6<br />
Predefined Font Encodings 4.11<br />
Unicode Text Support 4.13<br />
Code Page Support 4.13<br />
Performance Considerations 4.13
ii<br />
<strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
Accessing Fonts 4.15<br />
5 Multibyte Text Work 5.1<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Introduction 5.2<br />
Loading <strong>and</strong> Creating Fonts 5.3<br />
Creating DLPDFTEXT Areas 5.5<br />
Working With DLPDFTEXT Areas 5.7<br />
Performance Considerations 5.10<br />
6 Working with Pages 6.1<br />
Introduction to Page Interface 6.2<br />
Page Interface Calls 6.2<br />
7 Containers within Pages 7.1<br />
What are Containers? 7.2<br />
8 Working<br />
with Content 8.1<br />
Overview of Content Interface 8.2<br />
Content Interface Calls 8.3<br />
9 Working<br />
with Forms 9.1<br />
Overview of Forms 9.2<br />
Form Calls 9.3<br />
10 Displaying Line Drawings 10.1<br />
Overview 10.2<br />
Approaches to Line Drawing 10.3<br />
Graphic State <strong>and</strong> Line Drawing 10.17
Table of Contents<br />
iii<br />
11 Image<br />
Display 11.1<br />
Overview 11.2<br />
Graphic Image Structures 11.2<br />
Graphic Image Forms 11.3<br />
Image Creation Methods 11.5<br />
Creating Transparent Graphics 11.12<br />
12 Color<br />
<strong>and</strong> its Use 12.1<br />
Library Color Descriptions 12.2<br />
Colors in Images 12.3<br />
Creating <strong>and</strong> Destroying Color Spaces 12.3<br />
Values for Color Channels 12.6<br />
Basic Color Spaces 12.7<br />
Advanced Color Spaces 12.11<br />
Building Patterned Color Spaces 12.13<br />
Conversion between Models 12.16<br />
13 Annotations <strong>and</strong> Links 13.1<br />
Overview 13.2<br />
Annotation Components 13.2<br />
Modifying the Link Cos Object 13.9<br />
14 Bookmark Creation 14.1<br />
Overview 14.2<br />
15 Digital Signatures 15.1<br />
Overview 15.2<br />
Public <strong>and</strong> Private Keys 15.2
iv<br />
<strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
Digital Signature Calls 15.4<br />
16 Error<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Testing <strong>and</strong> Recovery 16.1<br />
Overview 16.2<br />
OS/390 Platform Concerns 16.4<br />
17 Samples<br />
<strong>and</strong> Links 17.1<br />
Running <strong>DLI</strong> Sample Applications 17.2<br />
A <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.1
1<br />
Getting Started<br />
This chapter introduces the <strong>Datalogics</strong> Interface.<br />
Experienced users may want to skip directly to the<br />
section “What’s New in This Release” on page 1.11 for<br />
information on the latest enhancements <strong>and</strong> additions.<br />
1.1
1.2 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
An Introduction to <strong>DLI</strong><br />
The <strong>Datalogics</strong> Interface (<strong>DLI</strong>) facilitates the rapid creation of PDF documents <strong>and</strong><br />
improves performance, throughput <strong>and</strong> graphics h<strong>and</strong>ling. It does this by bypassing<br />
many of the functions of the PDF Edit layer <strong>and</strong> eliminating redundant calls to the<br />
COS layer used in the Adobe® PDF Library. For information on the various layers of<br />
Adobe PDF Library please see the Acrobat Core API Overview.<br />
How to Create a PDF Document with<br />
<strong>DLI</strong><br />
The <strong>DLI</strong> package exists at the output end of the page creation process. As such, most<br />
of the intricacies of line breaking, page breaking <strong>and</strong> general composition are outside<br />
of its scope.<br />
The process of writing pages is where this package fits into an application. An<br />
overview of this process follows:<br />
1 Initialize <strong>DLI</strong>. (start of all processing)<br />
2 Define the document.<br />
3 Define fonts: i.e. Identify <strong>and</strong> describe each font to be used in the job to <strong>DLI</strong>.<br />
These can be done as encountered, if so desired.<br />
4 Define forms: i.e. Identify <strong>and</strong> describe each form to be used in the job to <strong>DLI</strong>.<br />
These can be done as encountered, if so desired.<br />
5 Define graphics: i.e. Identify <strong>and</strong> define each graphic to be used multiple times to<br />
<strong>DLI</strong>. These can be done as encountered, if so desired.<br />
6 For each page:<br />
• Create a dlpdfpage object.<br />
• Create a dlpdfcontent object.<br />
7 Generate the content of a single page:<br />
• For each graphic reference on the page, create the graphic in content.<br />
• For each text line on the page, create the text in content.<br />
8 End the content <strong>and</strong> inform <strong>DLI</strong> that the content is complete.<br />
9 End the page <strong>and</strong> inform <strong>DLI</strong> that the page is complete.
Getting Started 1.3<br />
10 End the document.<br />
11 End the job.<br />
Error h<strong>and</strong>ling during application execution is h<strong>and</strong>led through the raising <strong>and</strong><br />
h<strong>and</strong>ling of exceptions, as defined by the Adobe PDF Library. These are similar to<br />
operation exceptions in C++. For details on h<strong>and</strong>ling exceptions, please see the<br />
chapter “Error Testing <strong>and</strong> Recovery” on page 16.1.<br />
What You Should Know<br />
This document is intended for programmers who are familiar with text composition<br />
<strong>and</strong> the creation of output drivers, or by application designers who are constructing<br />
an application based on the <strong>DLI</strong> package.<br />
You should have access to the Adobe PDF Library Applications Programming<br />
Interface (API) manual <strong>and</strong> the Adobe PDF Specifications manual for your system.<br />
For Adobe PDF Library v5.x releases, Adobe PDF Specification 1.4 is appropriate.For<br />
Adobe PDF Library v6.x releases, Adobe PDF Specification 1.5 is appropriate.<br />
NOTE: Some structures permitted in Adobe PDF Specification 1.5 may not be<br />
permitted in Adobe PDF Specification 1.4, <strong>and</strong> some structures defined in Adobe<br />
PDF Specification 1.4 are not available in Adobe PDF Specification 1.3.<br />
The explanations, assumptions <strong>and</strong> samples provided in this guide refer to Adobe<br />
PDF Library v6.1.0Plus <strong>and</strong> <strong>DLI</strong> v3.0 or higher.<br />
<strong>DLI</strong> Initialization Required<br />
Starting with <strong>DLI</strong> v2.1, the initialization process has been simplified such that you<br />
must initialize <strong>DLI</strong> to automatically initialize the Adobe PDF Library. Though it may<br />
be functionally possible to bypass the initialization of <strong>DLI</strong> for versions 2.1 <strong>and</strong> higher,<br />
an application should not do so. Using the <strong>DLI</strong> initialization <strong>and</strong> termination routines<br />
not only simplifies application programming but also allows the use of the <strong>Datalogics</strong>
1.4 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
Files In Memory (FIM) System, <strong>and</strong> the enabling of certain optimizations in jobs<br />
which span multiple documents.<br />
NOTE: The Adobe PDF Library <strong>and</strong> <strong>DLI</strong> are not intended to be initialized more than<br />
once within a single instance of an application. Doing so can produce undesirable<br />
results. Versions of Adobe PDF Library prior to v6.1 are not thread-safe.<br />
gcc Compilation Version<br />
Adobe compiles their PDF Library components with gcc 2.95.2 on the Solaris®,<br />
AIX® <strong>and</strong> Linux® operating systems. <strong>Datalogics</strong> does not recompile Adobe<br />
components on any other compiler on these operating systems. <strong>Datalogics</strong> only<br />
distributes the Adobe PDF Library <strong>and</strong> the <strong>DLI</strong> components compiled using gcc on<br />
these operating systems. For the latest information on supported operating-system<br />
compilers <strong>and</strong> versions, please see the readme.txt file of last-minute updates<br />
accompanying your software release files.<br />
Unix Compiler Run-Time Libraries<br />
For clients who are using native (i.e. platform-resident) UNIX® compilers, the runtime<br />
libraries for each of these operating systems are available from the Free Software<br />
Foundation. Any clients wishing to integrate the Adobe PDF Library <strong>and</strong> <strong>DLI</strong><br />
components with their natively-compiled applications can retrieve these run-time<br />
libraries free of charge from the Free Software Foundation at http://<br />
www.gnu.org/software/gcc/.
Getting Started 1.5<br />
How to Use this Book<br />
This book has been created to guide you through the process of creating PDF<br />
documents with <strong>DLI</strong>. It consists of two main sections:<br />
• An <strong>Implementation</strong> section<br />
• A <strong>Reference</strong> <strong>Guide</strong> appendix<br />
The <strong>Implementation</strong> section begins with Chapter 1: Getting Started. It follows the<br />
steps needed to create PDF <strong>and</strong> introduces <strong>DLI</strong> in relation to the Adobe PDF Library,<br />
explains the methods used in <strong>DLI</strong>, how they fit together, <strong>and</strong> provides various<br />
samples.<br />
The <strong>Reference</strong> <strong>Guide</strong> appendix lists all <strong>DLI</strong> methods alphabetically.<br />
Each function or method listed in the first section of this manual, wherever it occurs,<br />
is linked to the same function or method in the second section. In some cases you may<br />
find references to a particular function appearing in several chapters of this document,<br />
depending on the context, <strong>and</strong> the function may be used for (<strong>and</strong> explained for)<br />
different purposes within each chapter. Click the function name to go to the more<br />
detailed reference information, which will provide full explanation of each, a full<br />
listing of calling parameters <strong>and</strong> return values, <strong>and</strong> any Technical Notes which may<br />
apply.<br />
You may also find a separate, st<strong>and</strong>alone /Codesamples folder in your<br />
documentation files which contains additional ASCII-text coding samples.<br />
NOTE: The files in the /Codesamples folder, if present, are not intended to be<br />
buildable source as-is, only to be demonstrations of correct comm<strong>and</strong> syntax for<br />
different purposes.<br />
Finally, the <strong>DLI</strong> release also includes a collection of complete, buildable sample<br />
applications, explained in the "Samples <strong>and</strong> Links" chapter following.<br />
The following list provides an outline of the chapters as well as a brief description of<br />
their contents. Click on the Chapter title below to jump to its first page.
1.6 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
Chapter 1: "Getting Started" (This chapter) This chapter introduces the Adobe<br />
PDF Library <strong>and</strong> <strong>DLI</strong>, including an overview of page creation, <strong>and</strong> describes the<br />
contents of this book, including enhancements in new releases of <strong>DLI</strong>.<br />
Chapter 2: "Initializing <strong>and</strong> Terminating the Library" describes<br />
initialization <strong>and</strong> termination of the Adobe PDF Library.<br />
Chapter 3: "Beginning <strong>and</strong> Ending a Document" describes all of the<br />
methods used to begin <strong>and</strong> end a document.<br />
Chapter 4: "Fonts" discusses creation <strong>and</strong> arrangement of fonts.<br />
Chapter 5: "Multibyte Text Work" discusses the <strong>DLI</strong> methods available for<br />
creating <strong>and</strong> manipulating multibyte text.<br />
Chapter 6: "Working with Pages" <strong>DLI</strong> assumes that pages will be added to the<br />
end of the document only. A page is represented by a data structure named<br />
DLPDFPAGE. This chapter explains the Page Interface <strong>and</strong> defines the calls available at<br />
this level.<br />
Chapter 7: "Containers within Pages" describes containers within pages, <strong>and</strong><br />
provides examples of various applications.<br />
Chapter 8: "Working with Content" The Content Interface contains the bulk of<br />
the interface. At this level, you make marks on paper. Those marks may be on a Page<br />
or on a Forms XObject. They may be text, line drawings or images. A content element<br />
is represented by the structure DLPDFCONTENT. This chapter explains the Content<br />
Interface <strong>and</strong> defines the calls available at this level.<br />
Chapter 9: "Working with Forms" Forms XObjects are represented via the<br />
structure DLPDFFORM. This chapter explains forms, <strong>and</strong> defines the calls available.<br />
Chapter 10: "Displaying Line Drawings" describes line drawings <strong>and</strong> the<br />
different approaches, including directly-drawn <strong>and</strong> path-drawn methods.<br />
Chapter 11: "Image Display" describes images as a predefined collection of<br />
shapes <strong>and</strong> colors.
Getting Started 1.7<br />
Chapter 12: "Color <strong>and</strong> its Use" discusses Adobe PDF Library color<br />
descriptions, colors in images, creating <strong>and</strong> destroying color spaces, patterned color<br />
spaces <strong>and</strong> more.<br />
Chapter 13: "Annotations <strong>and</strong> Links" describes creating annotations <strong>and</strong> how<br />
to modify the Link COS Structure.<br />
Chapter 14: "Bookmark Creation" describes bookmark creation <strong>and</strong> the steps<br />
involved.<br />
Chapter 15: "Digital Signatures" explains the process of adding a digital<br />
signature to a document, <strong>and</strong> outlines the methods for use.<br />
Chapter 16: "Error Testing <strong>and</strong> Recovery" discusses possible errors you may<br />
encounter <strong>and</strong> how to resolve them.<br />
Chapter 17: "Samples <strong>and</strong> Links" provides full program samples which have<br />
been compiled <strong>and</strong> tested to illustrate various aspects of the Adobe PDF Library <strong>and</strong><br />
<strong>DLI</strong>.<br />
Appendix A: "<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong>" provides an alphabetical listing of all<br />
methods used in <strong>DLI</strong>.<br />
Document Conventions<br />
The terms note, link <strong>and</strong> bookmark are used in this book the same way they are in the<br />
user interface of Adobe PDF Library v6.1.0Plus®, Acrobat®, Acrobat Exchange®<br />
<strong>and</strong> Adobe Reader®. These correspond to the text annotation, link annotation <strong>and</strong><br />
routine entry structures (respectively) that appear in a PDF file. See the Portable<br />
Document Format <strong>Reference</strong> Manual for a description of the PDF file format.
1.8 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
The following documentation conventions appear throughout the manual to help you<br />
differentiate regular text from product <strong>and</strong> program names, <strong>and</strong> to distinguish<br />
comm<strong>and</strong> syntax.<br />
• Product <strong>and</strong> program names are set in italic type.<br />
• Multi-line examples are separated from the text <strong>and</strong> set in<br />
Courier monospace<br />
• Directory names <strong>and</strong> filenames are contained within the text <strong>and</strong> set in Courier<br />
monospace.<br />
• Comm<strong>and</strong>s are contained within the text <strong>and</strong> set in blue Courier monospace. In<br />
most cases, if you are reading this document in PDF form via Adobe Acrobat or<br />
Adobe Reader, clicking on a <strong>DLI</strong> comm<strong>and</strong> will jump you to the <strong>Reference</strong> <strong>Guide</strong><br />
appendix for full information on that comm<strong>and</strong>.<br />
• New terms are italicized.<br />
• Page numbers in this book do not correspond to page numbers in the PDF file. The<br />
numbering scheme (e.g. 4.1 or A.10) indicates the chapter number (4) or appendix<br />
letter (A) first, followed by the page number (1 or 10), separated by a period.
Getting Started 1.9<br />
Related Documentation<br />
The following documents will be useful in developing applications using <strong>DLI</strong>.<br />
<strong>Datalogics</strong> Resources<br />
Adobe PDF Library <strong>and</strong> <strong>DLI</strong> Installation <strong>Guide</strong> This document describes the<br />
installation requirements for using the Adobe PDF Library <strong>and</strong> <strong>DLI</strong> on the various<br />
platforms to which <strong>Datalogics</strong> has ported these products.<br />
Adobe PDF Library Developer Overview This document is designed to aid<br />
developers with incorporating the API calls for the Adobe PDF Library into their<br />
composition application.<br />
<strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong> (This book) This document details<br />
the <strong>Datalogics</strong> Interface, a simplified interface to the COS Layer of the Adobe PDF<br />
Library.<br />
Java Interface User <strong>Guide</strong> This document details the <strong>Datalogics</strong> Java Interface,<br />
a Java-language wrapper interface to the Adobe PDF Library <strong>and</strong> <strong>DLI</strong>.<br />
Adobe Resources<br />
The following documents are distributed by Adobe as part of the original Adobe PDF<br />
Library release, <strong>and</strong> are redistributed by <strong>Datalogics</strong> without alteration. These <strong>and</strong><br />
other documents may also be found on the Adobe website at http://
1.10 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
partners.adobe.com/asn/acrobat/technotes.jsp. (Descriptions below<br />
are provided by Adobe as part of their original accompanying readme.txt file.)<br />
NOTE: Adobe Solutions Network (ASN) membership may be required in order to<br />
access some material on the Adobe website. See http://<br />
partners.adobe.com/asn/programs/developer/index.jsp for<br />
more details.<br />
Portable Document Format <strong>Reference</strong> Manual This document describes<br />
PDF St<strong>and</strong>ard 1.5 specifications. The latest version may be found at http://<br />
partners.adobe.com/asn/tech/pdf/specifications.jsp.<br />
NOTE: Adobe also provides an accompanying errata file for this manual, with lastminute<br />
updates <strong>and</strong> corrections. One copy is provided with this documentation<br />
(see your documentation file folder), <strong>and</strong> you can check for newer copies at<br />
http://partners.adobe.com/asn/acrobat/sdk/public/docs/<br />
errata.txt<br />
Adobe PDF Library Overview Technical Note #5189 provides background<br />
information <strong>and</strong> development information for the Adobe PDF Library. Read this<br />
document before beginning development for information such as supported<br />
platforms, known issues <strong>and</strong> development requirements.<br />
Acrobat Core API Overview Technical Note #5190 provides an overview of the<br />
Acrobat API in general. It covers information applicable to both Plug-in development<br />
<strong>and</strong> Library development. Read this document to obtain an underst<strong>and</strong>ing of how the<br />
Acrobat API is organized.<br />
AcroColor API <strong>Reference</strong> Technical Note #5425 explains the Host Function<br />
Table (HFT) that allows you to access the AcroColor Engine (ACE), which controls<br />
color profile.<br />
Acrobat Core API <strong>Reference</strong> Technical Note #5191 is the reference manual for<br />
all of the Acrobat API methods made available by the Acrobat Viewer. It documents<br />
the parameters, return values <strong>and</strong> availability of each method, as well as specific
Getting Started 1.11<br />
implementation notes. This document is useful while developing with the Adobe PDF<br />
Library or planning development to determine method availability <strong>and</strong> capabilities.<br />
PDF Library Supplement to the Acrobat Core API Technical Note #5414<br />
complements the Acrobat Core API <strong>Reference</strong> <strong>and</strong> is specific to the Adobe PDF<br />
Library API methods. This is an important <strong>and</strong> useful document for all Adobe PDF<br />
Library developers.<br />
What’s New in This Release<br />
This section contains highlights of new additions <strong>and</strong> enhancements to <strong>DLI</strong> v3.0. You<br />
should also check the accompanying Release Notes file (typically<br />
ReleaseNotes.pdf) <strong>and</strong> readme.txt files (one each accompanies the software<br />
release files <strong>and</strong> the documentation files in their respective folders or directories).<br />
Release Notes contain fixes <strong>and</strong> enhancements usually resulting from past problem<br />
reports; the readme.txt files typically contain last-minute information on the<br />
current release of the software or the documentation files.<br />
Minor version upgrades may be made as running changes rather than full releases, so<br />
the version or sub-version number of your release may be newer than those listed<br />
here. See the accompanying readme.txt file for the very latest changes <strong>and</strong><br />
enhancements.<br />
<strong>DLI</strong> v3.0 for Adobe PDF Library v6.x will feature a number of changes, briefly<br />
outlined here.<br />
Adobe PDF Library Now Thread-Safe<br />
As of Adobe PDF Library v6.1.0Plus <strong>and</strong> <strong>DLI</strong> v3.0.11, the Library is now re-entrant,<br />
<strong>and</strong> therefore safe for multithreaded applications. See the following chapter <strong>and</strong><br />
“Multi-Thread Initializations” on page 2.13 for more information on thread-safety<br />
issues.
1.12 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
Adobe PDF Library Version Control<br />
The Adobe PDF Library is a set of routines associated with other Adobe products<br />
such as Adobe Acrobat, Adobe Acrobat Distiller <strong>and</strong> Adobe Reader. The original<br />
Adobe PDF Library was labeled as version 1.2 in order to maintain consistency with<br />
the PDF st<strong>and</strong>ard of 1.2. The next version of the Library was labeled version 4.0 (<strong>and</strong><br />
subsequently 4.05) due to the tie-in with Acrobat v4.0. Versions 4.0/4.05 of the<br />
Library complied with the PDF st<strong>and</strong>ard of 1.3. Adobe PDF Library v5.0.2Plus<br />
complies with PDF St<strong>and</strong>ard 1.4, <strong>and</strong> the latest Adobe PDF Library v6.x complies<br />
with PDF St<strong>and</strong>ard 1.5.<br />
PDF Level Declarations in Output<br />
By default, the Adobe PDF Library declares the current PDF level compliance in<br />
output PDF files; e.g. Adobe PDF Library v6.x applications building pages without<br />
<strong>Datalogics</strong> Interface methods will generate PDF v1.5. Applications generating output<br />
via <strong>DLI</strong> may generate different PDF declarations depending on file contents <strong>and</strong><br />
application coding; see below <strong>and</strong> “Adobe PDF Library Version Control” on page 2.6<br />
for more details.<br />
NOTE: Viewing a latest-generation PDF in a prior-version Adobe Acrobat or Adobe<br />
Reader (e.g. viewing PDF v1.5 in Acrobat or Reader v5.0 or earlier) can produce a<br />
popup warning of a PDF level mismatch, to warn the user that certain PDF features<br />
new to that version may not be supported by the viewing program. While this is<br />
only a warning, it may concern some users who have not upgraded to the latest<br />
viewer. You should ensure that your document features are backwards-compatible<br />
to older viewer versions where possible, or warn your users that a viewer upgrade<br />
will be required in order to take full advantage of features in your document, as<br />
appropriate.<br />
PDF Level Declarations via <strong>DLI</strong><br />
Applications built with Adobe PDF Library <strong>and</strong> <strong>Datalogics</strong> Interface (e.g. Adobe PDF<br />
Library v6.1.1Plus <strong>and</strong> <strong>DLI</strong> v3.0.19) <strong>and</strong> using <strong>DLI</strong> methods for output will have<br />
their output PDF compliance set appropriately by <strong>DLI</strong>. By default, files will identify<br />
themselves as PDF v1.3 compliant, or higher values if appropriate, based on the
Getting Started 1.13<br />
functionality embedded in the document. Some further explanation can be found<br />
under “Selecting PDF Level Declarations via <strong>DLI</strong>” on page 2.7.<br />
Digital Signature Support<br />
New methods are now available for adding Digital Signatures to your documents, <strong>and</strong><br />
a new chapter on the subject has been added to this manual. See the new chapter<br />
“Digital Signatures” on page 15.1 for more details.<br />
Enhanced Unicode Support<br />
Unicode support included in <strong>DLI</strong> has undergone significant revision for the new v3.x<br />
series. <strong>Datalogics</strong> now ships with International Components for Unicode (ICU)<br />
modules, which provide a number of benefits for users, including:<br />
• Complete TrueType, OpenType <strong>and</strong> TrueType/OpenType Collection font file<br />
support<br />
• Support for all major Unicode encoding schemes, as well as hundreds of Chinese/<br />
Japanese/Korean/Vietnamese <strong>and</strong> vendor-st<strong>and</strong>ard input formats<br />
• Support for right-to-left text ordering <strong>and</strong> automatic character combining using the<br />
Unicode BiDirectional algorithm<br />
• Faster <strong>and</strong> less-memory-intensive creation of Unicode fonts<br />
• Text output in PDF content areas as Unicode<br />
NOTE: Since Unicode font creation does not use the Adobe PDF Library to locate<br />
fonts, customers must now explicitly load fonts intended for Unicode into a<br />
DLPDFINSTANCE before use. Additionally, users must be able to specify the<br />
system location where these fonts reside. See the <strong>DLI</strong> sample application<br />
WideText for a demonstration of loading <strong>and</strong> using Unicode fonts.<br />
Addition of DLPDFTEXT Structure<br />
In support of the revised Unicode architecture, the object DLPDFTEXT has been<br />
created. This is a reusable container for text: an input string is supplied to<br />
DLPDFTEXT creation calls in an input encoding. The DLPDFTEXT object stores this
1.14 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
text in Unicode UTF-16 format, with Big-endian or Little-endian orientation<br />
depending on the host platform.<br />
<strong>DLI</strong> Initialization now Required<br />
Initialization of <strong>DLI</strong> is now required; support for using <strong>DLI</strong> without initialization has<br />
been removed. If you intend to use <strong>DLI</strong> methods in your application, you must<br />
intialize <strong>DLI</strong> via dlpdfinit. <strong>DLI</strong> users should initialize the Adobe PDF Library<br />
through the <strong>DLI</strong> initialization call; PDFLInit <strong>and</strong> PDFLTerm should never be<br />
directly called from a <strong>DLI</strong> application.<br />
All <strong>DLI</strong> documents require an instance for creation. The<br />
dlpdfdoccreatewithinstance call has been removed from the API, <strong>and</strong> the<br />
dlpdfinit <strong>and</strong> dlpdfdoccreate call have been modified significantly (see<br />
“Functions Updated” on page 1.18). <strong>DLI</strong> should only be initialized once per process.<br />
Streaming PostScript Removed<br />
All PostScript output is produced using the Adobe PDF Library. Support for<br />
streaming PostScript created by <strong>DLI</strong> has been removed. This facility was previously<br />
deprecated in the <strong>DLI</strong> v2.2 series.<br />
PDF Image Import Improvements<br />
PDF image import has been enhanced as of <strong>DLI</strong> v3.0.13. The value of the imported<br />
PDF file's Rotate key, if present, is now honored. Images are imported by <strong>DLI</strong> <strong>and</strong><br />
placed in the rotated orientation displayed by Adobe Reader <strong>and</strong> Acrobat.<br />
For the dlpdfimagecreatefrompdf call, a value of 0 is now accepted for the<br />
Width <strong>and</strong> Depth parameters. If either are 0, then the PDF page's crop box is used to<br />
form the DLPDFIMAGE's visible region. This will be shifted using the XDisp <strong>and</strong><br />
YDisp values to generate the imported image.
Getting Started 1.15<br />
Functions Added<br />
dlpdfmemfiledeleteonclose<br />
This method marks a Files In Memory (FIM) file to be removed from the filesystem<br />
once the last open fileh<strong>and</strong>le for the file has been closed.<br />
NOTE: No file is automatically removed from memory, unless<br />
dlpdfmemfiledeleteonclose has been called for a specific MDFile.<br />
dlpdfmemfilesetbuffer<br />
This method configures Files In Memory to directly use the buffer passed in as the file<br />
contents.<br />
dlpdfmemfilesyssetmemlimit<br />
This method establishes an upper bound, in bytes, of the memory usage allowed for<br />
file contents by <strong>DLI</strong>.<br />
dlpdfmemfilesysgetmemusage<br />
This returns an ASSize_t with the current usage, in bytes, of memory for file<br />
contents.<br />
dlpdfdoccreatesignature<br />
dlpdfdocsetsignatureappearance<br />
dlpdfpageplacesignature<br />
dlpdfsignaturesetdatacallback<br />
dlpdfsignaturesetpkcs7cert<br />
dlpdfsignaturesetx509cert<br />
These new methods support Digital Signatures in documents. See the new chapter on<br />
“Digital Signatures” on page 15.1 for more details.
1.16 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfdocasciips<br />
This method was added to support creation of PostScript output suitable for<br />
transmission through channels <strong>and</strong> to devices which do not accept binary data. Most<br />
PostScript printers cannot properly process binary PostScript input; Distiller <strong>and</strong> most<br />
print spoolers will accept binary PostScript data.<br />
dlpdfinstancesetgrcachelimits<br />
This method was added to support customers who would like to limit the amount of<br />
filesystem storage used for the <strong>DLI</strong> graphics cache. This accepts a low-water <strong>and</strong> a<br />
high-water mark, in bytes. If the graphics cache reaches the high-water mark, graphics<br />
will be removed from the cache in least recently used (LRU) order. Graphics will be<br />
removed until the cache falls to or below the low-water mark.<br />
dlpdftext<br />
This creates a DLPDFTEXT area from a string of a given length (in bytes) <strong>and</strong> an<br />
encoding.<br />
dlpdftextshowencodingnames<br />
This method can be used to obtain a list of valid Encoding names provided via the<br />
International Components for Unicode (ICU) module, for use when calling<br />
dlpdftext.<br />
dlpdftextfromutf8<br />
dlpdftextfromutf16le<br />
dlpdftextfromutf16be<br />
dlpdftextfromutf16he<br />
dlpdftextfromutf32le<br />
dlpdftextfromutf32be<br />
dlpdftextfromutf32he<br />
These are convenience functions for common Unicode encodings.
Getting Started 1.17<br />
dlpdftextadvance<br />
This supplies the x <strong>and</strong> y advance for a string in a DLPDFTEXT area.<br />
dlpdftextstring<br />
dlpdftextlength<br />
dlpdftextstring returns the byte buffer for the stored string.<br />
dlpdftextlength returns the length, in bytes, of this buffer.<br />
dlpdftexttocontent<br />
This pastes the DLPDFTEXT string into a DLPDFCONTENT area.<br />
dlpdftextdestroy<br />
This method destroys a DLPDFTEXT area.<br />
dlpdfttload<br />
This method loads the font from a TrueType or OpenType font file, or the fonts from<br />
a TrueType/OpenType Collection font file. These fonts are loaded into the supplied<br />
DLPDFINSTANCE. Fonts loaded in this manner are used before searching the system<br />
directories for fonts.<br />
NOTE: This method does not fully support Adobe CFF-format OpenType font files.<br />
CMaps as defined in the PDF <strong>Reference</strong> Manual should be used for these fonts.<br />
<strong>Datalogics</strong> recommends creating them as CIDType0 fonts, using<br />
dlpdfcontentwidetext for setting text.
1.18 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
Functions Updated<br />
dlpdfinit<br />
This has been revised significantly, <strong>and</strong> now requires three parameters:<br />
• the PDFLData pointer containing Adobe PDF Library initialization data<br />
• the default file system to use, or NULL for the Adobe PDF Library default filesystem<br />
• NULL; reserved for future use as an optional argument<br />
The <strong>DLI</strong> graphics cache has been enhanced to use the default ASFileSys<br />
implementation provided to dlpdfinit for caching graphics. By default, the<br />
graphics cache file size is limited to 1.5GB. Customers who wish to use larger graphics<br />
cache files are advised to supply a filesystem to dlpdfinit which is capable of<br />
reliably h<strong>and</strong>ling files of the larger size.<br />
dlpdfdoccreate<br />
This call no longer accepts a PostScript filename. (Use dlpdfdocsetpsname, or<br />
supply one to dlpdfdocwritePS.) The PDFNeeded flag has been removed; PDF<br />
processing is always performed. It accepts one parameter, the DLPDFINSTANCE to use<br />
for the document.<br />
dlpdfterm<br />
This call now removes memory files used for the dlpdfttload call if the Files In<br />
Memory system is used, <strong>and</strong> if these files are no longer in use.<br />
Functions Removed<br />
dlpdfdocsevenbitsafe<br />
This method was not able to guarantee a PDF output stream safe for a seven-bit<br />
channel. The PDF specification refers to PDF as a binary format, <strong>and</strong> expects that<br />
consumers are able to accept a binary input stream.
Getting Started 1.19<br />
dlpdfdocHexGraphics<br />
was an API for debugging graphic output. In the <strong>DLI</strong> v2.2.x series, this was disabled.<br />
dlpdfdocsetformsascontent<br />
...<strong>and</strong>...<br />
dlpdfimageplaceascontent<br />
...were not able to generate correct PDF output for some imported PDF files. This<br />
functionality was not widely used, <strong>and</strong> these methods have been removed.<br />
dlpdfdocsetembedappwidth<br />
This method has been removed as fonts will, with the exception of the "st<strong>and</strong>ard" 14<br />
fonts, always have their widths included in the PDF font if the font is present on the<br />
system on which a job is run, or if these widths are supplied to <strong>DLI</strong>.<br />
dlpdfdocseterrorfile<br />
...<strong>and</strong>...<br />
dlpdfdocsetwarningfile<br />
...are no longer supported. Functions which need to communicate errors will raise an<br />
ASException as required.<br />
dlpdfdoccreatewithinstance<br />
This has been replaced by a revised dlpdfdoccreate call. Since <strong>DLI</strong> initialization<br />
is required for v3.x releases, the dlpdfdoccreate call accepts a DLPDFINSTANCE.<br />
See “Functions Updated” on page 1.18 for details.
1.20 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdffontverifytext<br />
Given a font <strong>and</strong> a string of text, this method would ensure that every Unicode<br />
character had a valid glyph ID associated with it. Because Unicode is now h<strong>and</strong>led in<br />
the DLPDFTEXT structure <strong>and</strong> not the font, this method was no longer needed.<br />
dlpdfsetlevel<br />
This method is now reserved for internal use. Although its function has not changed<br />
from prior releases, it is no longer supported for applications built with <strong>DLI</strong>.<br />
Enhancements in Prior Releases<br />
A summary of enhancements in prior releases follows below. See the relevant chapters<br />
or the <strong>Reference</strong> <strong>Guide</strong> appendix for full details on methods listed below.<br />
<strong>DLI</strong> v2.2.13<br />
Default Search Path Suppression Exp<strong>and</strong>ed to All Platforms<br />
The enhancement first provided with the Adobe PDF Library v5.0.2Plus <strong>and</strong> <strong>DLI</strong><br />
v2.2.12 release for a method of suppressing the default search path for<br />
AdobeFnt.lst on Unix platforms (see “Default Search Path Suppression” on page<br />
1.21 below) is now exp<strong>and</strong>ed to all platforms.<br />
Image Search using Files In Memory<br />
<strong>DLI</strong> now searches the default ASFileSys (whichever filesystem was selected by the<br />
application) for graphic files, instead of automatically searching only the disk.<br />
(Graphic conversions are still cached to a temporary file on a physical file system.)<br />
1 Set the default file system to dlpdfmemfilesys.<br />
2 Create a file in the Files In Memory filesystem, <strong>and</strong> use dlpdfmemfilesetdata
Getting Started 1.21<br />
to make a region of memory into the file-in-memory.<br />
3 Call dlpdfimagecreatefromfile with the name of the file-in-memory.<br />
4 Set the default file system back to the original default, if files-in-memory is not<br />
being used for anything else.<br />
NOTE: Users currently using Files-In-Memory in their application but assuming<br />
that images are always retrieved from disk may need to modify their applications.<br />
They should either<br />
• bring the images from disk into memory, or<br />
• deliberately switch the default filesystem to disk temporarily<br />
in order to pull in the graphic(s) before continuing with further processing.<br />
<strong>DLI</strong> v2.2.12<br />
Default Search Path Suppression<br />
An enhancement has been added to enable the Adobe PDF Library to ignore its<br />
default search path (which varies somewhat from one platform to another) when<br />
compiling its list of resources at initialization time on Unix platforms. This is done by<br />
adding a PDFLDataRec.flags member to PDFLInit/dlpdfinit, which can be<br />
filled with a kPDFLInitIgnoreDefaultDirectories value. This will stop the<br />
Library from searching the current working directory on startup, or writing<br />
AdobeFnt.lst entries on shutdown.
1.22 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong>
2<br />
Initializing<br />
<strong>and</strong> Terminating the<br />
Library<br />
The procedure for initializing <strong>DLI</strong> <strong>and</strong> the Adobe PDF<br />
Library defines font locations, memory management<br />
routines <strong>and</strong> resource allocation in preparation for<br />
document processing.<br />
2.1
2.2 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
Overview<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
The <strong>DLI</strong> initialization process has been simplified such that when <strong>DLI</strong> is initialized, it<br />
automatically initializes the Adobe PDF Library as well. Initialization via <strong>DLI</strong> also<br />
provides the option of enabling the <strong>Datalogics</strong> Files In Memory (FIM) system, by<br />
specifying a file system to be used for temporary files <strong>and</strong> for file input/output<br />
operations.<br />
<strong>DLI</strong> must be initialized before creating any documents with <strong>DLI</strong> or making any calls<br />
to the Adobe PDF Library, should be initialized only once per composition program<br />
run, <strong>and</strong> should be terminated prior to the application shutdown.<br />
Adobe PDF Library Data Structure<br />
Initialization of <strong>DLI</strong> <strong>and</strong> the Adobe PDF Library requires a specific collection of<br />
information, maintained in the data structure PDFLDataRec. One such structure<br />
should be created <strong>and</strong> cleared to zeros before starting the Adobe PDF Library. The<br />
next few sections deal with settings of parts of this structure to prepare for initializing<br />
<strong>DLI</strong> <strong>and</strong> the Adobe PDF Library.
Initializing <strong>and</strong> Terminating the Library 2.3<br />
Setting Resource Directories<br />
The PDFLDataRec record contains two fields (dirList <strong>and</strong> listLen) which are<br />
used to establish a list of paths to be searched for font resources, its AdobeFnt.lst<br />
file. (See “The AdobeFnt.lst File” below.)<br />
NOTE: <strong>DLI</strong> does not search directory paths or environmental variable entries for<br />
fonts loaded via dlpdfttload.<br />
The resource directory listing (the PDFLDataRec record ) should not be used in OS/<br />
390, but may be used in all other platforms. This list is constructed by allocating an<br />
array of pointers to strings, <strong>and</strong> filling each pointer with a pointer to a path.<br />
The field dirList should be set to point to this array. The field listLen should be<br />
set to the number of entries in the above array. Examples of this usage can be found in<br />
the accompanying <strong>DLI</strong> sample applications.<br />
The AdobeFnt.lst File<br />
The process (your Adobe PDF Library application, <strong>and</strong> also Adobe Acrobat or Adobe<br />
Reader) compiles an AdobeFnt.lst file for its own use when either constructing a<br />
PDF document or rendering/displaying it later, for Adobe PDF Library <strong>and</strong> Adobe<br />
Acrobat applications respectively. It consists primarily of font information within files<br />
found on your machine. (Its actual name varies by product, platform or release level<br />
as AdobeFnt.lst, AdobeFnt06.lst or AdobeFnt07.lst, <strong>and</strong> possibly others.)<br />
You should find that the AdobeFnt.lst file is only compiled if one is not already<br />
present, or if any file in the directory is timestamped more recently than the<br />
AdobeFnt.lst file itself. The creation time does of course go up if many files are<br />
present. The file is not recompiled every time the application is run, only when certain<br />
conditions are met as described above.<br />
For efficiency, try to minimize the number of files that must be searched. You can do<br />
this by running the application from another location, so that the current working<br />
directory is one with very few files in it, or alternatively make use of the<br />
kPDFLInitIgnoreDefaultDirectories flag (see “Default Search Path<br />
Suppression Exp<strong>and</strong>ed to All Platforms” on page 1.20 for further details). You must
2.4 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
still ensure that the application gets a list of directories where its resources will be<br />
found.<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Since the AdobeFnt.lst file is a plaintext file, compiled on an as-needed basis by<br />
the application, you can review its contents in a text editor at any time to verify that it<br />
is finding the resources needed. Since it is possible to have many copies of<br />
AdobeFnt.lst scattered about (one may be created whenever an application is run<br />
in a new working directory for the first time), if there is any doubt as to which<br />
AdobeFnt.lst is in use by the application, you are free to delete the existing copies<br />
(or temporarily rename them in order to hide them), run the application again, <strong>and</strong><br />
then look to see where a new copy has appeared. Reviewing that file will show you<br />
the resources found by that instance of the application.<br />
More information on this can be found in the Adobe PDF Library Overview, pp. 23-<br />
24 (April, 2004 edition), under the subheadings "Initialization Details" for each<br />
platform.
Initializing <strong>and</strong> Terminating the Library 2.5<br />
Setting Memory Allocation Routines<br />
You may wish to use this portion of the PDFLDataRec record when your application<br />
contains a memory allocation/deallocation schema that you want the Adobe PDF<br />
Library to share. In particular, if your application does not use the system malloc/<br />
calloc/free routines, which the Adobe PDF Library will use by default, you may<br />
want to use this section.<br />
Control of memory allocation is accomplished by the creation of a new record<br />
(TKAllocatorProcs). You must allocate space for this record <strong>and</strong> fill in all of the<br />
fields in this record if you wish to establish your own memory manager.<br />
There are several procedures pointed to by this record:<br />
• allocProc — a routine to allocate memory<br />
• reallocProc — a routine to increase the size of an allocated block of memory<br />
• freeProc — a routine to free memory<br />
• memAvailProc — a routine that returns the amount of memory which may be<br />
requested without an error occurring<br />
The definitions of the interfaces for these procedures are contained in PDFInit.h.<br />
Basically, they are the interfaces for malloc (or calloc), realloc <strong>and</strong> free for<br />
st<strong>and</strong>ard UNIX. However, each contains as its first parameter a pointer to user data.<br />
This pointer is the fifth field of the TKAllocatorProcs record. See "Displaying a<br />
Square" in the Programs Links chapter for an example of setting these values.<br />
Setting Resource Allocation Routines<br />
The Adobe PDF Library contains a robust set of routines for locating resources.<br />
However, if your application wishes to control access to resources, this section is<br />
where such control is established.<br />
The TKResourceProcs record is similar to the TKAllocatorProcs record. It<br />
contains a pair of pointers to procedures for allocating <strong>and</strong> deallocating resources.<br />
The procedure interfaces are defined in PDFInit.h.
2.6 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
Adobe PDF Library Version Control<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
There are two version issues that you may need to consider when building <strong>and</strong><br />
running your application: the version of Adobe PDF Library <strong>and</strong> <strong>DLI</strong> in use, <strong>and</strong> the<br />
declared PDF version (or Compliance Level) being declared within the PDF output<br />
being generated.<br />
Obtaining Adobe PDF Library Version Number<br />
The version number of the Adobe PDF Library which was initialized may be obtained<br />
at any time after initialization as the return value of the method PDFLGetVersion:<br />
• The high-order 16 bits of the value are the Major Version Number<br />
• bits 8 through 15 are the Minor Version Number<br />
• bits 0 through 7 are the Sub-minor Version Number<br />
You may wish to have your application obtain <strong>and</strong> compare the returned Version<br />
Number to the constant kPDFLVersion to see if the version of the Adobe PDF<br />
Library being used at runtime is the same, greater, or less than the Version Number of<br />
with which it was compiled.<br />
PDF Level Declarations in Output<br />
PDF output files declare their compliance level with a particular version of the PDF<br />
St<strong>and</strong>ard; e.g. documents created with Adobe PDF Library v6.x can declare PDF<br />
v1.5. Applications reading, processing or displaying PDF output may inspect the<br />
declaration within the file to determine how to process it. In particular, Adobe<br />
Acrobat <strong>and</strong> Reader v5.x applications may produce a popup warning of possible<br />
unsupported PDF features if they detect that the declared PDF level of the document is<br />
higher than v1.4, even if the document does not in fact contain any functionality<br />
unique to v1.5 or above.<br />
The Adobe PDF Library is a set of routines associated with other Adobe products<br />
such as Adobe Acrobat, Adobe Acrobat Distiller <strong>and</strong> Adobe Reader. The original<br />
Adobe PDF Library was labeled as version 1.2 in order to maintain consistency with
Initializing <strong>and</strong> Terminating the Library 2.7<br />
the PDF st<strong>and</strong>ard of 1.2. The next version of the Library was labeled version 4.0 (<strong>and</strong><br />
subsequently 4.05) due to the tie-in with Acrobat v4.0. Versions 4.0/4.05 of the<br />
Library complied with the PDF st<strong>and</strong>ard of 1.3. Adobe PDF Library v5.0.2Plus<br />
complied with PDF St<strong>and</strong>ard 1.4, <strong>and</strong> the latest Adobe PDF Library v6.x complies<br />
with PDF St<strong>and</strong>ard 1.5.<br />
By default, the Adobe PDF Library declares the current PDF level compliance in<br />
output PDF files; e.g. Adobe PDF Library v6.x applications building pages without<br />
<strong>Datalogics</strong> Interface methods will generate PDF v1.5. Further description below<br />
applies only to PDF output generated via <strong>DLI</strong> methods.<br />
NOTE: Viewing a latest-generation PDF in a prior-version Adobe Acrobat or Adobe<br />
Reader (e.g. viewing PDF v1.5 in Acrobat or Reader v5.0 or earlier) can produce a<br />
popup warning of a PDF level mismatch, to warn the user that certain PDF features<br />
new to that version may not be supported by the viewing program. While this is<br />
only a warning, it may concern some users who have not upgraded to the latest<br />
viewer. You should ensure that your document features are backwards-compatible<br />
to older viewer versions where possible, or warn your users that a viewer upgrade<br />
will be required in order to take full advantage of features in your document, as<br />
appropriate.<br />
Selecting PDF Level Declarations via <strong>DLI</strong><br />
Applications built with Adobe PDF Library <strong>and</strong> <strong>Datalogics</strong> Interface (e.g. Adobe PDF<br />
Library v6.1.1Plus <strong>and</strong> <strong>DLI</strong> v3.0.19) <strong>and</strong> using <strong>DLI</strong> methods for output will have<br />
their output PDF compliance set appropriately by <strong>DLI</strong>. Unlike output generated solely<br />
by Adobe PDF Library v6.x methods, <strong>DLI</strong>-generated files will by default identify<br />
themselves as PDF v1.3 compliant in their simplest form, or higher values if<br />
appropriate, based on the functionality embedded in the document.<br />
Overriding PDF Level Declarations via <strong>DLI</strong><br />
When generating PDF output, the internal PDF Compliance Level declaration to be<br />
issued is made up of two internal component values, pdfMajorVer <strong>and</strong><br />
pdfMinorVer, which are members of the DLPDFDOC structure. pdfMajorVer<br />
defaults to 1, <strong>and</strong> when using <strong>DLI</strong> methods for PDF output, pdfMinorVer initially
2.8 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
defaults to 3 (PDF v1.3, for Adobe Acrobat v4 compatibility). If higher-level functions<br />
are used within the output PDF document, the pdfMinorVer will be incremented as<br />
appropriate to 4 or 5 (PDF v1.4 or PDF v1.5 respectively). You can force the declared<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Compliance Level by assigning the value you desire to pdfMinorVer within your<br />
application.<br />
Files In Memory Activation<br />
To increase the throughput of PDF generation, memory-mapped files may be used for<br />
temporary storage <strong>and</strong> for final output of the PDF content. Output of a PDF file to<br />
both memory <strong>and</strong> disk is also supported for environments where this feature is<br />
desired.<br />
In order to utilize Files In Memory (FIM), <strong>DLI</strong> must be initialized through the<br />
dlpdfinit function call, <strong>and</strong> the <strong>Datalogics</strong> memory file system must be passed to<br />
this function call. The memory file system may be obtained by calling the<br />
dlpdfmemfilesys function, detailed below (see “dlpdfmemfilesys” on page<br />
2.11). This may be called before <strong>DLI</strong> (<strong>and</strong>, hence, the Adobe PDF Library) is<br />
initialized. Once set, storage of temporary files in memory is automatic.<br />
The <strong>DLI</strong> sample applications accompanying this release demonstrate the coding <strong>and</strong><br />
use of Files In Memory. It can be invoked by adding the comm<strong>and</strong>-line argument<br />
MEMORY when calling the sample applications.<br />
Initializing <strong>and</strong> Terminating via <strong>DLI</strong><br />
The following comm<strong>and</strong>s should be used to initialize <strong>and</strong> terminate the Adobe PDF<br />
Library <strong>and</strong> <strong>DLI</strong>. In a single-threaded application, the initialization <strong>and</strong> termination<br />
processes must be called only once during the life of the application. Attempting to<br />
initialize the Adobe PDF Library <strong>and</strong> <strong>DLI</strong> more than once in the application may<br />
cause errors or unpredictable behavior, <strong>and</strong> is not supported. (You are free to create<br />
multiple documents <strong>and</strong>/or multiple files within the run, but the initialization <strong>and</strong>
Initializing <strong>and</strong> Terminating the Library 2.9<br />
termination of the Adobe PDF Library <strong>and</strong> <strong>DLI</strong> is limited to one iteration of each. In<br />
a multi-threaded application, each thread must perform its own initialization.)<br />
dlpdfinit<br />
This method initializes <strong>DLI</strong>, <strong>and</strong> prepares it to use the ASFileSys passed in as the<br />
second parameter; this may be NULL if the caller does not have an ASFileSys to<br />
pass to dlpdfinit, or does not have a filesystem preference.<br />
The first parameter is a PDFLInit structure used to initialize the Adobe PDF<br />
Library. It is the same structure that would be passed to the PDFLInit function call<br />
in legacy programs which use that function.<br />
The second parameter of dlpdfinit is an ASFileSys record specifying what file<br />
system should be used by <strong>DLI</strong> <strong>and</strong> the Adobe PDF Library. If NULL, the default file<br />
system operations will be used.<br />
The third parameter is NULL, reserved for future use.<br />
CAUTION: Versions of Adobe PDF Library prior to v6.1 are not thread-safe, <strong>and</strong><br />
should not be initialized more than once in a single job, either directly or via <strong>DLI</strong>.<br />
Doing so can produce undesirable results. Your application is free to create<br />
multiple output files or perform multiple tasks without exiting using the<br />
appropriate methods (see the <strong>DLI</strong> MultiDoc sample application, for example),<br />
but you must not terminate the Library until you are ready to stop the application,<br />
<strong>and</strong> once you have terminated the Library, you cannot initialize it again. You can<br />
accidentally call dlpdfinit (the <strong>DLI</strong> comm<strong>and</strong>) multiple times without problems,<br />
as it contains internal code that prevents actual initialization from occurring more<br />
than once, but you cannot call PDFLInit (the Adobe PDF Library comm<strong>and</strong>) more<br />
than once as a fatal error will occur. See further discussion on thread safety in<br />
“Thread-Safe Issues” on page 2.14.<br />
The <strong>DLI</strong> initialization call dlpdfinit must occur before any other call which makes<br />
reference to any DLPDFDOC structure (with the exception of dlpdfmemfilesys,<br />
which may be called for setup purposes). It returns a DLPDFINSTANCE pointer which<br />
may then be used to create documents. The dlpdfinit function call may also return<br />
a NULL pointer, indicating that <strong>DLI</strong> or the Adobe PDF Library could not initialize. If
2.10 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
this occurs, neither <strong>DLI</strong> nor the Adobe PDF Library should be used, <strong>and</strong> if possible,<br />
the calling program should cease execution as soon as is feasible.<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Specifying an Alternate File System<br />
The ASFileSys passed to dlpdfinit as its second argument will typically be either<br />
NULL (specifying that the user has no preference for how <strong>DLI</strong> manages file input <strong>and</strong><br />
output) or the dlpdfmemfilesys call. Calling dlpdfmemfilesys will return the<br />
ASFileSys record to the <strong>Datalogics</strong> memory file system for the Adobe PDF Library.<br />
This file system keeps temporary files in memory, instead of on disk, resulting in<br />
significantly improved processing speeds on some systems. You can create your own<br />
ASFileSys <strong>and</strong> pass it in, if you wish more control over how files are manipulated.<br />
NOTE: The included fonts must still be read from disk, <strong>and</strong> the PDF document<br />
which is created will be written to a disk file, unless the steps described in<br />
"Writing PDF Output to Memory" are taken. If the user has the means to specify<br />
an alternative file system, that too may be passed into dlpdfinit.<br />
Using a Graphics Cache<br />
As of <strong>DLI</strong> v3.0.11, the <strong>DLI</strong> graphics cache has been enhanced to use the default<br />
ASFileSys implementation provided to dlpdfinit for caching graphics. By<br />
default, the graphics cache file size is limited to 1.5GB. Customers who wish to use<br />
larger graphics cache files are advised to supply a filesystem to dlpdfinit which is<br />
capable of reliably h<strong>and</strong>ling files of the larger size.<br />
NOTE: The cache size limit is checked every time a document is destroyed; the<br />
cache may therefore temporarily exceed the cache size limit. When setting the<br />
cache size limit, please note that to resize the graphics cache, free space equal to<br />
the sum of the cache limit <strong>and</strong> the "low water" mark is required. Files In Memory<br />
users with large graphics workloads are advised to lower the cache size limit to a<br />
number appropriate for their target environment.
Initializing <strong>and</strong> Terminating the Library 2.11<br />
dlpdfmemfilesys<br />
This procedure returns the ASFileSys structure which represents <strong>Datalogics</strong>’ Files In<br />
Memory file system. This file system will only be used if PDF output is requested.<br />
This structure is suitable as the second parameter to the dlpdfinit function.<br />
Image Search using Files In Memory<br />
With the release of <strong>DLI</strong> v2.2.13, an enhancement was added for a method of holding<br />
graphics in memory <strong>and</strong> searching for them there, as opposed to storing <strong>and</strong> searching<br />
for graphics on disk only. This was not in the form of a separate API; instead, <strong>DLI</strong><br />
was altered to search the default ASFileSys (whichever filesystem was selected by<br />
the application) for graphic files, instead of automatically searching only the disk.<br />
(Graphic conversions are still cached to a temporary file on a physical file system.)<br />
To take advantage of this, you would<br />
1 Set the default file system to dlpdfmemfilesys.<br />
2 Create a file in the Files In Memory filesystem, <strong>and</strong> use dlpdfmemfilesetdata<br />
to make a region of memory into the file-in-memory.<br />
3 Call dlpdfimagecreatefromfile with the name of the file-in-memory.<br />
4 Set the default file system back to the original default, if files-in-memory is not<br />
being used for anything else.<br />
NOTE: Users currently using Files-In-Memory in their application but assuming<br />
that images are always retrieved from disk may need to modify their applications.<br />
They should either<br />
• bring the images from disk into memory, or<br />
• deliberately switch the default filesystem to disk temporarily<br />
in order to pull in the graphic(s) before continuing with further processing.<br />
Terminating <strong>DLI</strong> <strong>and</strong> the Adobe PDF Library<br />
Termination of <strong>DLI</strong> is accomplished by calling dlpdfterm with the<br />
DLPDFINSTANCE pointer returned from the dlpdfinit function call. This call
2.12 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
should not be made until all <strong>DLI</strong> structures, with the exception of the<br />
DLPDFINSTANCE pointer, <strong>and</strong> all PDE <strong>and</strong> PD library structures are freed. The<br />
dlpdfterm call will free the DLPDFINSTANCE pointer <strong>and</strong> the pointers set in the<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
PDFLDataRec structure. Terminating <strong>DLI</strong> will also terminate the Adobe PDF<br />
Library.<br />
dlpdfterm<br />
This method will terminate <strong>DLI</strong> <strong>and</strong> the Adobe PDF Library. Call this function after<br />
all DLPDFDOC structures have been disposed of. In the case of multi-thread<br />
applications, each thread that initialized the Library must also terminate it when<br />
finished.<br />
This will typically be one of the last calls of a program using <strong>DLI</strong>. The call takes a<br />
DLPDFINSTANCE pointer, which is the DLPDFINSTANCE pointer returned by the<br />
dlpdfinit function call. Any composition program using <strong>DLI</strong> <strong>and</strong> the Adobe PDF<br />
Library should call dlpdfterm to terminate <strong>DLI</strong> <strong>and</strong> the Adobe PDF Library before<br />
terminating itself. The dlpdfterm function takes the DLPDFINSTANCE returned<br />
from dlpdfinit as its sole parameter.
Initializing <strong>and</strong> Terminating the Library 2.13<br />
Typical Order of Calls<br />
In summary, the overall calling sequence would be similar to the following example:<br />
.<br />
PDFLDataRec InitStruct;<br />
DLPDFINSTANCE *pdfInstance = NULL;<br />
.<br />
.<br />
.<br />
/* to use Files In Memory */<br />
pdfInstance = dlpdfinit(&InitStruct, dlpdfmemfilesys(), NULL);<br />
/* to use st<strong>and</strong>ard files */<br />
pdfInstance = dlpdfinit(&InitStruct, NULL, NULL);<br />
.<br />
.<br />
.<br />
if (!pdfInstance) /* if not 0 then error */<br />
{<br />
printf("Error initializing <strong>DLI</strong> -- aborting\n");<br />
exit(1);<br />
}<br />
.<br />
.<br />
.<br />
/* to close library */<br />
dlpdfterm(pdfInstance);<br />
Multi-Thread Initializations<br />
Adobe PDF Library v6.1.0Plus <strong>and</strong> <strong>DLI</strong> v3.0.11 (or higher) are re-entrant, <strong>and</strong><br />
therefore safe for multithreaded applications. However, the Adobe PDF Library will<br />
perform cleanup work during termination if no other instances are active, which will<br />
cause the Library to not initialize correctly for any follow-on processes afterwards.<br />
Therefore, though each thread must call PDFLInit/PDFLTerm or dlpdfinit/<br />
dlpdfterm (for <strong>DLI</strong> applications), take care that Adobe PDF Library <strong>and</strong> <strong>DLI</strong> are<br />
not re-initialized after the last outst<strong>and</strong>ing initialization has been terminated. For
2.14 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
example, the following sequence will cause errors when attempting to initialize<br />
Thread 2:<br />
Concepts <strong>and</strong> dlpdfinit() Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
[Thread 1 processing]<br />
dlpdfterm()<br />
dlpdfinit()<br />
[Thread 2 processing]<br />
dlpdfterm()<br />
The problem above is that when Thread 1 terminates, no other processes are seen, <strong>and</strong><br />
so shutdown cleanup work begins, leading to errors when the initialization of Thread<br />
2 comes along.<br />
This sequence is recommended instead:<br />
dlpdfinit()<br />
dlpdfinit()<br />
[thread 1 processing]<br />
[thread 2 processing]<br />
dlpdfterm()<br />
dlpdfterm()<br />
Thread-Safe Issues<br />
Releases of the Adobe PDF Library prior to v6.1 are not thread-safe, <strong>and</strong> so by<br />
extension neither is <strong>DLI</strong>. Adobe PDF Library v6.1 <strong>and</strong> its accompanying <strong>DLI</strong> is the<br />
first thread-safe release in distribution. Notes on use of prior versions within multithreaded<br />
applications are given below. It is possible to use pre-v6.1, non-thread-safe<br />
Library applications in a threaded environment under the proper configuration in<br />
certain circumstances (although you should plan to upgrade your application to a<br />
thread-safe Adobe PDF Library v6.1.x version at your next opportunity).<br />
The general idea is that your application will queue the threads' interaction with the<br />
Library functions so that they are executed one at a time. This is not too difficult to do<br />
if your pre-v6.1.x application uses a mutex (Mutual Exclusion) algorithm to ensure<br />
that only one thread has access to the Library at any given point in time. Testing has<br />
shown that execution time does not appear negatively impacted if the Library<br />
segments are efficiently grouped, so that any given thread's Library activity is over<br />
<strong>and</strong> done with before the next process calls. When properly implemented, there
Initializing <strong>and</strong> Terminating the Library 2.15<br />
should be no noticeable deterioration in performance due to the mutex gatekeeper<br />
logic, <strong>and</strong> a multi-threaded application can thus use an older, pre-v6.1.x version of the<br />
Adobe PDF Library.<br />
NOTE: While these instructions should enable you to implement a multi-threaded<br />
application with an older, non-threadsafe version of the Library, you should<br />
upgrade your application to make use of the latest thread-safe release as soon as<br />
possible. Newer releases contain numerous other improvements in addition to<br />
multithread capability.<br />
The problem revolves around the event h<strong>and</strong>ler stack. Since the Adobe PDF Library<br />
prior to v6.1.x has only one h<strong>and</strong>ler stack, multiple, concurrent processes have no<br />
means of determining whose Library activity is occurring at any given point in time,<br />
so it is possible for the Library to return a bad event for one process that could be<br />
caught by another process by mistake. With mutex coding, you can ensure that only<br />
one process has access to the Library at any given time, <strong>and</strong> the next process is<br />
granted access only after the first one is concluded.<br />
As stated, this works reasonably well as long as the Library access is efficiently<br />
arranged within the application code. That is, you should not simply put one big<br />
DURING/HANDLER/END_HANDLER around the entire algorithm, as the process will<br />
then comm<strong>and</strong>eer the Library for its entire job, to the exclusion of all others. Instead,<br />
divide the application algorithm into logical blocks of Library activity, so that Library<br />
access is more likely to be evenly divided among concurrent processes. Also try to<br />
ensure that, if possible, a given process waiting for an external event to finish will not<br />
be tying up Library access in the meantime.<br />
Writing PDF Output to Memory<br />
Output of PDF files to memory ("transient files") requires slight changes to your<br />
application, summarized below.<br />
When calling dlpdfdocsetpdfname or dlpdfdocwritepdf functions, these<br />
functions must be given a filename which marks the file as a transient file. This is done<br />
by prefacing the document's filename with the transient prefix, obtained by calling the
2.16 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfmemfiletransientprefix function. This returns a character string with<br />
the necessary prefix, which marks the file such that it is not written to disk.<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Call dlpdfdocwritepdf when the document is complete, <strong>and</strong> obtain the<br />
ASPathName for the string passed to dlpdfdocwritepdf. Obtain the MDFile<br />
representing the Files In Memory entry for the document via the<br />
dlpdfmemfileacquire (ASPathName) function. This returns the MDFile for<br />
the document. Then, the size of the memory buffer needed to contain the file can be<br />
obtained with the dlpdfmemfilesize(MDFile) call, <strong>and</strong> the information itself is<br />
returned (as a const unsigned char buffer of the size returned by the call above)<br />
by the dlpdfmemfiledata (MDFile) function.<br />
Copy the contents of the returned pointer as soon as possible. This pointer should not<br />
be changed or modified, <strong>and</strong> should not be freed. Call dlpdfmemfilerelease<br />
MDFile) to release the file, its memory <strong>and</strong> other resources once this file is finished<br />
being used. The function will return the remaining number of acquisitions for the Files<br />
In Memory file.<br />
The functions to support this are:<br />
dlpdfmemfileacquire<br />
This function acquires the file given by the pathname passed in, <strong>and</strong> returns it as an<br />
MDFile. A memory file is eligible to be removed when no acquisitions are<br />
outst<strong>and</strong>ing upon it.<br />
dlpdfmemfilesize<br />
This function returns an ASSize_t value containing the smallest size of a block of<br />
memory (in bytes) which could contain the data of the given MDFile.<br />
dlpdfmemfiledata<br />
This function returns a pointer to a memory representation of this file. The contents<br />
should be copied as soon as possible, <strong>and</strong> must be neither altered nor freed.
Initializing <strong>and</strong> Terminating the Library 2.17<br />
dlpdfmemfilesetdata<br />
This function sets the file passed in to contain the data passed to the function. This<br />
completely overwrites the file’s previous contents. Returns TRUE if successful, or<br />
FALSE if the file's contents could not be set.<br />
dlpdfmemfilerelease<br />
Decrements the file's acquisition counter <strong>and</strong> signals to <strong>DLI</strong> that the application no<br />
longer requires the use of this file. A file should be released for each acquisition made<br />
to the file; if it is not released, then release of the file's memory <strong>and</strong> other resources<br />
will be delayed until the end of program execution.<br />
dlpdfmemfiletransientprefix<br />
Returns a string representing the transient prefix. Memory files whose names start<br />
with the transient prefix will not be written to disk. Otherwise, the files will be written<br />
to disk upon file closure or program termination.<br />
API Comparison<br />
The Hellodli program sample was created to provide a clear comparison between a<br />
sample program using the <strong>DLI</strong> API in conjunction with the Adobe PDF Library API,<br />
<strong>and</strong> one using the Adobe PDF Library API exclusively. The similarities <strong>and</strong> differences<br />
between the two types of applications can be seen by comparing the hellodli.c file<br />
to the helowrld.c file provided by Adobe.<br />
The two programs perform largely the same task: Produce a simple, one-page<br />
document with a line of text on it. You can compare the source code for each file to<br />
see which Adobe PDF Library methods are replaced by <strong>DLI</strong> methods. In most cases,<br />
you should find that the <strong>DLI</strong> methods are simpler <strong>and</strong> easier to implement. On a<br />
larger scale, <strong>DLI</strong> methods also enable Files In Memory processing, which in turn<br />
allows faster processing times <strong>and</strong> reduced I/O activity for intermediate work file<br />
actions.
2.18 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System
3<br />
Beginning <strong>and</strong><br />
Ending a Document<br />
This chapter describes the methods provided in <strong>DLI</strong> to<br />
create <strong>and</strong> write a document.<br />
3.1
3.2 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
Overview<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
<strong>DLI</strong> provides a simple interface to create <strong>and</strong> write documents. It uses a document<br />
structure (DLPDFDOC) to differentiate between documents, allowing for the<br />
simultaneous creation of a number of documents. DLPDFDOC reflects the current<br />
status of the document at all times <strong>and</strong> is required input to most other <strong>DLI</strong> calls. As<br />
the document is created with Adobe PDF Library support, a CosDoc <strong>and</strong> a PDDoc<br />
are created within the Library, <strong>and</strong> these may be obtained from this structure for use<br />
in calls outside of <strong>DLI</strong>.<br />
The Adobe PDF Library establishes the name <strong>and</strong> many of the attributes of a<br />
document when it is completed, rather than when it is begun. Many existing<br />
composition engines do not do this. For this reason, the document structure has a<br />
convenient set of h<strong>and</strong>les to permit the specification of such attributes at document<br />
creation time, rather than at document write time.<br />
There are a number of calls available at the Document Interface. Multiple documents<br />
may be created <strong>and</strong> maintained at one time.<br />
Required Use of Exception H<strong>and</strong>lers<br />
Except for dlpdfinit <strong>and</strong> dlpdfterm, all calls to the Document Interface must be<br />
within an exception h<strong>and</strong>ler (i.e. DURING/HANDLER/END_HANDLER statements) <strong>and</strong><br />
all <strong>DLI</strong> documents should be destroyed prior to closing the Adobe PDF Library. This<br />
can be done all at once or one step at a time. Both <strong>DLI</strong> <strong>and</strong> the Adobe PDF Library<br />
may raise exceptions in the form of escapes.<br />
dlpdfinit <strong>and</strong> dlpdfterm must not be enclosed in these h<strong>and</strong>lers because they<br />
are not set up before initialization, <strong>and</strong> are freed during termination.<br />
dlpdfdoccreate<br />
This method will create <strong>and</strong> return a pointer to a new document, as a DLPDFDOC<br />
pointer. There are two parameters to this method, an ASBool <strong>and</strong> a pointer to a<br />
string, which are generally TRUE <strong>and</strong> NULL respectively. The first parameter, if
Beginning <strong>and</strong> Ending a Document 3.3<br />
FALSE, will bypass creation of the Adobe PDF Library data structures. If PDF is the<br />
desired output, this must be TRUE. The second parameter, if not NULL, should be the<br />
name for a PostScript output file to be created via a later call to dlpdfdocwritePS.<br />
dlpdfdoccompress<br />
This method should be called before any content is placed onto a page. Content<br />
placed prior to this call will not be compressed. The compression algorithm used is<br />
Flate.<br />
dlpdfdocembedfonts<br />
When this method is called, all fonts seen will be embedded in the document if<br />
possible, including Base 14 fonts. The flag set by this method is in<br />
DLPDFDOC->EmbedFonts, <strong>and</strong> may be safely manipulated by the client program. It<br />
is also possible to specify embedding <strong>and</strong> subsetting on the font create call.<br />
NOTE: If a font is available but not licensed for embedding, it will be created as a<br />
referenced font rather than an embedded font. An exception is not returned for<br />
this condition, but the NotEmbedded flag of the DLPDFFONT structure can be<br />
inspected after the dlpdfdocembedfonts call, if desired.<br />
dlpdfdocsetencoding<br />
The encoding of created fonts will default to WinAnsiEncoding on Windows<br />
machines <strong>and</strong> St<strong>and</strong>ard encoding on all other platforms. You may set it to any valid<br />
encoding through this method.<br />
This encoding is used when the font create call does not include an encoding.<br />
dlpdfdocsetpdfname<br />
When the desired name of the PDF file resulting from this document is known at<br />
document creation time, it may be stored using this method <strong>and</strong> will be retrieved<br />
when the document is written.
3.4 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfdoclinearize<br />
When it is known at document creation time that this file should be written in a<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
linearized form, this knowledge may be stored via this method <strong>and</strong> will be retrieved<br />
when the document is written.<br />
dlpdfdocsetdocinfo<br />
This method accepts couplets of information, each a string, <strong>and</strong> saves them in the<br />
document information structure of the document. This may be done at any time.<br />
dlpdfdocmakethumbnails<br />
For Adobe PDF Library v4.x <strong>and</strong> higher, this method will create a thumbnail image<br />
for each page in the document. This call may be made at any time prior to writing the<br />
document. Thumbnails will be created automatically at document write time.<br />
dlpdfdocwritepdf<br />
This call causes the document to be written to a PDF file. It accepts as parameters a<br />
document h<strong>and</strong>le, an optional string giving the name of the file to be written, <strong>and</strong> a<br />
flag indicating whether linearization is desired.<br />
If a name has been saved via dlpdfdocpdfname, that name will be used in the write,<br />
regardless of the specification of a name in the name parameter. If neither a name<br />
parameter nor a saved name is present, an exception (genErrBadParm) will be<br />
raised.<br />
If the linearize parameter is TRUE, or the method dlpdfdoclinearize has<br />
been used, the document will be linearized; otherwise, it will be nonlinearized.<br />
dlpdfdocencrypt<br />
This call causes the document contents to be encrypted using the Adobe PDF Library<br />
st<strong>and</strong>ard encryption mechanism. It accepts a DLPDFDOC pointer, a character pointer
Beginning <strong>and</strong> Ending a Document 3.5<br />
to the user password, a character pointer to the owner password, <strong>and</strong> a PDPerms<br />
data type. The latter must contain the security permissions as outlined in the Acrobat<br />
Core API <strong>Reference</strong> Manual in the PDPerms definition. This call may be made at any<br />
time prior to dlpdfdocwritepdf.<br />
dlpdfdocsetencryptkeylen<br />
This enables variable length encryption keys as supported by the Adobe PDF Library.<br />
It accepts a DLPDFDOC pointer, a parameter specifying the number of bytes between 5<br />
<strong>and</strong> 16 inclusive used to determine key length used during encryption.<br />
This function can be called to set the length of the encryption key before a call to<br />
dlpdfdocencrypt if the application is to use an encryption key length other than<br />
the original 40-bit length provided in previous versions.<br />
The use of this function is optional if the original 40-bit key length is to be used.<br />
Subsequent calls to dlpdfdocencrypt will use the number of bytes specified in the<br />
call to dlpdfdocsetencryptkeylen. If the key length has not been set previously,<br />
the st<strong>and</strong>ard 5-byte value is used as the default.<br />
For more information on Encryption, refer to the beginning of section 3.5,<br />
"Encryption," in the Adobe PDF <strong>Reference</strong> (Fourth edition). For information on<br />
PDDocSetNewSecurityData <strong>and</strong> StdSecurityDataRec, see the Adobe Core<br />
API <strong>Reference</strong> <strong>Guide</strong> (March, 2004 edition), pages 1352 <strong>and</strong> 2988 respectively.<br />
NOTE: For applications generating multiple documents,<br />
dlpdfdocsetencryptkeylen must be called for each document for which<br />
an encryption key length other than the st<strong>and</strong>ard 5-byte value is desired.
3.6 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System
4<br />
Fonts<br />
For most users of <strong>DLI</strong>, font creation is both one of the<br />
most important <strong>and</strong> one of the most difficult aspects of<br />
an application. Though <strong>DLI</strong> has been designed to hide<br />
most of the complexity of font creation, there is still a lot<br />
to underst<strong>and</strong> regarding font creation <strong>and</strong> usage. With<br />
the ability to use most Windows <strong>and</strong> Macintosh native<br />
code pages, as well as Unicode (using Adobe PDF<br />
Library v5.0.2Plus or higher), the <strong>DLI</strong> font mechanism is<br />
flexible enough to h<strong>and</strong>le nearly any user request.<br />
4.1
4.2 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
PDF Font Overview<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
It is important to start by underst<strong>and</strong>ing the difference between the terms character<br />
<strong>and</strong> glyph. A character is an abstract, named entity, such as "hyphen." A glyph is the<br />
representation of a character contained within a font: the mark in the PDF file which<br />
visually represents the character, what you see on-screen or on paper. This is an<br />
important distinction, since some font types use character identifiers to typeset text;<br />
others use glyph identifiers to typeset text. For this chapter, the terms character <strong>and</strong><br />
glyph will be used interchangeably unless the technical distinction is important, in<br />
which case this will be noted.<br />
Characters <strong>and</strong> glyphs in a PDF font can be addressed using either one-byte encodings<br />
(such as WinAnsiEncoding), multibyte encodings (such as Shift-JIS), or 2-byte<br />
glyph identifier (GID) encodings for some TrueType fonts. Some fonts support more<br />
than one method of accessing characters.<br />
There are two categories of fonts in the PDF file format:<br />
• Simple fonts<br />
• Composite fonts<br />
Simple Fonts<br />
Simple fonts are those fonts which are addressed using one byte per glyph or<br />
character. PostScript Type1 fonts <strong>and</strong> most TrueType fonts fall into this category. With<br />
these fonts, no more than 255 characters are addressable. <strong>DLI</strong> offers the flexibility to<br />
easily encode which characters are accessible by accepting an encoding array. The<br />
widths of these characters can also be controlled by providing an array of character<br />
widths.<br />
PDF TrueType fonts which have a post table can use encoding vectors to access fonts<br />
outside the Adobe st<strong>and</strong>ard one-byte encodings.
Fonts 4.3<br />
Composite Fonts<br />
Composite fonts are fonts which use multibyte encodings or GID values. These are<br />
known as CID fonts (for "Character ID") or Type0 fonts, even though many are not<br />
accessed using a CID value.<br />
There are two varieties of Type0 fonts:<br />
• CIDType0<br />
• CIDType2<br />
CIDType0 Fonts<br />
CIDType0 fonts use the CMap file format as specified by Adobe, <strong>and</strong> will accept a<br />
number of different encodings, though these CMap files are typically somewhat<br />
narrow in their range of addressable characters. A CIDType0 font is usable with a set<br />
of CMap files; this is the only way to access characters.<br />
CIDType2 Fonts<br />
CIDType2 fonts are also TrueType font streams, but are addressed using 2-byte glyph<br />
identifiers (glyph IDs). These should not be created using CMaps, since the fonts are<br />
not keyed by character but by glyph. Instead, a CIDToGID map is used to convert the<br />
2-byte character in the PDF text strings to glyph IDs for the font.<br />
For font files loaded into a DLPDFINSTANCE, <strong>DLI</strong> uses the International<br />
Components for Unicode (ICU) to translate Unicode inputs <strong>and</strong> a large array of<br />
vendor-defined multibyte encodings to output text. The DLPDFTEXT structure is used<br />
to properly combine characters <strong>and</strong> support right-to-left reading order. For CIDType2<br />
fonts, a mapping from the DLPDFTEXT input to glyph IDs for output is generated.<br />
Whenever possible, the output text in the PDF file is in UTF16 big-endian format.<br />
The Adobe PDF Library <strong>and</strong> <strong>DLI</strong> also allow CIDType2 fonts to be used for a number<br />
of single-byte vendor encodings. Output is in two-byte glyph IDs which correspond to
4.4 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
glyph identifiers in the embedded font stream. Text is input using the DLPDFCONTENT<br />
text calls as if using a single-byte font.<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Most TrueType <strong>and</strong> OpenType font files can be used to create either TrueType (singlebyte)<br />
or CIDType2 PDF fonts. In all cases, TrueType <strong>and</strong> CIDType2 fonts should be<br />
both embedded <strong>and</strong> subset to ensure reliable results when viewing <strong>and</strong> printing. In this<br />
chapter, the term "TrueType font" means a PDF TrueType font using a one-byte<br />
encoding, <strong>and</strong> the term "CIDType2 font" means a TrueType or OpenType font using<br />
GID values to access characters in the PDF file.<br />
Structure of a <strong>DLI</strong> Font<br />
A font is reflected in the structure DLPDFFONT. These structures are created by the<br />
font creation calls on a per-document basis. They may be used only within the<br />
document they were created with. Fonts are tracked within the document, <strong>and</strong><br />
destroyed when the document is destroyed. Pointers to fonts are invalid after the<br />
destruction of their document. All DLPDFFONT structures for a given document will<br />
be released when that document is destroyed. Therefore, methods that use<br />
DLPDFFONT as a parameter (i.e. dlpdfcontenttext, dlpdfcontentwidetext,<br />
dlpdfcontenttextwidth, dlpdfcontentwidetextwidth) must be called<br />
before the document is destroyed<br />
Font Embedding Status<br />
The field DLPDFFONT->NotEmbedded will be TRUE only if a request was made to<br />
subset the font but the request procedure failed. If the font could not embed due to<br />
license restrictions (i.e. the request procedure functioned correctly, but the font itself is<br />
not licensed for embedding), an exception will be raised instead.<br />
Font Subsetting Status<br />
The field DLPDFFONT->SubSetMap will be NULL if a font is not subset. The field<br />
will be not NULL if a font is (or will be) subset.
Fonts 4.5<br />
Font Attributes<br />
The field DLPDFFONT->RequestedFontAttr is a PDEFontAttrs structure. It is<br />
populated with the font attributes of the system font actually used to create the font,<br />
with the alterations requested by the calling application.<br />
Document EmbedFonts Flag<br />
If the document that contains the font carries the flag EmbedFonts (normally set by<br />
dlpdfdocembedfonts), then all fonts for that document will be embedded,<br />
regardless of the call used to create those fonts.<br />
All fonts will be subset unless either<br />
• they were created with a call to explicitly not embed the fonts, or<br />
• license restrictions prevent the font from being embedded.<br />
NOTE: If a font is available but not licensed for embedding, it will be created as a<br />
referenced font rather than an embedded font. An exception is not returned for<br />
this condition, but the NotEmbedded flag of the DLPDFFONT structure can be<br />
inspected after the dlpdfdocembedfonts call, if desired.<br />
Entries in the DLPDFFONT structure should not be altered after a font is created.<br />
Except for certain specific exceptions to be noted here, changes made to this structure<br />
will not be subsequently reflected in the font that is created <strong>and</strong> placed in the PDF<br />
document.
4.6 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
Font Creation Calls<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
There are several procedures available for creating a DLPDFFONT structure:<br />
• dlpdffontcreate<br />
• dlpdffontcreateembedded<br />
• dlpdffontcreatewithmetrics<br />
• dlpdffontcreatewithmetricsembedded<br />
All of these calls create the DLPDFFONT structure described above. They are listed in<br />
increasing order of control given over font characteristics, <strong>and</strong> according to the<br />
amount of information a user is required to have about a given font. Those near the<br />
top of the list above require less initial information from the user than those further<br />
down.<br />
The dlpdffontcreatewithmetrics <strong>and</strong><br />
dlpdffontcreatewithmetricsembedded calls can be used to modify the<br />
character width table <strong>and</strong> the character encoding vector array, as well as all the font<br />
attributes which are reflected in the PDEFontAttrs structure these calls require.<br />
Repetitive Font Creation Calls<br />
A DLPDFDOC maintains a list of defined fonts by the name <strong>and</strong> font attributes<br />
requested. Second <strong>and</strong> subsequent calls to create a font structure of a given name <strong>and</strong><br />
attributes will return the same font structure as the first call. For example, if you ask<br />
for the Type1 font Baskerville 20 times, with the same attributes every time, only a<br />
single PDF font structure for Baskerville will be created, <strong>and</strong> only a single<br />
DLPDFFONT structure will be created for Baskerville. If these requests supply differing<br />
font attributes, more than one copy of Baskerville is created.<br />
NOTE: The dlpdffontcreate family of calls will always allow the creation of<br />
the Adobe st<strong>and</strong>ard type 1 fonts. The names of these 14 fonts (sometimes referred<br />
to as the Base 14 fonts) can be found in the PDF <strong>Reference</strong>.
Fonts 4.7<br />
dlpdffontcreate<br />
This is the basic font access method. It accepts a font name <strong>and</strong> optionally a font type,<br />
both as strings. When the font type is present, the method will attempt to find a font<br />
which matches both that type <strong>and</strong> name. If none is found, it will attempt to match the<br />
specified name in any type of font.<br />
Font Searching Sequence<br />
The specific dlpdffontcreate search procedure follows this sequence, in order,<br />
until a font fitting the search parameters is identified. For each test below, the order of<br />
preference when searching for a match is for Type 1 fonts first, then TrueType fonts,<br />
<strong>and</strong> finally CID fonts. If no match occurs, the next test in the sequence below is<br />
attempted.<br />
1 The current DLPDFDOC is searched for fonts with the same name <strong>and</strong> type as<br />
requested. If one was already created, it is returned.<br />
2 If a Base 14 font is requested <strong>and</strong> is not to be embedded, it is created <strong>and</strong> returned.<br />
3 If the name is matched in the DLPDFINSTANCE font cache, the font is copied to<br />
the current DLPDFDOC <strong>and</strong> returned. (This is where fonts loaded via<br />
dlpdfttload are processed.)<br />
4 The system is searched for a font of explicit name <strong>and</strong> type requested by the user. If<br />
found, it is created <strong>and</strong> returned.<br />
5 The system is searched for a font of explicit name (without regard to type)<br />
requested by the user. If found, it is created <strong>and</strong> returned.<br />
6 If any font of the same family <strong>and</strong> typeface style is found, it is created <strong>and</strong><br />
returned.<br />
If a font using a one-byte encoding is found for this name, its width table in the<br />
document’s encoding will be loaded into the DLPDFFONT->WidthTable. If the<br />
document indicates that all fonts are to be embedded, this font will be embedded <strong>and</strong><br />
subset if possible. The font structure created will carry all of the metrics of this font,<br />
so that if it is not embedded <strong>and</strong> is not present on the imaging platform, a Multiple<br />
Master (or "multi-master") font can be used to provide imaging of the document.<br />
The encoding used in this font will be the encoding specified in<br />
dlpdfdocsetencoding, if that call has been used; otherwise it will default<br />
depending on the system in use: WinAnsiEncoding will be used on Windows
4.8 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
systems <strong>and</strong> Adobe st<strong>and</strong>ard encoding will be used on UNIX, OS/390 <strong>and</strong> AS/400<br />
systems.<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
If dlpdffontcreate is called without a font name, it will raise a genErrBadParm<br />
exception ("Bad Parameters") <strong>and</strong> exit.<br />
dlpdffontcreateembedded<br />
This method behaves like dlpdffontcreate, except that:<br />
• The font will be embedded (if possible) regardless of the overall document settings.<br />
• If the subset flag is TRUE, the embedded font will be subset.<br />
• If the subset flag is FALSE, the embedded font will not be subset.<br />
NOTE: Type0 fonts must be subset if they are embedded.<br />
dlpdffontcreatewithmetrics<br />
This method allows the user greater control over the font selection process, <strong>and</strong><br />
permits alteration of the width table, encoding vector <strong>and</strong> font attributes of the font<br />
returned. This call should be used when the characteristics of a font need to be altered.<br />
The application using this function should initialize the PDEFontAttrs structure<br />
with NULL values before calling. It should then fill out the name of the font to be<br />
located. Supplied parameters, with the exception of the psName <strong>and</strong> cidFontType
Fonts 4.9<br />
fields (<strong>and</strong> the font name given, if the font returned has a different name), will be used<br />
to change the characteristics of the font if these are set.<br />
CAUTION: It is not difficult to create an invalid font by setting these values<br />
incorrectly. Therefore, the application should set only the fields that it is<br />
concerned with affecting in the returned font, <strong>and</strong> leave the rest as NULL values.<br />
The dlpdffontcreatewithmetrics function will match system fonts based on<br />
the parameters in the PDEFontAttrs structure:<br />
• If a system font is found, it will be altered to reflect the values in the<br />
PDEFontAttrs structure (with the exceptions noted above).<br />
• If no system font is found, a font will be created if a valid width table <strong>and</strong> set of<br />
PDEFontAttrs are passed into this function.<br />
• If no system font is found <strong>and</strong> an invalid width table or set of font attributes is<br />
passed to this function, an exception will be raised.<br />
The encoding field in the PDEFontAttrs font attributes structure is an ASAtom<br />
containing one of the significant strings listed in "Predefined Font Encodings," or the<br />
name of a predefined encoding or CMap file (as given in the PDF <strong>Reference</strong> manual).<br />
This should correspond to the encoding format in which the font’s text is to be<br />
typeset.<br />
NOTE: Not all the predefined encodings may be used with all fonts. Details on<br />
which types will accept which values are given in the section on predefined font<br />
encodings later in this chapter.<br />
The type field in the PDEFontAttrs font attributes structure should be filled in by<br />
the user. If it is not (i.e. currently ASAtomNull), then any type of font (Type1,<br />
TrueType, etc.) may be used. Otherwise, a font of the matching type will be selected if<br />
present. If no font of the matching type is found, any suitably-named font will be<br />
returned.<br />
The charSet field in the PDEFontAttrs font attributes structure may be set to<br />
"Roman" or ASAtomNull. With an ASAtom value of "Roman," only a font
4.10 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
containing the Adobe st<strong>and</strong>ard character set will be used; with ASAtomNull, any<br />
character set will be acceptable.<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
The wMode field in the PDEFontAttrs font attributes structure may be set to 0<br />
(horizontal) or 1 (vertical) to select a font of the appropriate writing mode.<br />
The other fields in the font attributes structure are explained in Adobe PDF Library<br />
documentation.<br />
Width Table<br />
A width table may be included with this method for use with TrueType or Type1<br />
fonts. Generally, you should include such a table specifically in cases where you expect<br />
that the font is not known either to the Adobe PDF Library or to Adobe Reader, or<br />
when character widths have to be altered — for example, in the case where an<br />
encoding vector (described below) is used. This table is arranged from the first<br />
character to the 256th character for the encoding or encoding vector used to create<br />
the font.<br />
A font not present on the system must be represented by a width table.<br />
Encoding Vector<br />
You may wish to modify the encoding vector for a Type1 or TrueType font. There are<br />
many reasons for doing this. It is required if you must access characters within the<br />
font not normally encoded. It may be done as a convenience when your data is<br />
encoded differently from the default encoding of the font. Encodings which are not<br />
based on any of the predefined font encodings may also be created <strong>and</strong> used in this<br />
manner.<br />
The encoding vector is an array of 256 pointers to strings. The values of the strings<br />
are the glyph names of the encoded characters, as these are defined in the font.<br />
Positions which are not encoded should contain the string .notdef.<br />
Type0 fonts may not be encoded. Further, some TrueType fonts may behave<br />
unpredictably if an encoding vector is supplied. The PDF <strong>Reference</strong> Manual
Fonts 4.11<br />
recommends that encoding vectors not be supplied for TrueType fonts. Please see the<br />
PDF <strong>Reference</strong> Manual for further details.<br />
dlpdffontcreatewithmetricsembedded<br />
This method behaves the same as dlpdffontcreatewithmetrics, but with the<br />
following exception: all fonts created with this method will be embedded (if possible),<br />
regardless of the setting of the document's embed fonts flag; if subset is TRUE the<br />
embedded font will be subset, if it is FALSE, the font will be fully embedded,<br />
regardless of the document's font embedding settings. If the requested font is not<br />
found by <strong>DLI</strong>, or the font is not embeddable due to license restrictions, an exception<br />
will be raised.<br />
By manipulating the font calls within the hellodli.c sample program, you can<br />
compare results of using font references, embedded fonts <strong>and</strong> multi-master fonts.<br />
Predefined Font Encodings<br />
Use of an ASAtomNull for a font encoding will yield a font which uses its "Built-In"<br />
encoding; this is recommended for symbol (e.g. Pi) fonts where a named encoding is<br />
not desired. <strong>DLI</strong> recognizes a number of strings that, when used to create ASAtoms<br />
<strong>and</strong> passed into <strong>DLI</strong> functions requiring a font encoding, serve to denote certain<br />
predefined encodings for a font.<br />
Setting the document encoding via dlpdfdocsetencoding does not affect the<br />
encoding used for symbol fonts, to prevent these from becoming inadvertently<br />
invalidated. Named encodings passed into the font creation calls above, however, will<br />
be reflected in symbol fonts.<br />
The strings, <strong>and</strong> the font types they are valid for, are enumerated below:
4.12 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
Table 4-1: Encoding Font Types<br />
Encoding String Value Valid Font Types<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
AdobeSt<strong>and</strong>ardEncoding Type1,TrueType<br />
WinAnsiEncoding<br />
MacRomanEncoding<br />
Type1,TrueType<br />
Type1,TrueType<br />
MacExpertEncoding Type1,TrueType<br />
Identity-H<br />
Identity-V<br />
Other Predefined CMaps<br />
CIDType0,CIDType2<br />
CIDType0,CIDType2<br />
CIDType0<br />
Adobe PDF Library v5.x <strong>and</strong><br />
higher only:<br />
WinCP1250<br />
WinCP1251<br />
WinCP1253<br />
WinCP1254<br />
WinCP1255<br />
WinCP1256<br />
WinCP1257<br />
WinCP1258<br />
MacCentralEuropean<br />
MacCentralEuropean<br />
MacCroatian<br />
MacRomanian<br />
MacCyrillic<br />
MacUkranian<br />
MacGreek<br />
MacCentralEuropean<br />
CIDType2<br />
CIDType2<br />
CIDType2<br />
CIDType2<br />
CIDType2<br />
CIDType2<br />
CIDType2<br />
CIDType2<br />
CIDType2<br />
CIDType2<br />
CIDType2<br />
CIDType2<br />
CIDType2<br />
CIDType2<br />
CIDType2<br />
CIDType2
Fonts 4.13<br />
Encoding String Value<br />
MacTurkish<br />
MacArabic<br />
MacHebrew<br />
Valid Font Types<br />
CIDType2<br />
CIDType2<br />
CIDType2<br />
Unicode Text Support<br />
Unicode text support is available for customers using Adobe PDF Library v5.x or<br />
higher. It is highly recommended that customers use CIDType2 fonts whenever<br />
possible when setting Unicode text. CIDType2 fonts may be created from most system<br />
TrueType <strong>and</strong> OpenType fonts.<br />
Code Page Support<br />
Users of Adobe PDF Library v5.x (or higher) <strong>and</strong> CIDType2 fonts are also able to<br />
access automatic translations for many Windows <strong>and</strong> Macintosh platform encodings.<br />
Text to be set in these fonts should be in a NULL-terminated string in the one-byte<br />
platform encoding the font was created with. <strong>DLI</strong> <strong>and</strong> the Adobe PDF Library will<br />
automatically translate this into a string of 2-byte GID values.<br />
Performance Considerations<br />
Creation of fonts can be resource-intensive. For users creating multiple documents,<br />
the DLPDFINSTANCE structure for a document caches most information for fonts
4.14 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
which have been created for other documents. This adds a significant speedup for<br />
creators of multiple documents over previous versions of <strong>DLI</strong>.<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
However, to obtain the best performance from <strong>DLI</strong>, users should remember the<br />
following:<br />
• Fonts created for a document have most of their characteristics, including their<br />
system fonts <strong>and</strong> translation tables, cached in the DLPDFINSTANCE used to create<br />
the document.<br />
• TrueType <strong>and</strong> Type1 fonts allow for faster processing than CIDType0 <strong>and</strong><br />
CIDType2 fonts. They should therefore be used whenever possible.
Fonts 4.15<br />
Accessing Fonts<br />
Font access for the Library is dependent on both the Adobe PDF Library version <strong>and</strong><br />
the operating system. It is explained in the Adobe PDF Library Overview manual for<br />
all systems other than OS/390.<br />
OS/390 Font Access<br />
For OS/390, the font access method is based on the UNIX method for v1 of the<br />
Library. It will attempt to locate resources via several methods, in this sequence:<br />
1 It will first look for a DD statement named ADOBERES<br />
2 If that is not found, it will look for the PDS member<br />
SYS1.PARMLIB(ADOBERES)<br />
3 If that is not found, it will look for<br />
ADOBE.PDFLIB.RESOURCE.INDEX(ADOBERES).<br />
4 CMAPS are found by looking for<br />
ADOBE.PDFLIB.RESOURCE.INDEX(ADOBECMP).<br />
The ADOBERES listing found at one of those locations is assumed to be a pointer to a<br />
listing of 1 entry: ADOBE.PDFLIB.RESOURCE.INDEX(FONTS). The content of<br />
these files is expected to be encoded using EBCDIC.<br />
The ADOBECMP listing has 1 entry: ADOBE.PDFLIB.RESOURCE.INDEX(CMAPS)<br />
This member contains a lookup table for the CMAP files.
4.16 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System
5<br />
Multibyte<br />
Text Work<br />
<strong>DLI</strong> v3.0 has undergone significant enhancements for<br />
support of Unicode <strong>and</strong> of multibyte character set<br />
encodings. This chapter discusses those enhancements,<br />
<strong>and</strong> the methods available for multibyte text work.<br />
5.1
5.2 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
Introduction<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
<strong>DLI</strong> v3.0 has undergone significant enhancements for support of Unicode <strong>and</strong> of<br />
multibyte character set encodings. With the inclusion of the International<br />
Components for Unicode (ICU), <strong>DLI</strong> is now able to properly set text in hundreds of<br />
multibyte encodings <strong>and</strong> all the common Unicode encodings. <strong>DLI</strong> is now also able to<br />
set text in scripts which flow from right to left (e.g. Arabic), supports the Unicode<br />
BiDirectional algorithm, <strong>and</strong> features character shaping <strong>and</strong> glyph combining.<br />
Unicode text composition is also significantly faster <strong>and</strong> less memory-intensive than<br />
previous <strong>DLI</strong> Unicode implementations.<br />
NOTE: The previous support for Unicode, as introduced in <strong>DLI</strong> v2.2, has been<br />
phased out <strong>and</strong> is no longer available.<br />
There are two components to this support:<br />
• Enhancements to the DLPDFFONT functionality<br />
• A new DLPDFTEXT structure<br />
To use these enhancements, fonts must be explicitly loaded into the DLPDFINSTANCE<br />
for a job; once loaded, they are available to all documents created with the<br />
DLPDFINSTANCE. The fonts are used to set text (in Unicode or multibyte encodings)<br />
into a DLPDFTEXT area. The text in the DLPDFTEXT area is stored in Unicode UCS-2<br />
format (in host-order endianness), <strong>and</strong> may be manipulated or extracted. The<br />
DLPDFTEXT is placed into a DLPDFCONTENT area, to place the text into the PDF<br />
content area. Text is written to the PDF file in UCS-2 big-endian format whenever<br />
possible. All fonts loaded are automatically subset to ensure proper output in<br />
generated PDF documents.<br />
Please see information on the <strong>DLI</strong> sample “WideText” on page 17.21 for a<br />
demonstration of how to use the new <strong>DLI</strong> font <strong>and</strong> text functions to typeset Unicode<br />
<strong>and</strong> multibyte text.
Multibyte Text Work 5.3<br />
Loading <strong>and</strong> Creating Fonts<br />
To use the enhanced <strong>DLI</strong> text functionality, fonts must first be loaded into a<br />
DLPDFINSTANCE, then created using the dlpdffontcreate calls.<br />
dlpdfttload<br />
Loading the font is done using the dlpdfttload function. This call accepts<br />
TrueType, OpenType <strong>and</strong> TrueType collection files.<br />
NOTE: Adobe CFF OpenType font files are not properly subset at this time. The<br />
sample “WideText” on page 17.21 shows the recommended usage for these fonts,<br />
using the DLPDFCONTENT multibyte text h<strong>and</strong>ling.<br />
int dlpdfttload (DLPDFINSTANCE, ASFile, ASAtom[], int)<br />
• The first argument provides a DLPDFINSTANCE into which the font is loaded; once<br />
that is done, any document using the instance may create the font.<br />
• The second argument is a font file, supplied as an ASFile for the second<br />
parameter; please see the sample “WideText” on page 17.21 for an example of<br />
creating an ASFile from a file on disk.<br />
• The third argument is an array of ASAtoms. Because a font file may contain more<br />
than one font, the caller must supply an array of ASAtoms as the third parameter.<br />
• The fourth argument is the number of array entries. The dlpdfttload function<br />
will fill the array with ASAtoms of the fonts loaded, up to the size of the ASAtom<br />
array. If the array is too small to hold all the font names, the additional fonts will<br />
still be loaded, but the names will not be returned. <strong>Datalogics</strong> recommends that this
5.4 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
array be allocated to hold a sufficient number of entries to prevent this. In practice,<br />
a dozen ASAtom entries should be sufficient.<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
The dlpdfttload function returns the number of fonts loaded from the font file.<br />
An exception may be raised for invalid parameters, if the font file could not be<br />
opened, or if there was a problem invoking the font loader.<br />
NOTE: If a given font file has already been loaded, dlpdfttload returns a -1,<br />
<strong>and</strong> does not re-parse the font file (for performance reasons).<br />
Once loaded, the font may then be created using the dlpdffontcreate calls (see<br />
“Font Creation Calls” on page 4.6). The easiest means of creating the DLPDFFONT<br />
structure is to call dlpdffontcreateembedded, supplying the DLPDFDOC in which<br />
to use the font, the name of the font loaded (use the ASAtomGetString call to<br />
obtain a C-string representation of the font name), <strong>and</strong> a NULL or "Type0" for the<br />
third parameter. The fourth parameter must be True, since it is illegal to embed<br />
Type0 fonts without subsetting.<br />
Because the DLPDFINSTANCE font cache is searched for fonts before the system is<br />
searched, a font loaded with dlpdfttload will be found before the system is<br />
examined, unless a more specific font creation call is used. If both single-byte <strong>and</strong><br />
multibyte versions of a font are required for a <strong>DLI</strong> document, use the<br />
dlpdffontcreatewithmetrics calls, specifying Type0 as the font type for<br />
multibyte fonts, <strong>and</strong> either Type1 or TrueType as appropriate for the single-byte<br />
font.<br />
An easier alternative is to create the single-byte versions of the required fonts before<br />
loading the fonts into the DLPDFINSTANCE. However, it is recommended that you<br />
use the multibyte font for all text output if possible, to ensure optimal PDF file<br />
viewing performance <strong>and</strong> file size.
Multibyte Text Work 5.5<br />
Creating DLPDFTEXT Areas<br />
A DLPDFTEXT area is a container for multibyte <strong>and</strong> Unicode text. Text is placed into<br />
the container using the dlpdftext function (or one of the shortcut functions)<br />
described below. This text is converted into Unicode, in UTF-16 format, stored in<br />
host-endian byte order (little-endian for the Win32 <strong>and</strong> Intel/Linux platforms, bigendian<br />
elsewhere), <strong>and</strong> automatically shaped <strong>and</strong> processed through the Unicode<br />
BiDirectional (BiDi) algorithm. This text may then be placed into a DLPDFCONTENT<br />
area for output.<br />
dlpdftext<br />
The dlpdftext method is used to create a DLPDFTEXT area from a buffer of text in a<br />
given encoding.<br />
DLPDFTEXT *dlpdftext(void *, ASUns32, ASAtom)<br />
• The first parameter is passed in as a pointer to a data buffer.<br />
• The second parameter is the number of bytes in this buffer.<br />
• The third parameter is the encoding of the supplied text. An exception will be<br />
raised for invalid parameters, or if the text could not be properly converted from<br />
the input encoding to the platform-endian Unicode representation.<br />
dlpdftextshowencodingnames<br />
There are over 1200 encodings <strong>and</strong> encoding aliases that may be used as input<br />
encodings, corresponding to the format of the input text for a DLPDFTEXT area. To
5.6 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
obtain a list of these encodings, use the dlpdftextshowencodingnames function<br />
call:<br />
void dlpdftextshowencodingnames(char Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to *) the DL Pager Composition System<br />
This function call will write out a file containing a list of valid encoding names <strong>and</strong><br />
aliases to the pathname supplied as the input parameter. It will raise an exception if<br />
unable to write this file.<br />
dlpdftext Shortcut Functions<br />
For NULL-terminated Unicode text (the NULL terminator will vary from encoding to<br />
encoding), the following shortcut functions are provided, each using the encoding<br />
listed in parentheses:<br />
• DLPDFTEXT *dlpdftextfromutf8(void *) (utf-8)<br />
• DLPDFTEXT *dlpdftextfromutf16be(void *) (utf-16be)<br />
• DLPDFTEXT *dlpdftextfromutf16he(void *) (utf-16be or utf-16le, by<br />
platform)<br />
• DLPDFTEXT *dlpdftextfromutf16le(void *) (utf-16le)<br />
• DLPDFTEXT *dlpdftextfromutf32be(void *) (utf-32be)<br />
• DLPDFTEXT *dlpdftextfromutf32he(void *) (utf-32be or utf-32le, by<br />
platform)<br />
• DLPDFTEXT *dlpdftextfromutf32le(void *) (utf-32le)<br />
These shortcut functions require the input text to be NULL-terminated, but do not<br />
require a Unicode byte-order marker. An exception will be raised for invalid input, or<br />
if the input text could not be properly converted to the platform-endian Unicode<br />
representation.
Multibyte Text Work 5.7<br />
Working With DLPDFTEXT Areas<br />
Once created, a DLPDFTEXT area may not be altered. Users may wish to create a new<br />
DLPDFTEXT area containing a portion of the text in a previously created DLPDFTEXT<br />
area to fit text lines to document boundaries, or to accomplish other tasks. Users may<br />
obtain the text from a DLPDFTEXT area <strong>and</strong> use this as the basis for a new<br />
DLPDFTEXT area, using the dlpdftextstring <strong>and</strong> dlpdftextlength calls:<br />
dlpdftextstring<br />
void *dlpdftextstring(DLPDFTEXT *)<br />
This call returns the text contained in a DLPDFTEXT area, in UTF-16 format. This<br />
text is in host-endian format (little-endian for Win32 <strong>and</strong> Intel/Linux platforms, bigendian<br />
elsewhere) <strong>and</strong> does not include a Unicode byte-order marker. An exception<br />
will be raised if an invalid DLPDFTEXT area is supplied.<br />
dlpdftextlength<br />
ASUns32 dlpdftextlength(DLPDFTEXT *)<br />
This call returns the length of the text in a DLPDFTEXT area, in bytes. The buffer<br />
returned by the dlpdftextstring call will be this length. With the buffer <strong>and</strong> the<br />
length returned by these two calls, a user may make a new DLPDFTEXT area with a<br />
subset of the returned text, using the dlpdftext call <strong>and</strong> the appropriate Unicode<br />
encoding ASAtom.
5.8 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdftextadvance<br />
The most common use for making new text areas from portions of a DLPDFTEXT area<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
is to copyfit text to composed lines. The dlpdftextadvance function call is used to<br />
supply the width <strong>and</strong> height change for a string of text, <strong>and</strong> accounts for character<br />
shaping <strong>and</strong> combining, as well as horizontal reading direction. The<br />
dlpdfcontentwidetextwidth function call may be used to get a rough estimate<br />
of the width or height change for a string. The dlpdfcontentwidetextwidth call<br />
does not take character shaping or combining into account, <strong>and</strong> assumes a left-toright<br />
line data orientation. The dlpdftextadvance call looks much like the<br />
dlpdfcontentwidetextwidth calls, but with some enhancements.<br />
void dlpdftextadvance (DLPDFTEXT *, DLPDFFONT *,<br />
PDEGraphicState *,<br />
PDETextState *,<br />
ASFixed, ASFixed,<br />
dlpdftext_X,<br />
ASFixed, ASFixedPoint *)<br />
• The first argument is a DLPDFTEXT area that contains text to be set...<br />
• ...in the indicated DLPDFFONT...<br />
• ...using the supplied graphics of PDEGraphicState...<br />
• ...<strong>and</strong> text states of PDETextState.<br />
• The fifth argument describes the point size of the font;<br />
• the sixth argument describes the set width of the font;<br />
• the seventh argument, the dlpdftext_X parameter, is one of<br />
DLPDFTEXT_X_LEFT or DLPDFTEXT_X_RIGHT, used to indicate whether the<br />
starting location is the left or right end (respectively) of the text, distinguishing a<br />
left-to-right line order (e.g. English) from a right-to-left line order (e.g. Arabic);<br />
• the eighth argument indicates the angle of text (in counterclockwise degrees),<br />
supplied as an ASFixed value;<br />
• the ninth argument is a pointer to an ASFixedPoint; the X <strong>and</strong> Y position change<br />
resulting from this call is returned in ASFixed units in this ASFixedPoint.<br />
An exception will be raised for invalid parameters, or if the text advance could not be<br />
calculated.
Multibyte Text Work 5.9<br />
dlpdftexttocontent<br />
Once a line of text to be set is generated, it can be placed into a content area using the<br />
dlpdftexttocontent function call. It is similar in declaration to the<br />
dlpdftextadvance call, but note the addition of the DLPDFCONTENT area pointer<br />
as the second parameter. Also note the additional ASFixed parameters:<br />
void dlpdftexttocontent (DLPDFTEXT *, DLPDFCONTENT *,<br />
DLPDFFONT *,<br />
PDEGraphicState *,<br />
PDETextState *,<br />
ASFixed, ASFixed, ASFixed, ASFixed,<br />
dlpdftext_X, ASFixed)<br />
• The first argument is a DLPDFTEXT area that contains text to be set...<br />
• ...to be placed in the indicated DLPDFCONTENT...<br />
• ...in the indicated DLPDFFONT...<br />
• ...using the supplied graphics of PDEGraphicState...<br />
• ...<strong>and</strong> text states of PDETextState.<br />
• The sixth parameter, the first of four ASFixed parameters, denotes font point size;<br />
• the seventh parameter is set width;<br />
• the eighth parameter is the X-axis value of the starting baseline position;<br />
• the ninth parameter is the Y-axis value of the baseline position;<br />
• the tenth parameter, dlpdftext_X, is one of DLPDFTEXT_X_LEFT or<br />
DLPDFTEXT_X_RIGHT, used to indicate whether the starting location is the left or<br />
right end (respectively) of the text, distinguishing a left-to-right line order (e.g.<br />
English) from a right-to-left line order (e.g. Arabic);<br />
• the eleventh parameter indicates the angle of text (in counterclockwise degrees),<br />
supplied as an ASFixed value.
5.10 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdftextdestroy<br />
After placing the DLPDFTEXT area, or after finishing with any DLPDFTEXT area,<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
destroy the text area with the dlpdftextdestroy function call:<br />
void dlpdftextdestroy (DLPDFTEXT *)<br />
After destroying a DLPDFTEXT area, the memory for the text <strong>and</strong> other information is<br />
released, <strong>and</strong> the text area may no longer be used by an application.<br />
Performance Considerations<br />
The Unicode <strong>and</strong> multibyte functions in <strong>DLI</strong> described above represent an order of<br />
magnitude of performance improvements <strong>and</strong> run-time memory usage. In addition,<br />
<strong>Datalogics</strong> can offer some notes <strong>and</strong> tips on performance <strong>and</strong> other considerations:<br />
• Do not create separate DLPDFCONTENT areas for each DLPDFTEXT string. In<br />
general, each DLPDFCONTENT area created represents additional overhead during<br />
both creation <strong>and</strong> processing of a PDF file, increased file size, <strong>and</strong> slower rendering<br />
of a PDF page. Best performance is usually obtained by using one DLPDFCONTENT<br />
area per page, <strong>and</strong> pasting all content into this content area.<br />
• Avoid using both single-byte <strong>and</strong> multibyte versions of fonts. This results in<br />
increased creation time to subset two different fonts, as well as slower rendering<br />
<strong>and</strong> processing of PDF files.<br />
• If you are typesetting in Chinese, Japanese or Korean, <strong>and</strong> are certain that readers<br />
of a PDF file will have the appropriate Acrobat language pack installed for their<br />
reader, consider using the Adobe OpenType fonts (subtype 0 CID fonts), <strong>and</strong> not<br />
embedding or subsetting. Though you will not be able to use the functionality<br />
described in this chapter, this could prove to generate faster <strong>and</strong> smaller PDF files.<br />
See the WideText sample application included beginning with the <strong>DLI</strong> v3.0.4<br />
release for a demonstration of how to set Unicode text using these fonts.
6<br />
Working with<br />
Pages<br />
This chapter explains pages <strong>and</strong> defines the calls<br />
available at this level.<br />
6.1
6.2 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
Introduction to Page Interface<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
<strong>DLI</strong> presumes that pages will be added to the end of the document only. This is<br />
required for optimal generation of the PDF Page Tree Structures, <strong>and</strong> matches the<br />
most common modes for creating documents. If output to PDF is desired <strong>and</strong> local<br />
PostScript is not, you may use <strong>DLI</strong> to create most pages, <strong>and</strong> then add pages out of<br />
order to the document via the COS Layer interface. If local PostScript is enabled, these<br />
added pages will be placed as if they were following the last page.<br />
Page Structure<br />
A page is represented in <strong>DLI</strong> by the data structure DLPDFPAGE. These data<br />
structures, one per page, are tracked within the package <strong>and</strong> destroyed when the<br />
document is destroyed. Pointers to these structures remain valid until the document is<br />
destroyed.<br />
Page Interface Calls<br />
Calls available to the Page Interface in <strong>DLI</strong> are:<br />
dlpdfpagefindfromnumber<br />
This procedure will return the DLPDFPAGE construct for the specified page. This is<br />
provided to allow pages to be modified after creation without having to keep pointers<br />
to all of the pages in the application. If the page number specified has not yet been<br />
created, a NULL pointer will be returned. The first page is considered to be page<br />
number one.<br />
dlpdfpagecreate<br />
This procedure will create a new page in the current document. It will be positioned<br />
following all other pages in the current document. If the specified document does not
Working with Pages 6.3<br />
exist, an exception genErrBadParm will be raised. Width <strong>and</strong> Height must be<br />
specified as greater than zero, <strong>and</strong> are assumed to be in points.<br />
dlpdfpagerotate<br />
This function will cause the page to be rotated clockwise to the specified angle.<br />
Permissible rotation angles are increments of 90 degrees only. Angle values greater<br />
than 360 will be reduced by 360 degrees, then rounded to the nearest 90-degree<br />
increment.<br />
This call may be issued at any time after a page is created <strong>and</strong> will be effective in PDF<br />
<strong>and</strong> Adobe PostScript.<br />
dlpdfpagecosobj<br />
This function will return a COS object that represents the page in the Adobe PDF<br />
Library. It may be used to apply COS Layer operations to the page beyond those<br />
functions defined in the package.<br />
dlpdfpagenumber<br />
This function will return the sequence number of the specified page. This number may<br />
be used in conjunction with the PDDoc returned by dlpdfdocpddoc to acquire a<br />
PDPage for the specified page. This PDPage will permit Edit Layer functions to be<br />
applied to the page beyond those defined in this package.<br />
dlpdfpagesetid<br />
This function will add an ID Entry to the page dictionary. This is generally a page’s<br />
FOLIO.
6.4 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System
7<br />
Containers<br />
within Pages<br />
This chapter describes containers within pages <strong>and</strong><br />
provides examples of various applications.<br />
7.1
7.2 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
What are Containers?<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Container may be a misleading name. These structures “contain” text <strong>and</strong> drawing<br />
comm<strong>and</strong>s in the meaning of structure or hierarchy, but they do not have a limited<br />
geometry in the sense of edges or boundaries. They “contain” text in data processing<br />
terms, but are not visual constructs like lines <strong>and</strong> columns, <strong>and</strong> hence are not<br />
containers in the typographic sense.<br />
The best way to think of these structures is as a boundless plane. This plane may be<br />
positioned, rotated, or scaled relative to the media on which the text will eventually be<br />
imaged. There is no restriction on the order or placement of things within a container.<br />
That is, within the container you are not constrained to move from left to right, or top<br />
to bottom. Nor are you limited to the quadrant that is the range of positive values.<br />
Negative positions within the plane may be used as well as positive positions.<br />
You may use as many containers within a page as you wish, <strong>and</strong> they may be<br />
positioned in any way. There is an overhead for the use of a container, however, <strong>and</strong><br />
keeping the number small is desirable.<br />
The simplest use of containers is to create one for each page, <strong>and</strong> leave it positioned at<br />
its default location <strong>and</strong> rotation. In this case, drawing on the plane <strong>and</strong> drawing on<br />
the page are identical operations. The default configuration of a plane is<br />
• positioned with its origin at the lower left h<strong>and</strong> corner of the media<br />
• scaled 1.0 in both horizontal <strong>and</strong> vertical directions<br />
• oriented with positive values of X proceeding to the right<br />
• oriented with positive values of Y proceeding upward<br />
Often, an existing composition engine will use other positioning. For instance, if your<br />
engine assumes that (0, 0) is the upper left h<strong>and</strong> corner of the page <strong>and</strong> positive values<br />
of leading proceed down the page, then repositioning the container will allow you to<br />
use the X/Y values you have already calculated without changing them.<br />
<strong>DLI</strong> contains three calls that will permit you to modify the location, scaling or<br />
rotation of a container (<strong>and</strong> its content) relative to a page. These may be used at any<br />
time before a container is committed to a page. Other transformations (mirroring,<br />
shearing, etc.) may be accomplished by directly modifying the field AreaXform
Containers within Pages 7.3<br />
within the content structure <strong>and</strong> calling dlpdfcontentrotate to make that new<br />
transformation effective.<br />
CAUTION: The transform applied here will also apply to all contents, <strong>and</strong> many of<br />
the possible transformations may not be desirable.<br />
Simplest Container Case<br />
In the simplest case, all of the composed data contains X/Y coordinates in (points<br />
* 100), calculated from the lower left h<strong>and</strong> corner of the page:<br />
"C" Example: Simplest Container Case<br />
void WritePage (DLPDFDOC *Doc, ASFixed Width, ASFixed Depth,<br />
userdata *UserData)<br />
{<br />
DLPDFPAGE *Page = dlpdfdoccreatepage (Doc, Width, Depth);<br />
DLPDFCONTENT *Content = dlpdfcontentcreate (Doc);<br />
USERDATA *UserWork = UserData;<br />
while (UserWork)<br />
{<br />
WriteLine (UserWork, Content);<br />
UserWork = UserWork->next;<br />
}<br />
}<br />
dlpdfcontenttopage (Content, Page);<br />
Scaling<br />
This case assumes all of the above, but distances are in (points * 10) vertically<br />
<strong>and</strong> (points * 1000) horizontally. Note that all of your distances, including point<br />
sizes <strong>and</strong> font widths, must conform to this for this single simple solution:
7.4 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
"C" Example: Container with Scale<br />
void WritePage (DLPDFDOC *Doc, ASFixed Width, ASFixed Depth,<br />
userdata *UserData)<br />
{<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
DLPDFPAGE *Page = dlpdfdoccreatepage (Doc, Width, Depth);<br />
DLPDFCONTENT *Content = dlpdfcontentcreate (Doc);<br />
}<br />
dlpdfcontentscale (Content,<br />
FloatToFixed (1/ 1000),<br />
FloatToFixed (1/10));<br />
USERDATA *UserWork = UserData;<br />
while (UserWork)<br />
{<br />
WriteLine (UserWork, Content);<br />
UserWork = UserWork->next;<br />
}<br />
dlpdfcontenttopage (Content, Page);<br />
Inversion<br />
This case assumes that the data in your text is based on the upper right h<strong>and</strong> corner of<br />
the page. Scale factors remain as for the previous example. Note that in the data<br />
writing routine, all vertical positions must be inverted: e.g. something placed at 4<br />
points below the top of the page would be specified to <strong>DLI</strong> as -4.<br />
"C" Example: Container Moved to Top of Page<br />
void WritePage (DLPDFDOC *Doc, ASFixed Width, ASFixed Depth,<br />
userdata *UserData)<br />
{<br />
DLPDFPAGE *Page = dlpdfdoccreatepage (Doc, Width, Depth);<br />
DLPDFCONTENT *Content = dlpdfcontentcreate (Doc);<br />
}<br />
dlpdfcontenttranslate (Content, 0, Depth);<br />
dlpdfcontentscale (Content,<br />
FloatToFixed (1/ 1000),<br />
FloatToFixed (1/10));<br />
userdata *UserWork = UserData;<br />
while (UserWork)<br />
{<br />
WriteLine (UserWork, Content);<br />
UserWork = UserWork->next;<br />
}<br />
dlpdfcontenttopage (Content, Page);
Containers within Pages 7.5<br />
Areas<br />
If your composition engine describes lines as being members of an area <strong>and</strong> positions<br />
within that area, then you may want to create a container for each area, <strong>and</strong> distort it<br />
to match your definition of an area:<br />
"C" Example: Container within an Area<br />
void WritePage (DLPDFDOC *Doc, ASFixed Width, ASFixed Depth,<br />
areadata *AreaData)<br />
{<br />
DLPDFPAGE *Page = dlpdfdoccreatepage (Doc, Width, Depth);<br />
areadata *CurrentArea = AreaData;<br />
ASFixedMatrix Matrix;<br />
while (AreaData)<br />
{<br />
DLPDFCONTENT *Content = dlpdfcontentcreate (Doc);<br />
/* Calculate rotated lower left corner */<br />
Matrix.a = Matrix.d = fixedOne;/* Unity Matrix */<br />
Matrix.b = Matrix.c = 0;<br />
/* Translate the matrix to the lower left corner of the<br />
* area to be rotated */<br />
Matrix.h = AreaData->X;<br />
Matrix.v = Depth - AreaData->Y - AreaData->Depth;<br />
/* Rotate the matrix to the desired angle */<br />
dlpdfmatrixrotate (&Matrix, AreaData->Rotation);<br />
/* Translate the width <strong>and</strong> depth of the area to the<br />
* desired angle */<br />
Point.h = AreaData->Width;<br />
Point.v = AreaData->Depth;<br />
FixedMatrixTransform (&Point, &Matrix, &Point);<br />
/* Translate to the upper left corner of the rotated area */<br />
dlpdcontenttranslate (Content,<br />
Point.h - AreaData->Width,<br />
Point.v - AreaData->Depth);<br />
dlpdfcontentrotate (Content, AreaData->Rotation);<br />
WriteLines (AreaData->UserData, Content);<br />
dlpdfcontenttopage (Content, Page);<br />
}<br />
AreaData = AreaData->Next;
7.6 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
Collection of Areas<br />
In this example, the page content is divided into areas. Each area has a location<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
relative to the top left of the page, a width, a depth <strong>and</strong> a rotation. Each area’s<br />
contents are specified as an X/Y coordinate relative to the top left of the area. For<br />
simplicity, assume that all data is in points <strong>and</strong> is in ASFixed format:<br />
"C" Example: Multiple Containers per Page with Rotation<br />
void WritePage (DLPDFDOC *Doc, ASFixed Width, ASFixed Depth,<br />
areadata *AreaData)<br />
{<br />
DLPDFPAGE *Page = dlpdfdoccreatepage (Doc, Width, Depth);<br />
areadata *CurrentArea = AreaData;<br />
while (AreaData)<br />
{<br />
DLPDFCONTENT *Content = dlpdfcontentcreate (Doc);<br />
dlpdcontenttranslate (Content, AreaData->X,<br />
Depth - AreaData->Y);<br />
dlpdfcontentrotate (Content, AreaData->Rotation);<br />
WriteLines (AreaData->UserData, Content);<br />
dlpdfcontenttopage (Content, Page);<br />
AreaData = AreaData->Next;<br />
}
Containers within Pages 7.7<br />
For the rotation to work correctly in the preceding example, the composition engine<br />
must supply the X/Y coordinates of the area as the upper left corner viewed from the<br />
text, regardless of rotation. That is:<br />
u.l<br />
no<br />
rotation<br />
u.l<br />
90<br />
rotation<br />
u.l<br />
180<br />
rotation<br />
u.l<br />
270<br />
rotation<br />
When the area is always viewed as upright, i.e. the position of the area is always given<br />
as the highest, leftmost point on the page where that is area to be placed with no<br />
rotation, the previous example should be used instead.
7.8 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System
8<br />
Working<br />
with Content<br />
This chapter explains content <strong>and</strong> defines the calls<br />
available at this level.<br />
8.1
8.2 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
Overview of Content Interface<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
The Content Interface contains the bulk of the interface. At this level, you make<br />
marks on paper. Those marks may be on a Page or on a Forms XObject. They may be<br />
text, line drawings, or images. The marks made in a content area may also be used in<br />
a patterned color.<br />
Control Structures<br />
Control of style is maintained in the Adobe PDF Library structures<br />
PDEGraphicState <strong>and</strong> PDETextState. These structures are created <strong>and</strong><br />
modified exactly as if the Adobe PDF Library were used without <strong>DLI</strong>.<br />
When created, content structures are always associated with a given document. They<br />
may be filled with arbitrarily complex text. After filling, they are associated with a<br />
Page or with a Forms XObject. Association destroys the structure. A single content<br />
element may be associated with a Forms XObject. Any number of elements may be<br />
associated with a Page.<br />
A set of transforms may be associated with a content element to position it within the<br />
Forms XObject or Page. This permits simple definition of text in columns or areas.<br />
Layering of text is straightforward:<br />
• The first mark made is considered to be on the bottom; all following marks are<br />
above it.<br />
• When an Image or a Form is included in a page, it is above all preceding text <strong>and</strong><br />
below all following text.<br />
• When multiple content elements are contained in a page, they are layered in the<br />
order they are added to the page.<br />
A content element is represented by the structure DLPDFCONTENT. These structures<br />
are destroyed when associated with a page or form, <strong>and</strong> pointers to them should not<br />
be used after that time.
Working with Content 8.3<br />
Content Interface Calls<br />
The following sections contain information about the calls available for content<br />
elements.<br />
Creation <strong>and</strong> Positioning<br />
These calls are used to create <strong>and</strong> position a text container.<br />
Background colors, textures, <strong>and</strong> graphics may also be created for a container by the<br />
use of image <strong>and</strong> drawing comm<strong>and</strong>s, although special functions have not been<br />
supplied to accomplish these.<br />
dlpdfcontentcreate<br />
This function will create a new content element. It will be created with a rotation of<br />
zero degrees, a position of (0,0), <strong>and</strong> scaling of (1,1).<br />
dlpdfcontentrotate<br />
This procedure will rotate all of the contents of a given content structure by the<br />
specified amount. The given value may be any amount, but will be reduced to between<br />
0 <strong>and</strong> 360 degrees. It is expressed in degrees of counter-clockwise rotation about the<br />
content structure’s lower-left corner.<br />
dlpdfcontentscale<br />
This procedure will scale all of the content of a given content structure by the specified<br />
amount, which must be a positive number greater than 0.0001.
8.4 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfcontenttranslate<br />
This procedure will move all of the contents of a content structure by the specified<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
amounts, which are assumed to be in points. Positive values move up or right,<br />
depending on the axis; negative values move down <strong>and</strong> left.<br />
Text Placement<br />
These calls are used to position text within a container.<br />
dlpdfcontenttext<br />
This procedure adds a NULL-terminated string of text to the content. It will be placed<br />
such that the baseline of the left edge of the first character aligns with the given<br />
position (XPos,YPos) in points. The baseline should also proceed at the angle<br />
specified in Rotate, where zero is to the right <strong>and</strong> positive numbers produce<br />
counter-clockwise rotation in degrees. It will be set in the specified font at the<br />
specified PointSize <strong>and</strong> SetWidth. The parameters of PDEGraphicState <strong>and</strong><br />
PDETextState will be observed.<br />
dlpdfcontentwidetext<br />
Same as dlpdfcontenttext, but permits Unicode <strong>and</strong> MultiByte text.<br />
Text Width Evaluation<br />
On occasion, it is necessary to know the width of text. The following calls will<br />
accomplish that.
Working with Content 8.5<br />
dlpdfcontenttextwidth<br />
This procedure is included as an aid to composition, <strong>and</strong> to transforming widths,<br />
particularly word space widths, into PDF units. The procedure will return the width<br />
(in points) of the specified text.<br />
Its calling parameters include:<br />
• the specified Font<br />
• the text to be measured<br />
• its current SetWidth (horizontal point size)<br />
• Current Text State, a pointer to a PDETextState structure, which may be<br />
NULL. It can also be declared memset() to all 0 values, <strong>and</strong> used right away; no<br />
further initialization is required, nor is it provided for.<br />
dlpdfcontentwidetextwidth<br />
Same as dlpdfcontenttextwidth, but permits multi-byte (Unicode) text.<br />
Line Drawing<br />
These calls are used to draw lines within an area, <strong>and</strong> to fill or stroke those lines.<br />
Common to all of these calls is the PDEGraphicState, which defines line drawing<br />
parameters (Line Width, Join, Miter, etc.) <strong>and</strong> the Paint Operator, which
8.6 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
defines how the path defined should be treated (kPDEStroke, kPDEFill,<br />
kPDEEoFill, or a combination of these).<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
There are two color definitions within the PDEGraphicState:<br />
• Fill Color will be used with the operators kPDEFill or kPDEEoFill.<br />
• Stroke Color will be used with the operator kPDEStroke.<br />
All of the fields within PDEGraphicState will be honored.<br />
NOTE: Stroking will colorize to a given width, while filling will colorize within the<br />
borders. To draw lines, use stroking to give the line a width.<br />
Functions are provided here to produce commonly-used shapes. The general path<br />
operator dlpdfcontentpath can image arbitrarily complex shapes.<br />
All of the coordinate values <strong>and</strong> sizes specified below are considered to be in points.<br />
The content element in which these are placed may translate, scale or rotate the<br />
image.<br />
dlpdfcontentclip<br />
This call is used to establish a clipping path. Note that clipping paths are not<br />
established automatically for images, forms, or line drawings. Generally, PDF images<br />
page more efficiently if there is no clipping involved.<br />
A clipping region is considered a part of the content structure, <strong>and</strong> will be ended at the<br />
end of a content structure. Clipping regions may be nested, but each nested region<br />
must fit within the previous region. A clipping region can, <strong>and</strong> should, be ended as<br />
soon as possible, using the dlpdfcontentclipend call.<br />
The Path <strong>and</strong> Pathlen oper<strong>and</strong>s of this call are identical to the<br />
dlpdfcontentpath oper<strong>and</strong>s. The EOClip oper<strong>and</strong> should be FALSE for a normal<br />
clip <strong>and</strong> TRUE for an Even/Odd clip.
Working with Content 8.7<br />
dlpdfcontentclipend<br />
This call is used to manually end a clipping region prior to the end of the content<br />
structure. It should be called as soon as possible after a clipping region is established.<br />
dlpdfcontentpath<br />
This procedure will mark a path within the content. The path is specified as an array<br />
of ASFixed values, pointed to by Path, with PathLen entries in the array. This is in<br />
all ways the same path as would be used by the Adobe PDF Library path operators.<br />
Such a path may be created manually or by use of the Edit Layer of the Adobe PDF<br />
Library. If created with the Adobe PDF Library, the pointer returned by<br />
PDEPathGetData is sufficient for this call.<br />
NOTE: The length returned by that call is the number of entries in the list, not the<br />
size in bytes of the list.<br />
dlpdfcontentrect<br />
This procedure marks a rectangle in the content. It will be located such that its lower<br />
left h<strong>and</strong> corner is at (X,Y); it will be Width wide, <strong>and</strong> Height high. Width <strong>and</strong><br />
Height may not be specified as zero but may be specified as negative numbers, which<br />
results in flopping the rectangle.<br />
dlpdfcontentline<br />
This procedure will mark a line in the content. The line will extend from (X1,Y1) to<br />
(X2,Y2).<br />
dlpdfcontentarc<br />
This procedure is included as an aid in transitioning from PostScript to PDF. It will<br />
draw an arc centered at (X1, Y1), at a radius of Radius, from Angle1 to Angle2,<br />
counter-clockwise, where the angles are considered to be in degrees.
8.8 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfcontentarcn<br />
This procedure is included as an aid in transitioning from PostScript to PDF. It will<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
draw an arc centered at (X1, Y1), at a radius of Radius, from Angle1 to Angle2,<br />
clockwise, where the angles are considered to be in degrees.<br />
dlpdfcontentarcto<br />
This is a convenience method to mimic the PostScript ArcTo operator. It will locate<br />
the intersections of the line (X1,Y1)->(Xint, Yint), <strong>and</strong> (X2,Y2)->(Xint, Yint),<br />
<strong>and</strong> draw an arc of the specified radius tangent to those two lines. The line segment<br />
from (X1,Y1) to the arc will be drawn. Unlike the PostScript ArcTo operator, the<br />
segment from the tangent to (X2,Y2) will also be drawn.<br />
dlpdfcontentpieslice<br />
This procedure is included as an aid in graph construction. It will draw a pie slice,<br />
centered at (X1,Y1), at a radius of Radius, from Angle1 to Angle2, counterclockwise,<br />
where the angles are specified in degrees.<br />
dlpdfcontentpieslicen<br />
This procedure is included as an aid in graph construction. It will draw a pie slice,<br />
centered at (X1,Y1), at a radius of Radius, from Angle1 to Angle2, clockwise,<br />
where the angle is specified in degrees.<br />
dlpdfcontentcircle<br />
This procedure is included as an aid in transitioning from PostScript to PDF. It will<br />
draw a circle centered at (X1,Y1), at a radius of Radius.<br />
dlpdfcontentellipse<br />
This procedure is included as an aid in transitioning from PostScript to PDF. It will<br />
draw an ellipse centered at (X1,Y1), at a vertical radius of RadiusV <strong>and</strong> a horizontal<br />
radius of RadiusH.
Working with Content 8.9<br />
Paths<br />
Paths are created in the context of a document <strong>and</strong> represented as a structure,<br />
DLPDFPATH.<br />
dlpdfpathcreate<br />
Used to construct a path, this method accepts no parameters. It will return a pointer<br />
to DLPDFPATH or raise an exception indicating that no memory is available.<br />
dlpdfpathdestroy<br />
Used to destroy, this method accepts a pointer to a DLPDFPATH structure <strong>and</strong> will<br />
return nothing. It will raise the exception Bad Parameter if the pointer is not valid.<br />
dlpdfpathclear<br />
Used to reset a path, this method sets the current position to UNSET, the matrix to<br />
UNITY, <strong>and</strong> removes any path segment present. It will not deallocate the array used to<br />
hold the path, however, since its primary purpose is to lower the overhead associated<br />
with allocation <strong>and</strong> deallocation. It will raise the exception Bad Parameter if it is<br />
called with a NULL pointer.<br />
dlpdfpathcurrentx<br />
This method will return the current X position as an ASFixed integer.<br />
dlpdfpathcurrenty<br />
This method will return the current Y position as an ASFixed integer.<br />
dlpdfpathsize<br />
This method will return the current size of the path array (as a count of ASFixed<br />
integers) as an integer.
8.10 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfpatharray<br />
This method will return a pointer to the first member of the array of ASFixed integers,<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
which is the path.<br />
Appending Line Segments to an Existing Path<br />
The following methods append line segments to an existing path. Each of these<br />
accepts a pointer to a path as the first parameter, <strong>and</strong> may or may not have additional<br />
parameters describing the line segment to be built. These methods will return nothing,<br />
but may raise an exception if the parameters are not properly formed.<br />
dlpdfpathaddline<br />
This method accepts three parameters:<br />
• The first is a pointer to the path.<br />
• The second is the absolute Xposition.<br />
• The third is the absolute Yposition.<br />
A line will be drawn from the current position to the specified new position. If the<br />
current position is the same as the new position, no line segment will be added to the<br />
path, <strong>and</strong> no notice will be given (Optimizing). The current position following this<br />
comm<strong>and</strong> will be the specified position.<br />
dlpdfpathaddliner<br />
This methods accepts two parameters, the coordinates of the destination to draw to:<br />
• The first is the distance from the current Xposition to the specified Xposition.<br />
• The second is the distance from the current Yposition to the specified<br />
Yposition.<br />
A line will be drawn from the current position to the specified new position. If the<br />
distances specified are both zero, no line segment will be added to the path <strong>and</strong> no
Working with Content 8.11<br />
notice will be given (Optimizing). The position following this comm<strong>and</strong> will be the<br />
position derived by applying the X <strong>and</strong> Y offsets to the prior position.<br />
dlpdfpathaddmove<br />
This method accepts two parameters, the coordinates of the destination to move to:<br />
• The first is an Xposition relative to the current context.<br />
• The second is a Yposition relative to the current context.<br />
The current position will be moved to the specified position without adding a stroked<br />
line. If the current position is the same as the specified new position, no line segment<br />
will be added to the path, <strong>and</strong> no notice will be given (Optimization). The position<br />
following this comm<strong>and</strong> will be the specified position.<br />
dlpdfpathaddmover<br />
This method accepts two parameters:<br />
• The first is an Xposition relative to the current context.<br />
• The second is a Yposition relative to the current context.<br />
The current position will be moved to the specified position without adding a stroked<br />
line. If the current position is the same as the specified new position, no line segment
8.12 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
will be added to the path, <strong>and</strong> no notice will be given (Optimization). The position<br />
following this comm<strong>and</strong> will be the specified position.<br />
dlpdfpathaddarc Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
This method accepts six parameters:<br />
• The first is a pointer to the path.<br />
• The second is an Xposition of the arc center point.<br />
• The third is the Yposition of the arc center point.<br />
• The fourth is the radius of the arc.<br />
• The fifth is the start angle (where zero is directly to the right of center) where<br />
the arc is to begin.<br />
• The sixth is the end angle where the arc is to end.<br />
If the current position does not coincide with the position defined by X1, Y1, Radius<br />
<strong>and</strong> Start Angle, then a straight line segment will be added from the current<br />
position to this point. A smooth curve of the specified radius will be drawn from<br />
that specified point counter-clockwise to the point specified by X1, Y1, Radius, End<br />
Angle. The current position will be set to that ending point. If the starting <strong>and</strong> ending<br />
points specify the same angle, a full circle will be drawn. The position following this<br />
comm<strong>and</strong> will be the specified position.<br />
dlpdfpathaddarcn<br />
This method accepts six parameters:<br />
• The first is a pointer to the path.<br />
• The second is an Xposition of the arc center point.<br />
• The third is the Yposition of the arc center point.<br />
• The fourth is the radius of the arc.<br />
• The fifth is the start angle (where zero is directly to the right of center) where<br />
the arc is to begin.<br />
• The sixth is the end angle where the arc is to end.<br />
If the current position does not coincide with the position defined by X1, Y1, Radius<br />
<strong>and</strong> Start Angle, then a straight line segment will be added from the current<br />
position to this point. A smooth curve of the specified radius will be drawn from<br />
that specified point clockwise to the point specified by X1, Y1, Radius, End Angle.
Working with Content 8.13<br />
The current position will be set to that ending point. If the starting <strong>and</strong> ending points<br />
specify the same angle, a full circle will be drawn. The position following this<br />
comm<strong>and</strong> will be the specified position.<br />
dlpdfpathaddarcto<br />
This method accepts six parameters:<br />
• The first is a pointer to the path.<br />
• The second is an Xposition of the intersection of tangents.<br />
• The third is the Yposition of the intersection of tangents.<br />
• The fourth is the Xposition of a point defining the second tangent.<br />
• The fifth is the Yposition of a point defining the second tangent.<br />
• The sixth is the radius of the arc.<br />
The two lines (CurrX, CurrY)->(X1,Y1) <strong>and</strong> (X2,Y2)->(X1,Y1) are joined by an arc<br />
of radius (R). The line segment from the current position to the start of the arc is<br />
drawn, followed by the arc itself. The line segment from the end of the arc to the point<br />
X2,Y2 is not drawn. The position following this comm<strong>and</strong> will be the intersection of<br />
the arc with the line (X2,Y2)->(X1,Y1). If the two lines are colinear, a straight line<br />
segment is drawn from current position to (X1,Y1), which then becomes the current<br />
point.<br />
dlpdfpathaddelliparc<br />
This method accepts seven parameters:<br />
• The first is a pointer to the path.<br />
• The second is an Xposition of the arc center point.<br />
• The third is the Yposition of the arc center point.<br />
• The fourth is the horizontal radius (HRad) of the ellipse defining an arc segment.<br />
• The fifth is the vertical radius (VRad) of the same ellipse. The HRad <strong>and</strong> VRad<br />
functions support creating arc segments from an elliptical shape, instead of a<br />
circular shape as described in dlpdfpathaddarc. If the same horizontal <strong>and</strong>
8.14 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
vertical radii are passed to this function, it behaves identically to<br />
dlpdfpathaddarc.<br />
• The sixth is the start angle (where zero is directly to the right of center) where<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
the arc is to begin.<br />
• The seventh is the end angle where the arc is to end. If the current position does<br />
not coincide with the position defined by X1, Y1, Radius <strong>and</strong> Start Angle, then<br />
a straight line segment will be added from the current position to this point. A<br />
smooth curve of the specified radius will be drawn from that specified point<br />
counter-clockwise to the point specified by X1, Y1, Radius <strong>and</strong> End Angle. The<br />
current position will be set to that ending point.<br />
If the starting <strong>and</strong> ending points specify the same angle, a full circle will be drawn.<br />
The position following this comm<strong>and</strong> will be the specified position.<br />
dlpdfpathaddelliparcn<br />
This method accepts seven parameters:<br />
• The first is a pointer to the path.<br />
• The second is an Xposition of the arc center point.<br />
• The third is the Yposition of the arc center point.<br />
• The fourth is the horizontal radius (HRad) of the arc.<br />
• The fifth is the vertical radius (VRad) of the arc. The HRad <strong>and</strong> VRad support<br />
drawing elliptical arc segments.<br />
• The sixth is the start angle (where zero is directly to the right of center) where<br />
the arc is to begin.<br />
• The seventh is the end angle where the arc is to end. If the current position does<br />
not coincide with the position defined by X1, Y1, Radius <strong>and</strong> Start Angle, then<br />
a straight line segment will be added from the current position to this point.<br />
A smooth curve of the specified radius will be drawn from that specified point<br />
clockwise to the point specified by X1, Y1, Radius <strong>and</strong> End Angle. The current<br />
position will be set to that ending point. If the starting <strong>and</strong> ending points specify the
Working with Content 8.15<br />
same angle, a full circle will be drawn. The position following this comm<strong>and</strong> will be<br />
the specified position.<br />
dlpdfpathaddelliparcto<br />
This method accepts seven parameters:<br />
• The first is a pointer to the path.<br />
• The second is the Xposition of the intersection of tangents.<br />
• The third is the Yposition of the intersection of tangents.<br />
• The fourth is the Xposition of a point defining the second tangent.<br />
• The fifth is the Yposition of a point defining the second tangent.<br />
• The sixth is the horizontal radius (HRad) of the arc.<br />
• The seventh is the vertical radius (VRad) of the arc.<br />
The HRad <strong>and</strong> VRad support drawing elliptical arc segments. The two lines<br />
(CurrX,CurrY)->(X1,Y1) <strong>and</strong> (X2,Y2)->(X1,Y1) are joined by an arc of radius (R).<br />
The line segment from the current position to the start of the arc is drawn, followed<br />
by the arc itself. The line segment from the end of the arc to the point X2,Y2 is not<br />
drawn.<br />
The position following this comm<strong>and</strong> will be the intersection of the arc with the line<br />
(X2,Y2)->(X1,Y1). If the two lines are colinear, a straight line segment is drawn from<br />
the current position to (X1,Y1), which then becomes the current point.<br />
dlpdfpathaddcurve<br />
This method accepts seven parameters:<br />
• The first is a pointer to a path.<br />
• The second <strong>and</strong> third are the X <strong>and</strong> Y positions of a point which will be Control<br />
Point 1.<br />
• The fourth <strong>and</strong> fifth are the X <strong>and</strong> Y positions of a point which will be Control<br />
Point 2.<br />
• The sixth <strong>and</strong> seventh are the X <strong>and</strong> Y positions of a point which will be the end<br />
point of the curve.<br />
A smooth curve (a cubic Bézier) will be drawn from the current position to the end<br />
position, under direction of the two control points. The current position will be the
8.16 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
end position of the line at completion of this operation. If the end position specified is<br />
identical to the current position, no segment will be appended, <strong>and</strong> no notice will be<br />
given (Optimization).<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
dlpdfpathaddcurver<br />
This method accepts seven parameters:<br />
• The first is a pointer to a path.<br />
• The second <strong>and</strong> third are the distance from current point to the X <strong>and</strong> Y positions of<br />
a point which will be used for Control Point 1.<br />
• The fourth <strong>and</strong> fifth are the distance from current point to the X <strong>and</strong> Y positions of<br />
a point which will be Control Point 2.<br />
• The sixth <strong>and</strong> seventh are the distance from the control point to the X <strong>and</strong> Y<br />
positions of a point which will be the end point of the curve.<br />
A smooth curve (A cubic Bézier) will be drawn from the current position to the end<br />
position, under direction of the two control points. The current position will be the<br />
end position of the line at completion of this operation. If the end position specified is<br />
identical to the current position, no segment will be appended, <strong>and</strong> no notice will be<br />
given (Optimization).<br />
dlpdfpathaddcurvev<br />
This method accepts five parameters:<br />
• The first is a pointer to a path.<br />
• The second <strong>and</strong> third are the X <strong>and</strong> Y positions of a point which will be used for<br />
Control Point 2.<br />
• The fourth <strong>and</strong> fifth are the X <strong>and</strong> Y positions of the end point of the curve.<br />
A smooth curve (a cubic Bézier) will be drawn from the current position to the end<br />
position, under direction of the two control points. Control Point 1 is the current<br />
position. The current position will be the end position of the line at completion of this
Working with Content 8.17<br />
operation. If the end position specified is identical the current position, no segment<br />
will be appended, <strong>and</strong> no notice will be given (Optimization).<br />
dlpdfpathaddcurvey<br />
This method accepts five parameters:<br />
• The first is a pointer to a path.<br />
• The second <strong>and</strong> third are the X <strong>and</strong> Y positions of a point which will be used for<br />
Control Point 1.<br />
• The fourth <strong>and</strong> fifth are the X <strong>and</strong> Y positions of the end point of the curve.<br />
A smooth curve (a cubic Bézier) will be drawn from the current position to the end<br />
position, under direction of the two control points. Control Point 2 is the end<br />
position. The current position will be the end position of the line at completion of this<br />
operation. If the end position specified is identical to the current position, no segment<br />
will be appended, <strong>and</strong> no notice will be given (Optimization).<br />
dlpdfpathaddrect<br />
This method accepts five parameters:<br />
• The first is a pointer to a path.<br />
• The second <strong>and</strong> third are the X <strong>and</strong> Y positions of a point which will be one corner<br />
of the box.<br />
• The fourth will be the width of the box.<br />
• The fifth will be the depth of the box.<br />
If the specified position is not the current position, a MoveTo to the specified position<br />
will be made. A rectangle will be added to the path, starting at the specified position
8.18 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
<strong>and</strong> proceeding upward (unless the depth is negative) <strong>and</strong> to the right (unless the<br />
width is negative). The end position after this operation will be the specified position.<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
If the width <strong>and</strong> depth are both zero, no segment will be appended, but the current<br />
position will still be updated.<br />
dlpdfpathaddclose<br />
This method accepts no oper<strong>and</strong>s. It will append to the path a close path operator<br />
<strong>and</strong> leave the current position as the first specified position in the path.<br />
dlpdfpathsetmatrix<br />
This method accepts a pointer to a path <strong>and</strong> a pointer to a matrix. The specified<br />
matrix will be concatenated (i.e. applied) to the matrix of each container in which this<br />
path is drawn, affecting all on the current path. This allows the user complete <strong>and</strong><br />
flexible control of the shape drawn by the path. If the pointer to the path or the<br />
matrix is NULL, a genErrBadParm exception will be raised.<br />
dlpdfmatrixrotate<br />
This function will modify the specified matrix so as to effect counter-clockwise<br />
rotation of any marks drawn via this matrix. Angle is an angle in degrees <strong>and</strong><br />
fractions of degrees.<br />
Patterns<br />
Patterns are created in the context of a document, <strong>and</strong> represented by the structure<br />
DLPDFPATTERN. They contain a content block, whose contents become one tile of the
Working with Content 8.19<br />
pattern. The size, shape, <strong>and</strong> location of a given tile can be modified by the specified<br />
matrix.<br />
The size of the tile is set by the BBox (Bounding Box) parameter.<br />
Spacing between adjacent tiles is set by the Xstep <strong>and</strong> Ystep parameters. Tiles may<br />
overlap, be placed adjacent, or be placed with space between them.<br />
The TileType parameter may be 1, 2 or 3, corresponding to the Adobe TileType<br />
parameter (see the Portable Document Format <strong>Reference</strong> Manual).<br />
The Colored parameter, if true, indicates that the pattern contains its own color<br />
specifications which should be used in place of any fill/stroke color specification.<br />
If the Colored parameter is FALSE, it indicates that the fill/stroke specification<br />
should be used for color.<br />
dlpdfpatterncreate<br />
This creates a patterned color space, <strong>and</strong> returns a pointer to that space. The pointer<br />
may be used in dlpdfcontentusefillpattern or<br />
dlpdfcontentusestrokepattern to apply this colored pattern to all following<br />
material. All patterns will be destroyed <strong>and</strong> their h<strong>and</strong>les invalidated in the<br />
destruction of the document that contains them.<br />
dlpdfcontentusefillpattern<br />
See dlpdfpatterncreate above. Note that this call with a NULL pointer to a<br />
pattern will turn off patterned color space.<br />
dlpdfcontentusestrokepattern<br />
Similar to dlpdfcontentusefillpattern above.
8.20 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
Referencing Predefined Structures<br />
These calls permit the inclusion in content of complex pre-built structures. These<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
structures may be arbitrarily positioned, scaled <strong>and</strong> rotated when placed into the<br />
content.<br />
dlpdfcontentreferenceform<br />
This procedure places a copy of a Form into the current content. All of the markings<br />
in the Form will appear. The lower left h<strong>and</strong> corner of the Form will be positioned at<br />
(X, Y). The Form will be rotated counter-clockwise as per rotate <strong>and</strong> scaled as per<br />
ScaleX <strong>and</strong> ScaleY.<br />
dlpdfcontentreferenceimage<br />
This procedure places a copy of the referenced image into the current content. It will<br />
be placed so as to align its lower left h<strong>and</strong> corner with (X, Y), will be scaled as per<br />
ScaleX <strong>and</strong> ScaleY, <strong>and</strong> rotated as per Rotate.<br />
The Scale Factors will determine the resulting size of the image. You need to know the<br />
original image resolution <strong>and</strong> its intended size in order to determine whether a Scale<br />
Factor on either axis is required. In <strong>DLI</strong> v2.2.5 <strong>and</strong> higher, the<br />
dlpdfimagegetsize method can retrieve image sizing data for you, <strong>and</strong> dividing<br />
the intended print size by the file size for each dimension (delivered by<br />
dlpdfimagegetsize) will yield a Scale Factor ratio which<br />
dlpdfcontentreferenceimage will use to calculate the final output image size.
Working with Content 8.21<br />
The typical scaling calculation using values returned by dlpdfimagegetsize<br />
would be to divide the intended print size by the image size on each axis; e.g.<br />
dlpdfcontentreferenceimage(Content, Image,<br />
Int32ToFixed(72), Int32ToFixed(92), 0,<br />
ASFixedDiv(xPoints, Int32ToFixed(xRasters)),<br />
ASFixedDiv(yPoints, Int32ToFixed(yRasters)));<br />
An image in which each pixel of each raster line represents one PDF unit of output<br />
will return the same values for both image dimension (xRasters <strong>and</strong> yRasters)<br />
<strong>and</strong> print size (xPoints <strong>and</strong> yPoints), <strong>and</strong> thus a Scale Factor of 1 on both axes.<br />
dlpdfimagegetsize<br />
The Scale Factors specified in dlpdfcontentreferenceimage will determine the<br />
resulting size of the image. This method gives you the image information necessary to<br />
calculate those values, dividing the intended print size by the file size for each<br />
dimension. This yields a Scale Factor ratio which dlpdfcontentreferenceimage<br />
uses to calculate the final output image size.<br />
Associating Content to Page<br />
The dlpdfcontenttopage call places the content onto a page. Once made, the<br />
content is no longer accessible via the <strong>DLI</strong> Package, <strong>and</strong> the pointer to the content<br />
structure is no longer valid.<br />
dlpdfcontenttopage<br />
This procedure will make the markings placed into content a part of the specified<br />
page. Following this call, the content structure no longer exists: pointers to it are then<br />
invalid <strong>and</strong> should no longer be used.
8.22 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
Adding Comments to Content Elements<br />
dlpdfcontentcomment<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
This method will insert the specified text string, in the order provided, into the<br />
content elements. This string will always be placed on a separate line, preceded by<br />
"%" to mark it as a comment. The comment text must not contain a newline<br />
character, unless the character following that newline is a percent sign ("%"). The<br />
content element must be valid; the comment pointer must point at a valid non-NULL,<br />
non-zero-length string.
9<br />
Working<br />
with Forms<br />
This chapter explains Forms XObjects <strong>and</strong> defines the<br />
calls available.<br />
9.1
9.2 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
Overview of Forms<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Forms, in this sense, are predefined content that may be placed into a document many<br />
times. A form’s content will be included in the PDF or PostScript document only once,<br />
but it may be imaged in the document any number of times. Defining forms is a<br />
powerful means of reducing the size of a document. It also considerably reduces the<br />
time needed to create a document.<br />
Forms Structure<br />
A form is represented in <strong>DLI</strong> as a structure, DLPDFFORM. Any number of forms may<br />
be defined, on a per-document basis: if the same form is needed in multiple<br />
documents, multiple copies of it must be created.<br />
Forms are tracked within the document structure, <strong>and</strong> all forms for a document are<br />
destroyed when the document is destroyed. Pointers to forms become invalid when<br />
the document is destroyed <strong>and</strong> must not be used after that time.<br />
The content of a form may be arbitrarily complex. Forms may contain images as well<br />
as other forms.
Working with Forms 9.3<br />
Form Calls<br />
There are only a few calls which involve forms.<br />
dlpdfformcreate<br />
This function will create a new form in the document specified as Doc, with the<br />
content previously placed into the container Content.<br />
The form will be considered to be of the size specified in BBox. This is an Adobe PDF<br />
Library ASFixed Rectangle, whose contents are assumed to be in points. The<br />
Bounding Box need not be located at (0,0); however, it must have a positive Width<br />
<strong>and</strong> Depth. The content block used to create a form is destroyed in the form’s<br />
creation, <strong>and</strong> any h<strong>and</strong>les to it become invalid after that point.<br />
dlpdfcontentreferenceform<br />
<strong>Reference</strong> to a form in content is made via dlpdfcontentreferenceform.<br />
dlpdfformdestroy<br />
This destroys the named form, releasing its resources. It invalidates the form h<strong>and</strong>le.
9.4 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System
10<br />
Displaying<br />
Line Drawings<br />
Line drawings are pictures made up of lines connecting<br />
specified points. These lines may be stroked (covered in a<br />
fixed width <strong>and</strong> colored marking) or filled (the space<br />
defined by the inside of the lines is painted with a defined<br />
color or pattern). The areas defined by such a set of lines<br />
need not be contiguous.<br />
10.1.
10.2. <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
Overview<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
This chapter contains calls used to draw lines within an area, <strong>and</strong> fill or stroke those<br />
lines while producing commonly-used shapes. Common to all of these calls is the<br />
PDEGraphicState, which defines line drawing parameters (Line Width, Join,<br />
Miter, etc.) <strong>and</strong> the Paint operator, which defines how the path defined should be<br />
treated (kPDEStroke, kPDEFill, kPDEEoFill, or a combination of these).<br />
There are two color definitions within the PDEGraphicState:<br />
• Fill Color will be used with the operators kPDEFill or kPDEEoFill<br />
• Stroke Color will be used with the operator kPDEStroke.<br />
All of the fields within PDEGraphicState will be honored.<br />
NOTE: Stroking will colorize to a given width, while filling will colorize within the<br />
borders. To draw lines, use stroking to give the line a width.<br />
Functions are provided in this chapter to produce commonly-used shapes. The general<br />
path operator dlpdfcontentpath can image arbitrarily complex shapes.<br />
All of the coordinates <strong>and</strong> sizes specified below are considered to be in points. The<br />
content element in which these are placed may translate, scale, or rotate the image.
Displaying Line Drawings 10.3.<br />
Approaches to Line Drawing<br />
There are two approaches to line drawing supported by <strong>DLI</strong>. The first uses a simple<br />
interface to construct or fill <strong>and</strong> stroke a structure. The second permits the user to<br />
construct an arbitrarily complex collection of markings, <strong>and</strong> then place that collection<br />
within any number of content structures.<br />
Directly-Drawn Methods<br />
In general, the directly-drawn methods are the simplest to use, <strong>and</strong> the best choice for<br />
operations like underlining, page rules <strong>and</strong> area borders. This collection of directlydrawn<br />
structures is derived from the operators for PostScript graphics, <strong>and</strong> common<br />
usage of those operators.<br />
All of these operators have their first three parameters in common. These are:<br />
• The container in which the structure will be drawn<br />
• The current state in which all parameters are used<br />
• The Painting operator, which defines how the path defined should be treated. It<br />
must be one of the following, or a combination of these:<br />
• kPDEStroke — stroke the lines of the structures<br />
• kPDEFill — fill the areas defined by the lines<br />
• kPDEEOFill — stroke the area contained an odd number of times by the<br />
area.<br />
In the case of these structures, there can be no multiple containment, <strong>and</strong> hence<br />
EOFill <strong>and</strong> Fill will have the same results.<br />
All of the methods have additional parameters, specifying the location <strong>and</strong> size of the<br />
structure drawn. These will be different for each structure, but will always be<br />
ASFixed values.<br />
If the content area in which these structures are drawn is itself distorted (i.e. its<br />
AreaMatrix is not the unity matrix; see the discussion of containers <strong>and</strong> matrix<br />
manipulation beginning with “What are Containers?” on page 7.2), then the<br />
structures drawn will be positioned <strong>and</strong> shaped to reflect that distortion.
10.4. <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfcontentrect<br />
This will draw a rectangle. The four parameters are ASFixed values reflecting X<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
position, Y position, Width <strong>and</strong> Depth. If Width <strong>and</strong> Depth are positive<br />
numbers, the rectangle will be positioned with its lower left h<strong>and</strong> corner at the<br />
position (X,Y).<br />
dlpdfcontentline<br />
This will draw a line. There are four parameters, reflecting ASFixed values for (X,Y)<br />
start <strong>and</strong> (X,Y) end.<br />
NOTE: The Fill operator is meaningless with this structure.<br />
dlpdfcontentarc<br />
This will draw a curved line.<br />
• The first two parameters are ASFixed values reflecting the (X,Y) position of the<br />
center of the circle of which this arc is a portion.<br />
• The third parameter is the ASFixed value of the Radius of that circle.<br />
• The fourth <strong>and</strong> fifth parameters are the Start Angle <strong>and</strong> End Angle at which<br />
the arc starts <strong>and</strong> ends respectively.<br />
The arc is drawn counter-clockwise from Start Angle to End Angle. The angles<br />
are specified in degrees, with Zero degrees pointing to the right. If the start <strong>and</strong> end<br />
angles are coincident, a full circle will be drawn.<br />
dlpdfcontentarcn<br />
This is identical to the previous, except that the arc is drawn clockwise.
Displaying Line Drawings 10.5.<br />
dlpdfcontentarcto<br />
This is an implementation of the PostScript arcto comm<strong>and</strong>, included as a<br />
convenience to output drivers which currently support PostScript.<br />
• The first two parameters are the ASFixed values of the (X,Y) position of the Line<br />
Start.<br />
• The third is the ASFixed value of the Radius of the Arc Segment.<br />
• The fourth <strong>and</strong> fifth are the ASFixed values of the (X,Y) position of the<br />
Intersection.<br />
• The sixth <strong>and</strong> seventh are the ASFixed value of the (X,Y) position of the Line<br />
End.<br />
NOTE: This implementation will draw the line segment from the end of the arc to<br />
the end position, which would not be drawn in PostScript.<br />
dlpdfcontentpieslice<br />
This method was included as a convenience operator for the construction of pie<br />
charts.<br />
• The first two parameters are the ASFixed values for (X,Y) of the center of the pie<br />
the slice is taken from.<br />
• The third is the ASFixed value for the Diameter of the pie slice.<br />
• The fourth <strong>and</strong> fifth are the Start Angle <strong>and</strong> End Angle, in degrees, of the pie<br />
slice.<br />
The angles are counter-clockwise from right. The arc of the pie will be drawn counterclockwise.<br />
If the angles are coincident, a full circle will be drawn.<br />
dlpdfcontentpieslicen<br />
This is identical to dlpdfcontentpieslice above, except that the arc will be<br />
drawn clockwise from the Start Angle to the End Angle.
10.6. <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfcontentcircle<br />
This method will draw a circle whose center is the first two parameters <strong>and</strong> whose<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
radius is the third parameter.<br />
dlpdfcontentellipse<br />
This method will draw an ellipse whose center is the first two parameters, the<br />
ASFixed value of the X Radius is the third parameter, <strong>and</strong> the ASFixed value of<br />
the Y Radius is the fourth parameter.<br />
dlpdfcontentpath<br />
This method will draw an arbitrary path. The path is an array of ASFixed values,<br />
constructed according to the PDF rules for path construction. These can be found in<br />
the Adobe PDF Library API <strong>Reference</strong> Manual under PDEPathAddSegment.<br />
The path may have been constructed via PDEPath operators, or constructed<br />
manually.<br />
NOTE: If constructed via PDEPath, then PDEPathGetData must be used to<br />
obtain the array <strong>and</strong> array size used in this call.<br />
The first parameter is a pointer to an array of ASFixed; the second is a count of the<br />
number of entries in that array.<br />
Path Drawing Sample<br />
In an accompanying codesamples folder you should find a sample file entitled<br />
line drawing using draw fixed structure.txt. This sample source file<br />
will create a document with one page, containing a square whose lower left corner is<br />
one inch above the bottom <strong>and</strong> one inch right of the left edge of the page. The square<br />
will be red, edged in black. From outer edge to outer edge, the square will be 74 points<br />
wide <strong>and</strong> tall.
Displaying Line Drawings 10.7.<br />
Path Drawing Methods<br />
The directly-drawn shapes are useful for a great number of graphics, but they do not<br />
permit filling of complex arbitrary shapes without the construction of a path. For that<br />
reason, a second set of drawing operators was added. These operators simply<br />
construct <strong>and</strong> draw a path, which may be arbitrarily complex. It may also be<br />
disjointed.<br />
The DLPDFPATH structure will contain a path of any size, allocating additional<br />
memory as needed. Path construction is via methods which add segments to the<br />
existing path. These methods seek to include both the PDF <strong>and</strong> PostScript graphics<br />
operators. When completed, the path may be added to a content area. The path is not<br />
destroyed when imaged <strong>and</strong> may be reused any number of times. The DLPDFPATH<br />
structure also includes a provision for a CTM Matrix, which may be used to<br />
transform the position <strong>and</strong> appearance of the path.<br />
Within the path, a current point is maintained. This will be undefined initially, or after<br />
a dlpdfpathaddclose, <strong>and</strong> will be the end point of the segment added at all other<br />
times. Some operators require that the current point be established prior to adding a<br />
segment of that type. Others will add a straight line segment drawn from the current<br />
position to the start of the defined segment prior to a segment. This behavior mimics<br />
the drawing mechanism in PostScript.<br />
The first parameter of all of these methods, except dlpdfpathcreate <strong>and</strong><br />
dlpdfcontentdrawpath, is a pointer to a valid DLPDFPATH structure.<br />
dlpdfpathcreate<br />
This method will return a pointer to a new DLPDFPATH structure. The path’s contents<br />
will be empty, its current position will be undefined, <strong>and</strong> its matrix will be set to the<br />
unity matrix. This structure will persist until specifically deleted by the<br />
dlpdfpathdestroy method.<br />
The DLPDFPATH is not specific to a document or content structure. It may be shared<br />
across many documents <strong>and</strong> placed within any number of content structures.
10.8. <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfpathclear<br />
This method will remove all content from an existing DLPDFPATH structure <strong>and</strong><br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
restore it to the state it was in following the call to dlpdfpathcreate. It is included<br />
to lower the overhead of creating many paths.<br />
dlpdfpathdestroy<br />
This method will destroy a DLPDFPATH structure <strong>and</strong> free all resources that it used.<br />
dlpdfpathaddmove<br />
This method will change the current position of a DLPDFPATH structure without<br />
drawing a line. It may be used to establish the starting point of a path or to add a<br />
disjunction to an existing path. It accepts two operators, an X <strong>and</strong> a Y position, as<br />
ASFixed values. The current position following this method will be the specified<br />
(X,Y) position.<br />
dlpdfpathaddmover<br />
This method also sets the current position, but sets it relative to the existing current<br />
position. If there is no current position, this method will raise an exception<br />
(genErrBadParm). This method accepts two parameters, an X <strong>and</strong> a Y displacement,<br />
as ASFixed values. The current position following this method will reflect the<br />
application of the X <strong>and</strong> Y displacements.<br />
dlpdfpathaddline<br />
This method draws a line from the current position to the position specified by its two<br />
parameters, X <strong>and</strong> Y position as ASFixed values. If there is no current position<br />
established, this method will raise an exception (genErrBadParm). The current<br />
position following this method is the specified (X,Y) position.
Displaying Line Drawings 10.9.<br />
dlpdfpathaddliner<br />
This method also draws a line segment, drawn from the current position to a new<br />
position, specified by X <strong>and</strong> Y displacement as ASFixed values. If there is no current<br />
position established, this method will raise an exception (genErrBadParm). The<br />
current position following this method will reflect the application of the X <strong>and</strong> Y<br />
displacements.<br />
dlpdfpathaddarc<br />
This method will append an arc segment to the current path. The parameters specify<br />
an (X,Y) position, in ASFixed values, of the center of the arc, a Radius as an<br />
ASFixed value, <strong>and</strong> two angles in degrees as ASFixed angles.<br />
If there is a current position, a line segment will be added from the current position to<br />
the start angle of the arc. If there is no current position, a move to the start angle of<br />
the arc will be appended to the path. The arc will be drawn counter-clockwise from<br />
the start angle to the end angle. If the angles are coincident, a full circle will be drawn.<br />
The angles will be interpreted such that zero degrees is pointing right.<br />
After completion, the position of the end of the arc will be the current position.<br />
dlpdfpathaddarcn<br />
This method is identical to dlpdfpathaddarc, except that the arc will be drawn<br />
clockwise.<br />
dlpdfpathaddarcto<br />
This method will draw a straight line segment from the current position toward the X<br />
<strong>and</strong> Y coordinates specified by the first two parameters. This line will terminate at the<br />
intersection of an arc connecting this line to a second line, drawn from the first
10.10. <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
specified (X,Y) to the second (X,Y) specified by the third <strong>and</strong> fourth parameters, at a<br />
Radius specified by the fifth parameter.<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Xint1/<br />
Yint1<br />
X1/Y1<br />
Xint2/<br />
Yint2<br />
Current Position<br />
X2/Y2<br />
NOTE: The straight segment from Xint2/Yint2 -> X2/Y2 is not drawn. The<br />
current position is set to Xint2/Yint2.<br />
If there is no current position when this method is called, an exception<br />
(genErrBadParm) will be raised.<br />
dlpdfpathaddelliparc<br />
This method will append an arc segment to the current path. The parameters specify<br />
an (X,Y) position, as ASFixed values, of the center of the arc, a Horizontal<br />
Radius <strong>and</strong> Vertical Radius as ASFixed values, <strong>and</strong> two angles in degrees as<br />
ASFixed angles.<br />
The Horizontal Radius <strong>and</strong> Vertical Radius values create arc segments from<br />
an elliptical shape, instead of the circular arc segments of dlpdfpathaddarc. If the<br />
same horizontal <strong>and</strong> vertical radii are passed to this function, it behaves identically to<br />
dlpdfpathaddarc.<br />
If there is a current position, a line segment will be added from the current position to<br />
the start angle of the arc. If there is no current position, a move to the start<br />
angle of the arc will be appended to the path. The arc will be drawn counterclockwise<br />
from the start angle to the end angle. If the angles are coincident, a
Displaying Line Drawings 10.11.<br />
full circle will be drawn. The angles will be interpreted such that zero degrees is<br />
pointing right.<br />
After completion, the position of the end of the arc will be the current position.<br />
dlpdfpathaddelliparcn<br />
This method is identical to dlpdfpathaddelliparc, except that the arc will be<br />
drawn clockwise.<br />
dlpdfpathaddelliparcto<br />
This method will draw a straight line segment from the current position toward the X<br />
<strong>and</strong> Y coordinates specified. This line will terminate at the intersection of an arc<br />
connecting this line to a second line, drawn from the first specified (X,Y) to the second<br />
(X,Y) specified, at a specified Horizontal Radius <strong>and</strong> Vertical Radius.
10.12. <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfpathaddcurve<br />
This is the first of the four methods which add a spline, or cubic Bézier curve, to the<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
path.<br />
All Bézier curves consist of four points:<br />
Xctrl1/<br />
Yctrl1<br />
Xend/<br />
Yend<br />
Xstart/<br />
Ystart<br />
Xctrl2/<br />
Yctrl2<br />
This method (as well as the following three) uses current position as the starting point<br />
of the curve. If no starting point is specified, the method will raise an exception<br />
(genErrBadParm).<br />
The first two parameters of this method are the position of Control Point 1, the<br />
second two parameters are the position of Control Point 2, <strong>and</strong> the last two<br />
parameters are the position of the end point of the curve.<br />
Following this method, the current position will be the end point of the curve.<br />
dlpdfpathaddcurver<br />
This method is identical to dlpdfpathaddcurve, except that the positions are<br />
expressed as relative distances from the current point, not absolute distances from the<br />
origin.
Displaying Line Drawings 10.13.<br />
dlpdfpathaddcurvev<br />
This method is identical to dlpdfpathaddcurve, except that both the start <strong>and</strong> first<br />
control point are assumed to be the current position.<br />
Xend/<br />
Yend<br />
Xstart/<br />
Ystart<br />
Xctrl1/<br />
Yctrl1<br />
Xctrl2/<br />
Yctrl2<br />
dlpdfpathaddcurvey<br />
This method is identical to dlpdfpathaddcurve, except that the second control<br />
point is assumed to be the ending position.<br />
Xctrl1/<br />
Yctrl1<br />
Xstart/<br />
Ystart<br />
Xend/<br />
Yend<br />
Xctrl2/<br />
Yctrl2
10.14. <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfpathaddrect<br />
This method will draw a rectangle. The first two parameters specify the (X,Y) position<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
of a corner, <strong>and</strong> the next two specify the width <strong>and</strong> depth of the rectangle. A<br />
positive width will draw to the right, <strong>and</strong> a positive depth will draw upward.<br />
Current position need not be set before this method is called, <strong>and</strong> current position will<br />
be set to the specified (X,Y) position after it is used.<br />
dlpdfpathaddclose<br />
This method will append a straight line segment from the current position to the start<br />
of the first element in the path. If a current position is not set, it will have no effect.<br />
Following this method, the current position will be unset.<br />
NOTE: This does not need to be the last segment of a path. Additional, disjoint<br />
segments may be set.<br />
dlpdfcontentdrawpath<br />
This method is used to add a drawn path to content.<br />
• Its first element is the DLPDFCONTENT onto which this path is to be drawn.<br />
• Its second parameter is the DLPDFPATH structure to be drawn.<br />
• Its third parameter is a pointer to a PDEGraphicState structure. This structure<br />
contains definitions of colors to be applied, <strong>and</strong> line sizes <strong>and</strong> parameters to be used<br />
when drawing a path.
Displaying Line Drawings 10.15.<br />
• The fourth <strong>and</strong> last parameter is the Path Painting operator. This must be one<br />
of<br />
— kPDEStroke<br />
— kPDEFill<br />
— kPDEEoFill<br />
— kPDEStroke | kPDEFill<br />
— kPDEStroke | kPDEEoFill<br />
Path Drawing Sample<br />
In an accompanying codesamples folder you should find a sample file entitled<br />
drawing a rectangle <strong>and</strong> ellipse in path operators.txt. This<br />
program sample shows the use of an arbitrarily complex path while creating a<br />
rectangle with an ellipse embedded within it.<br />
Transformation Matrices<br />
A Transformation Matrix can be applied to the path as a whole when it is drawn in<br />
order to resize or reposition it. This matrix will be concatenated with the matrix of the<br />
container in which the path is drawn.<br />
Matrix Arguments<br />
The matrix consists of six ASFixed values (a, b, c, d, h <strong>and</strong> v):<br />
• Values a <strong>and</strong> b control the movement in X <strong>and</strong> Y coordinates produced by a<br />
movement in X.<br />
• Values c <strong>and</strong> d control the movement in X <strong>and</strong> Y coordinates of a movement in Y.<br />
• Values h <strong>and</strong> v are horizontal <strong>and</strong> vertical offsets to the position of the drawing<br />
(positive values are up <strong>and</strong> right).<br />
dlpdfpathsetmatrix<br />
This method will set a matrix which will be applied to the path as a whole when it is<br />
drawn. This matrix will be concatenated with the matrix of the container in which the<br />
path is drawn. The method accepts a single parameter, a pointer to an<br />
ASFixedMatrix.
10.16. <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
Matrix Translations<br />
The unity matrix ([1, 0, 0, 1, 0, 0]) causes a 1 unit movement in X to be a 1<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
unit movement in X <strong>and</strong> a zero unit movement in Y; a 1 unit movement in Y becomes<br />
a 0 unit movement in X <strong>and</strong> a 1 unit movement in Y.<br />
More precisely:<br />
RealX = X * a + Y * c + h<br />
RealY = X * b + Y * d + v<br />
Hence:<br />
• the matrix [1 0 0 -1 0 0] will invert the figure drawn<br />
• the matrix [-1 0 0 1 0 0] will mirror-image the figure<br />
• the matrix [.707 .707 -.707 .707 0 0] will rotate it 45 degrees<br />
Image Translation<br />
Translation is the simple movement of the image, <strong>and</strong> is accomplished by modifying h<br />
<strong>and</strong>/or v. These values are interpreted in the un-transformed space. For more details,<br />
please see section 4.2.2, "Common Transformations," in the Portable Document<br />
Format <strong>Reference</strong> Manual.<br />
Image Rotation<br />
A matrix may be rotated by using the method dlpdfmatrixrotate. This method<br />
accepts a pointer to a matrix, <strong>and</strong> transforms it to accomplish a rotation of the<br />
specified angle (in degrees, as an ASFixed value, counter-clockwise).<br />
Image Shearing <strong>and</strong> Scaling<br />
Shearing of an image may be accomplished by modifying b or c only. Scaling may be<br />
accomplished by modifying a <strong>and</strong>/or d only.<br />
CAUTION: Be sure to scale before rotating, if you are doing both.
Displaying Line Drawings 10.17.<br />
Graphic State <strong>and</strong> Line Drawing<br />
This is a brief discussion of the graphic state parameters. For a fuller explanation,<br />
please see section 4.3, "Graphics State," in the Portable Document Format <strong>Reference</strong><br />
Manual. The fields listed are components of the PDEGraphicState structure as<br />
defined by the Adobe PDF Library SDK.<br />
fillColorSpec<br />
This is the specification of color to be used when kPDEFill or kPDEEoFill is<br />
specified as a path, or when a structure is drawn. Refer to “Library Color<br />
Descriptions” on page 12.2 for a full discussion of setting this value.<br />
NOTE: If a pattern has been set for the container in which this figure is drawn,<br />
that pattern may be used in place of, or in addition to, this color specification.<br />
strokeColorSpec<br />
This is the specification of color to be used when kPDEStroke is specified as a path,<br />
or when a structure is drawn. Refer to “Library Color Descriptions” on page 12.2 for<br />
a full discussion of setting this value.<br />
NOTE: If a pattern has been set for the container in which this figure is drawn,<br />
that pattern may be used in place of, or in addition to, this color specification.<br />
lineWidth<br />
This is an ASFixed value in scaled units. Note that a DLPDFPATH matrix, which<br />
specifies scaling, will affect this value. This value must be set specifically when the<br />
graphic state structure is created.
10.18. <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
lineJoin<br />
• A value of zero for this parameter continues the joined lines to a point.<br />
• A value of 1 rounds Concepts over <strong>and</strong> the join Facilities: at lineWidth <strong>Guide</strong> to Radius. the DL Pager Composition System<br />
• A value of 3 butts the line ends <strong>and</strong> fills the notch with stroke color, causing it to be<br />
beveled.<br />
If the value is 0, <strong>and</strong> the extension of the line to a point exceeds the miterLimit,<br />
then the line will be beveled as with a value of 3.<br />
lineCap<br />
• A value of zero produces butt-ended lines, ending at the end point of the segment.<br />
• A value of 1 produces round-ended lines, with a diameter equal to lineWidth.<br />
• A value of 2 produces square-ended lines, extending 1/2 line width beyond their end<br />
point.<br />
miterLimit<br />
Miter is the shape of the intersection of two lines. This parameter limits the length of a<br />
miter as a function of the line thickness. It is specified as an ASFixed value <strong>and</strong> must<br />
be greater than 1. For more information, see "Miter Limit" in section 4.3.2 of the<br />
Adobe PDF <strong>Reference</strong> Manual v1.5.<br />
flatness<br />
Controls the amount of error permitted between a path’s ideal position <strong>and</strong> the actual<br />
position in which it is placed. This is an ASFixed value, between 0 <strong>and</strong> 100. A value<br />
of zero permits the device to use its own flatness value, <strong>and</strong> is usually the best choice.<br />
dash<br />
A means of producing dashed, dotted or otherwise broken lines in stroking a path.<br />
Note that a patterned color space should not be used in stroking a path (although it
Displaying Line Drawings 10.19.<br />
can be), because the result will be the intersection of the pattern <strong>and</strong> the path, rather<br />
than the pattern following the path.<br />
The dash parameter is a pointer to a PDEDash structure. In essence, this structure<br />
allows you to define a pattern of off/on changes to be used in stroking a line to achieve<br />
a wide variety of dashed <strong>and</strong> dotted lines. For more information, see "PDEDash"<br />
within the Declarations section of the Adobe Acrobat Core API <strong>Reference</strong> Manual,<br />
<strong>and</strong> "Line Dash Pattern" in section 4.3.2 of the Adobe PDF <strong>Reference</strong> Manual v1.5.
10.20. <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System
11<br />
Image<br />
Display<br />
Images are predefined collections of shapes <strong>and</strong> colors<br />
which are included into the document as a picture. They<br />
may be as simple as a single bitmap or as complex as a<br />
complete PDF page.<br />
11.1
11.2 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
Overview<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Inclusion of graphics is accomplished in two ways. The first is an image, in the sense<br />
of a PDF or PostScript Image Operator. The second is a Encapsulated PostScript (EPS)<br />
file. Note that images included as EPS will not appear in PDF pages on-screen (e.g.<br />
when displayed by Adobe Reader or Adobe Acrobat), but will appear in both<br />
PostScript pages <strong>and</strong> Adobe PDF PostScript pages. Adobe Normalizer, also available<br />
from <strong>Datalogics</strong>, can be used to distill EPS images to PDF format in order to make<br />
EPS sources visible in PDF output.<br />
The interfaces provided in <strong>DLI</strong> for images are intentionally very low-level. They<br />
presume that any graphics conversions have already been completed. Public-domain<br />
packages for the conversion of graphics from common formats (PNG, GIF, TIFF, etc.)<br />
are readily available <strong>and</strong> can create data in the form these interfaces expect.<br />
Graphic Image Structures<br />
<strong>DLI</strong> manages graphics via the structure DLPDFIMAGE. This structure is used for both<br />
image <strong>and</strong> EPS data.<br />
There are four functions to create images depending on the format (Bitmap, EPS, PDF,<br />
<strong>and</strong> a convenience function for several other graphic formats), <strong>and</strong> one function to use<br />
an image (dlpdfcontentreferenceimage).<br />
NOTE: Encapsulated PostScript (EPS) is not a valid graphic format for PDF. The EPS<br />
function available through <strong>DLI</strong> will enable you to embed the EPS image in the PDF<br />
document, but it will not be visible until the document is printed. (Adobe<br />
Normalizer, also available from <strong>Datalogics</strong>, can be used to distill EPS images to PDF<br />
format in order to make EPS sources visible in PDF output.)<br />
Image structures are created on a per-document basis. If the same image is used in<br />
multiple documents, multiple copies of that image must be created. Images are tracked<br />
within the document <strong>and</strong> all images are destroyed when the document is destroyed.
Image Display 11.3<br />
Pointers to images become invalid on document destruction <strong>and</strong> must not be used<br />
after that time.<br />
A document may contain any number of images. Each image will be included in the<br />
document only once, but may be referenced within that document many times.<br />
The image is considered to be a part of the document, <strong>and</strong> may not be used in any<br />
document other than the one in which it was created. Images need not be directly<br />
destroyed, since they will be destroyed automatically when the document that<br />
contains them is destroyed.<br />
Images are tracked <strong>and</strong> reused via the ImageName value. The same image data with a<br />
different Image Name is considered a different image. Image data is passed into the<br />
creation routines via strings in memory. These strings may be freed after the call to<br />
create the image.<br />
<strong>Implementation</strong>s of <strong>DLI</strong> on UNIX <strong>and</strong> Windows include public-domain libraries to<br />
convert a number of common graphic forms into bitmaps usable by PDF.<br />
NOTE: The public-domain graphic-conversion libraries used on Unix <strong>and</strong> Windows<br />
are not available on OS/390 <strong>and</strong> OS/400 platforms. Consequently some image<br />
creation procedures are not available under OS/390 <strong>and</strong> OS/400.<br />
Graphic Image Forms<br />
Predefined images typically fall into one of two major varieties:<br />
• Bitmap Graphic Forms<br />
• Graphical Language Forms<br />
Bitmap Graphic Forms<br />
This is the most basic form of image. It consists of a stream of bits; indications of the<br />
number of samples per line, <strong>and</strong> the number of lines; a description of the samples<br />
(color model, sample size); <strong>and</strong> a description of ordering. It may also contain a
11.4 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
description of resolution (samples per inch horizontal <strong>and</strong>/or vertical). The stream<br />
may be compressed, in which case the compression algorithm <strong>and</strong> parameters must<br />
also be given.<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
These images may be expressed at various levels, from something as simple as “Here<br />
is a bitmap of n lines by n samples in 1-bit gray scale,” to more-complex references to<br />
st<strong>and</strong>ards for graphics encoding <strong>and</strong> compression (e.g. JPEG/JPG, TIFF, GIF, PNG,<br />
etc.). However, the Adobe PDF Library package contains no logic to transform<br />
bitmaps, so they must all be presented to the Adobe PDF Library in a common<br />
manner.<br />
This excerpt from the graphical image example shows the logic for inserting a raw<br />
bitmapped graphic into a document.<br />
"C" Example: Bitmapped Graphic via dlpdfimagecreatefrombmp<br />
/* Allocate memory to hold the image bitmap */<br />
ImageString = malloc (ImageWidth * ImageDepth);<br />
/* Open read the bitmap, <strong>and</strong> close the bitmap file */<br />
ImageFile = fopen (ImageName, "rb");<br />
fread (ImageString, 1, ImageWidth * ImageDepth, ImageFile);<br />
fclose (ImageFile);<br />
/* Get the color space DeviceGray as a COS object */<br />
GraySpace = PDEColorSpaceCreateFromName (ASAtomFromString<br />
("DeviceGray"));<br />
PDEColorSpaceGetCosObj (GraySpace, &Color);<br />
/* Create a DLPDFIMAGE object from the bitmap */<br />
Image = dlpdfimagecreatefrombmp (Doc, "Bear", ImageString,<br />
ImageDepth * ImageWidth,<br />
ImageWidth, ImageDepth,<br />
8, Color, FALSE);<br />
/* Free the image string from memory */<br />
free (ImageString);<br />
/* "Paste" the image into the container, centered over the<br />
* red box */<br />
dlpdfcontentreferenceimage (Content, Image,<br />
(fixedFour * 72) - ((Image->BBox.left + Image->BBox.right)/2),<br />
(fixedFour * 72) - ((Image->BBox.top + Image->BBox.bottom)/2),<br />
0, fixedOne, fixedOne);
Image Display 11.5<br />
Graphical Language Forms<br />
These forms of graphics are described via line drawing operators, fill <strong>and</strong> stroke<br />
parameters, <strong>and</strong> text. They may also include bitmapped graphics. These forms exist<br />
solely in the context of a st<strong>and</strong>ard language definition (e.g. PDF: Portable Document<br />
Format; CGM: Computer Graphics Metafile; WMF: Windows Metafile Format;<br />
QuickDraw drawing comm<strong>and</strong>s; etc.).<br />
Image Creation Methods<br />
With the exception of PDF, for which this package is eminently suitable, all of the<br />
graphic forms must be converted into a stream of line drawing, imaging <strong>and</strong> text<br />
drawing comm<strong>and</strong>s before being used as an image.<br />
<strong>DLI</strong> supports creating graphical images from a range of sources via the following<br />
methods:
11.6 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfimagecreatefrombmp<br />
This method creates a DLPDFIMAGE from a bitmap <strong>and</strong> user-supplied information.<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
• Its first parameter is the document of which the image is to be a part.<br />
• Its second parameter is a name to be used to identify this image.<br />
• Its third <strong>and</strong> fourth parameters are pointers to an array of bytes containing the<br />
bitmap <strong>and</strong> the length of that bitmap.<br />
• Its fifth parameter is the length of a line in samples.<br />
• Its sixth parameter is the number of lines.<br />
• Its seventh parameter is the size of a sample.<br />
• The eighth parameter is a COS Object which describes the color model used for the<br />
image.<br />
• The last parameter is a flag. When TRUE, this object will be embedded in the<br />
document each time it is used. When FALSE, it will be embedded only once.<br />
NOTE: <strong>DLI</strong> will merge inline all bitmapped images under 500 bytes. However, if<br />
the image is equal to one bitmap, then <strong>DLI</strong> will automatically set the image as an<br />
imagemask. Please see “Creating Transparent Graphics” on page 11.12<br />
This method assumes that the bitmap is ordered into samples within lines, that the<br />
first line presented is the top of the image, <strong>and</strong> that the first sample presented is the<br />
left edge of the image.<br />
Order of Values within Color Models<br />
The type of color model will determine whether the image contains one value per<br />
sample (/DeviceGray or /Indexed color models), three values per sample<br />
(/DeviceRGB), or four values per sample (/DeviceCMYK).<br />
Each value is assumed to have the number of bits specified in the sample size. For<br />
/DeviceRGB they are assumed to be ordered Red/Green/Blue; for /DeviceCMYK<br />
they are assumed to be ordered Cyan/Magenta/Yellow/Black.
Image Display 11.7<br />
Image Compression <strong>and</strong> Filtering<br />
If the document specifies compression, the bitmap will be compressed with Flate<br />
compression. If the document specifies Seven-Bit Safe mode, the bitmap will be<br />
filtered via ASCII85 to force it into a seven bit safe data format.<br />
dlpdfimagecreatefromps<br />
This method will create a EPS pass-through object in the PDF document. The EPS<br />
graphic is carried in the document, but not imaged by the document reader. Extracting<br />
the document to PostScript will include the object, <strong>and</strong> it will display in PostScript.<br />
This option is not generally used, but may be needed on occasion.<br />
This method assumes that the text of the EPS object is present as a string in memory.<br />
• The first parameter is a pointer to a document in which this object is to be created.<br />
• The second is a name to be given to this graphic.<br />
• The third <strong>and</strong> fourth are pointers to a string containing the EPS text <strong>and</strong> the length<br />
of that string.<br />
• The last parameter is a flag. If it is FALSE, this object will be inserted into the<br />
document only once. If it is TRUE, it will be inserted once for each usage.<br />
This segment of the complete graphics example inserts an EPS pass-through object,<br />
which will display a graphic in the PostScript produced from PDF, but not in the PDF<br />
document itself:
11.8 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
Inserting a EPS Image with dlpdfimagecreatefromps<br />
/* Open read the bitmap, <strong>and</strong> close the PostScript file */<br />
ImageFile = fopen ("Image.eps", "rb");<br />
fseek (ImageFile, Concepts 0, <strong>and</strong> SEEK_END); Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
ImageSize = ftell (ImageFile);<br />
fseek (ImageFile, 0, SEEK_SET);<br />
/* Allocate memory to hold the image */<br />
ImageString = malloc (ImageSize);<br />
fread (ImageString, 1, ImageSize, ImageFile);<br />
fclose (ImageFile);<br />
Image = dlpdfimagecreatefromps (Doc, "Grid", ImageString,<br />
ImageSize, FALSE);<br />
/* "Paste" the image into the container, centered over the<br />
* red box */<br />
dlpdfcontentreferenceimage (Content, Image,<br />
(fixedFour * 72) - ((Image->BBox.left + Image->BBox.right)/2),<br />
(fixedFour * 72) - ((Image->BBox.top + Image->BBox.bottom)/2),<br />
0, fixedOne, fixedOne);<br />
dlpdfimagecreatefrompdf<br />
This method will create an image from a PDF file. The image will be of a single<br />
specified page of the image document.<br />
• The first parameter is a h<strong>and</strong>le for the document in which this image is to be placed.<br />
• The second is the name of the file containing the PDF image page.<br />
• The third <strong>and</strong> fourth are ASFixed values giving the desired width <strong>and</strong> depth of the<br />
image. If either is 0, the PDF page's crop box is used to form the DLPDFIMAGE's<br />
visible region.<br />
• The fifth <strong>and</strong> sixth are ASFixed values giving the offset within the image<br />
document at which the image should be displayed, relative to the position at which<br />
the image page is set.<br />
• The last parameter is an integer which is used as a page number (starting from 1) to<br />
access the image document <strong>and</strong> to select the image page displayed.<br />
This segment of the complete <strong>DLI</strong> Graphics example inserts a PDF image into the<br />
document:
Image Display 11.9<br />
Inserting a PDF Image with dlpdfimagecreatefrompdf<br />
/* Open the file <strong>and</strong> obtain the bounding box of page 0 */<br />
{<br />
PDDoc<br />
pdDoc;<br />
PDPage<br />
pdPage;<br />
ASFixedRect<br />
BB;<br />
/* Open the document */<br />
pdDoc = PDDocOpen ("Image.pdf", NULL, NULL, TRUE);<br />
pdPage = PDDocAcquirePage (pdDoc, 0);<br />
PDPageGetBBox (pdPage, &BB);<br />
PDPageRelease (pdPage);<br />
PDDocClose (pdDoc);<br />
Image = dlpdfimagecreatefrompdf (Doc, "Image.pdf",<br />
BB.right - BB.left,<br />
BB.top - BB.bottom,BB.left,BB.bottom,1);<br />
/* "Paste" the image into the container, centered over the<br />
* red box */<br />
dlpdfcontentreferenceimage (Content, Image,<br />
(fixedFour * 72) - ((Image->BBox.left + Image->BBox.right)/2),<br />
(fixedFour * 72) - ((Image->BBox.top + Image->BBox.bottom)/2),<br />
0, fixedOne, fixedOne);<br />
}
11.10 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfimagecreatefromfile<br />
This method invokes various conversion routines to allow a user to simply specify the<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
file name <strong>and</strong> obtain a valid DLPDFIMAGE object. All conversions are done internally<br />
to <strong>DLI</strong>.<br />
NOTE: The public-domain graphic-conversion libraries used on Unix <strong>and</strong> Windows<br />
are not available on OS/390 <strong>and</strong> OS/400 platforms. Consequently some image<br />
creation procedures are not available under OS/390 <strong>and</strong> OS/400.<br />
This method accepts only 2 parameters:<br />
• a h<strong>and</strong>le to a document in which the image is to be placed<br />
• a file name which should contain the image<br />
Currently, this method will support JPEG/JPG, GIF, TIFF, PNG <strong>and</strong> PDF files on the<br />
NT <strong>and</strong> UNIX platforms, <strong>and</strong> PDF only on OS/390.<br />
From the complete <strong>DLI</strong> sample of inserting graphic images, this segment inserts a PDF<br />
image via dlpdfimagecreatefromfile:<br />
"C" Example: Inserting a PDF image with dlpdfimagecreatefromfile<br />
Image = dlpdfimagecreatefromfile (Doc, "math.pdf");<br />
/* "Paste" the image into the container, centered over the<br />
* red box */<br />
dlpdfcontentreferenceimage (Content, Image,<br />
(fixedFour * 72) - ((Image->BBox.left + Image->BBox.right)/2),<br />
(fixedFour * 72) - ((Image->BBox.top + Image->BBox.bottom)/2),<br />
0, fixedOne, fixedOne);<br />
The DLPDFIMAGE objects contains an ASFixedRect object called BBox (Bounding<br />
Box), which is set to the actual size <strong>and</strong> displacement of the image, as defined by its<br />
originator. This may be used in decisions about positioning <strong>and</strong> scaling the image.
Image Display 11.11<br />
dlpdfimageplaceascontent<br />
Some applications have difficulty parsing PDF Form XObjects within pages as well as<br />
marked content blocks. Additionally, some applications are known to misinterpret<br />
marked content blocks between different versions of the application. The default<br />
action of <strong>DLI</strong> is to create a Form XObject for each imported PDF graphic, so that it<br />
may be referenced repeatedly without inflating the size of the resulting output file.<br />
This call will flag an imported PDF graphic file to have any marked content tags<br />
removed, <strong>and</strong> to be set into the current page's content stream instead of as a form<br />
reference.<br />
NOTE: This call may increase the size of PDF files where a graphical object is<br />
referenced repeatedly, as the PDF graphic is appended to the content stream at the<br />
point of insertion.<br />
LoadGraphicList<br />
This method is available on OS/390 only. It reads a cross-reference file which maps<br />
graphics keys to their physical location. The cross-reference table is accessed by the<br />
GetGraphicFromList method <strong>and</strong>, once read, is stored in memory for the duration<br />
of the job. The cross-reference file must be created without line numbers. The OS/390<br />
distribution includes a sample cross-reference in<br />
ADOBE.PDFLIB.RESOURCE.GRPHLIST(GRPIDX):<br />
Pic1 ADOBE.PDFLIB.RESOURCE.IMAGE.PDF<br />
Pic2 ADOBE.PDFLIB.RESOURCE.DLLOGO.PDF
11.12 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
The parameter containing the graphic list file name is the DDName of the crossreference<br />
file, as in:<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
LoadGraphicList(“graphics”);<br />
with the associated JCL line:<br />
//GRAPHICS DD<br />
DSN=ADOBE.PDFLIB.RESOURCE.GRPHLIST(GRPIDX),DISP=SHR<br />
GetGraphicFromList<br />
This method is available on OS/390 only. It accepts a DLPDFDOC pointer <strong>and</strong> graphic<br />
key string, <strong>and</strong> returns the appropriate DLPDFIMAGE pointer. Multiple usage of the<br />
same graphic key within a document is tracked by <strong>DLI</strong>, resulting in only one instance<br />
of the graphic being placed in the document.<br />
NOTE: The graphic key must be passed as an ASCII string.<br />
Creating Transparent Graphics<br />
A PDF file may contain imagemasks. These are images which are used to mask, or<br />
block, the painting of areas beneath the mask, in the manner of a stencil. Imagemasks<br />
are one-bit graphics, where a value of 0 means that the pixel beneath the image is not<br />
to show through, <strong>and</strong> a value of 1 means that the pixel beneath is visible.<br />
<strong>DLI</strong> will automatically set any bitmap image created with the<br />
dlpdfimagecreatefrombmp function, having one bit per pixel <strong>and</strong> no color space<br />
(a CosNull object for the ColorSpace parameter), to be an imagemask. The mask<br />
will paint marked regions with the current fill color, <strong>and</strong> will leave unmarked regions<br />
untouched; page marks below these regions will be visible <strong>and</strong> not painted over.<br />
To change an image into a mask, simply insert the Imagemask key, with the value of<br />
TRUE as a Boolean, into the image’s dictionary. Then, remove the ColorSpace key
Image Display 11.13<br />
from the image's dictionary. (This can be accomplished through the cosImage<br />
member of the DLPDFIMAGE structure.) If the imagemask is to be placed over an<br />
image, it need not be the same size or resolution as any of the images it masks; in fact,<br />
the use of an imagemask of significantly higher resolution than the image to be<br />
masked is a useful way to simulate gradations of transparency.<br />
Transparent Graphics via Imagemasks Sample<br />
In an accompanying /codesamples folder you should find a sample file entitled<br />
creating transparent graphics using imagemasks.txt. This<br />
demonstrates how to create a mask from a suitable graphic which is approximately 11<br />
times as wide <strong>and</strong> high as the image to be masked.<br />
NOTE: The files in the /Codesamples folder are not intended to be buildable<br />
source as-is, only to be demonstrations of correct comm<strong>and</strong> syntax for different<br />
purposes.<br />
dlpdfcontentgstate<br />
This method enables a user to set a graphics state in a PDF file, for graphics<br />
operations which normally have no such state associated with them.<br />
For example, when creating an imagemask to create a green mask, an appropriate<br />
color <strong>and</strong> colorspace must be specified. Thus dlpdfcontentgstate is called to set<br />
the graphics state of the specified DLPDFCONTENT to that of the PDEGraphicState.<br />
This may be done at any point during content placement operations.
11.14 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System
12<br />
Color<br />
<strong>and</strong> its Use<br />
This chapter discusses Adobe PDF Library color<br />
descriptions, colors in images, patterned color spaces,<br />
creating <strong>and</strong> destroying color spaces, <strong>and</strong> more.<br />
12.1
12.2 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
Library Color Descriptions<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Color can be added to pages produced via <strong>DLI</strong> only with the color fields of the<br />
PDEGraphicState. There are two fields which establish color:<br />
• strokeColorSpec<br />
• fillColorSpec<br />
strokeColorSpec defines the color that applied to lines which are stroked <strong>and</strong><br />
fillColorSpec defines the color applied to areas which are filled.<br />
NOTE: Type is generally filled rather than stroked.<br />
Color Description Components<br />
The color description consists of two components:<br />
• The first is a pointer to a PDEColorSpace structure, which describes a color<br />
space. This identifies the type of color: Black <strong>and</strong> White, RGB, CMYK, etc.<br />
• The second component is an array of from one to seven ASFixed values, which<br />
describe the amount of color in each of the components of the given color model.<br />
These components are frequently called color channels. For example, the color<br />
Black can be described variously as (RGB, 0.0, 0.0, 0.0), (grayScale,<br />
0.0) or (CMYK 0.0, 0.0, 0.0, 1.0); all are different ways of saying<br />
“Black.”<br />
Patterned Colors<br />
Patterned colors, which may be used in addition to (or instead of) a solid color, are<br />
carried in a separate field within the DLPDFCONTENT structure, <strong>and</strong> are set with a<br />
specific set of calls to DLPDFCONTENT.
Color <strong>and</strong> its Use 12.3<br />
Colors in Images<br />
Color spaces may also be used separately with images if those images are bitmaps. A<br />
color model must be specified as a CosStructure when using<br />
dlpdfimagecreatefrombmp. The CosObj form of a color is obtained from the<br />
PDE form by the call PDEColorSpaceGetCosObj. Creating the PDE form is<br />
explained below.<br />
When images are created with any of the other dlpdfimagecreate-type calls, color<br />
spaces will be constructed as needed.<br />
Creating <strong>and</strong> Destroying Color Spaces<br />
For the basic colors, the color spaces used in your document will be in the form of a<br />
PDEColorSpace. This is not a document object, <strong>and</strong> therefore can be shared<br />
between documents. A COS form of that space will be created <strong>and</strong> inserted into each<br />
document where that color space is used. These color models can be created when the<br />
Adobe PDF Library is initialized, <strong>and</strong> should be destroyed before it is closed.<br />
CAUTION: If color models are not freed, a close error will result.
12.4 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
Color spaces for the basic colors (DeviceRGB, DeviceCMYK <strong>and</strong> DeviceGray) are<br />
created by a call to the Adobe PDF Library in this form:<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
"C " Example: Creating a Gray Color Space<br />
PDEColorSpace GrayModel:<br />
AsAtom GrayAtom;<br />
GrayAtom = ASAtomFromName (“DeviceGray”);<br />
GrayModel = PDEColorSpaceCreateFromName (GrayAtom);<br />
"BAL" Example: Creating A Gray Color Space<br />
In Assembler for OS/390:<br />
GrCol @DLPDFS<br />
DSECT=NO, *<br />
STRUCT=__T_PDECOLORVALUE<br />
GrName ds A“GrayScale”<br />
GrAtom dc h’0’<br />
@DLPDFC<br />
DLFUNC=AsAtomFromEBCDICName,<br />
DLPARAM=(GrName),<br />
DLRETURN=GrAtom<br />
DLPDFC<br />
DLFUNC=pdecolorspacecreatefromname,<br />
dlparam1=(GrAtom),<br />
DLRETURN=GrCol
Color <strong>and</strong> its Use 12.5<br />
Color Space Creation<br />
For Adobe PDF Library v4.0 <strong>and</strong> higher, all of the color spaces may be created by the<br />
procedure PDEColorSpaceCreate.<br />
NOTE: A COS object is a document object, <strong>and</strong> cannot be shared between<br />
documents. However, the PDEColorSpace created from a document-specific<br />
COS Object is not a document object, <strong>and</strong> may be shared.<br />
For example, to create a Calibrated Gray Scale color space, you would need the<br />
following code fragment:<br />
Creating Calgray Color Space for Adobe PDF Library v4.0 <strong>and</strong> later<br />
PDEColorSpace CIEGrey;<br />
PDEGrayCalFlt CIEGreyDesc;<br />
CIEGreyDesc.gamma = 0;<br />
CIEGreyDesc.whitePoint.x = 0.9506;<br />
CIEGreyDesc.whitePoint.y = 1.0;<br />
CIEGreyDesc.whitePoint.z = 1.0890;<br />
CIEGreyDEsc.blackPoint.x = 0.0;<br />
CIEGreyDEsc.blackPoint.y = 0.0;<br />
CIEGreyDesc.blakcPoint.z = 0.0;<br />
CIEGrey = CreateColorSpace (AsAtomFromName (“CalGray”),<br />
(PDEColorSpaceStruct *)&CIEGreyDesc);
12.6 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
Values for Color Channels<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
The values specified for the color channels vary from space to space, but the most<br />
common values range between zero <strong>and</strong> 1. Since these values are specified to the<br />
Adobe PDF Library as ASFixed values, this allows 16 bits of precision.<br />
Value Conversion <strong>and</strong> Inversion<br />
Your own system may specify color internally with a greater or lesser precision, or in<br />
inverted values. These must be converted to the Adobe PDF Library’s view of color to<br />
function correctly.<br />
Generally, you should first correct the precision, matching it to the Adobe PDF<br />
Library’s 16 bit precision, then correct the inversion (if there is one) by subtracting the<br />
number from an ASFixed one.<br />
When the precision difference is a matter of powers of two (as it often is), precision is<br />
corrected by shifting the value to match the Adobe PDF Library’s ASFixed format;<br />
e.g. if you are carrying color as a value of 0-255, shifting left 8 bits will correct<br />
precision.<br />
When the color specification is not in binary, e.g. zero to 100 or zero to 1000, try<br />
converting via floating point numbers. You may also create a subroutine to convert<br />
color values in precision <strong>and</strong> direction from the source system to the Adobe PDF<br />
Library’s system.
Color <strong>and</strong> its Use 12.7<br />
Basic Color Spaces<br />
The Device color spaces below presume to render color as an absolute value. These<br />
are the basic color spaces, <strong>and</strong> are fully supported throughout PDF <strong>and</strong> PostScript.<br />
CIE Calibrated Color Spaces<br />
Calibrated color spaces are colors with perception qualifiers. These are defined by CIE<br />
<strong>and</strong> are intended to permit a more faithful rendition of color, given a knowledge of the<br />
display device characteristics.<br />
A full discussion of the CIE models is beyond the scope of this document, but you can<br />
find a great deal of information on them in the Adobe PDF Specifications document<br />
or the PostScript Language <strong>Reference</strong>.<br />
Device Gray<br />
This space allows you to use black <strong>and</strong> white or levels of gray. It has a single channel<br />
of color data, which is viewed by the imaging engine as a value between 1 (White) <strong>and</strong><br />
zero (Black).<br />
Since the value is specified to the system as an ASFixed value, 16 bits of precision are<br />
possible. Generally, this will be rounded down to 4 decimal positions of precision<br />
when written to the PDF file.<br />
The atom used to create this color model is DeviceGray. It is assumed to be present<br />
in all levels of PDF, <strong>and</strong> does not need to be added to the resource directory as a color<br />
space name.
12.8 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
Device RGB<br />
This space allows you to use full color by encoding the color as three channels, one for<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
each of the Radiant primary colors Red, Green <strong>and</strong> Blue. Each channel has a value<br />
between zero (none of this color) <strong>and</strong> 1 (highest level of this color).<br />
The color channels are always<br />
• color[0] = RED<br />
• color[1] = GREEN<br />
• color[2] = BLUE<br />
If your internal model uses a different sequence, you must reorder the colors when<br />
setting color values.<br />
The atom used to create an RGB color space is DeviceRGB.<br />
Device CMYK<br />
This space allows you to use full color by encoding the color as 4 channels, one for<br />
each of the absorbent colors Cyan, Magenta <strong>and</strong> Yellow, <strong>and</strong> a fourth channel for<br />
Black. Each channel has a value between zero (No Absorption) <strong>and</strong> 1 (Full<br />
Absorption).<br />
The channels are arranged as<br />
• color[0] = CYAN<br />
• color[1] = MAGENTA<br />
• color[2] = YELLOW<br />
• color[3] = BLACK<br />
The atom used to create a CMYK color space is DeviceCMYK.<br />
Calibrated Gray<br />
This is a calibrated color space, intended to make use of the knowledge of the display<br />
device’s characteristics to more accurately depict levels of gray. The values for this
Color <strong>and</strong> its Use 12.9<br />
color space are identical to those of device gray (i.e. zero to 1, where zero is darkest<br />
<strong>and</strong> 1 is lightest), but for Calibrated Gray, you must also add to the color space<br />
definition the conditions under which the original colors were viewed.<br />
This color space may not be created from PDEColorSpaceCreateFromName.<br />
When created via PDEColorSpaceCreate, its atom is CalGray <strong>and</strong> the color<br />
structure must be a PDEGrayCalFlt.<br />
Calibrated RGB<br />
This is a calibrated color space, intended to make use of the knowledge of the display<br />
device’s characteristics to more accurately depict colors. The values are identical to the<br />
DeviceRGB color channels in value <strong>and</strong> sequence.<br />
This color space may not be created with PDEColorSpaceCreateFromName.<br />
When created with PDEColorSpaceCreate, its atom is CalRGB, <strong>and</strong> the color<br />
structure must be a PDERGBCalFlt.<br />
CIE Lab<br />
This is a calibrated color space intended to display color. It uses three channels (L, A,<br />
<strong>and</strong> B) in that order:<br />
• The range of the L channel is always zero to 100.<br />
• The range of the A <strong>and</strong> B channels are specified within the color space model, but<br />
must always be in the range of -128 to +127.<br />
This color space cannot be created with PDEColorSpaceCreateFromName. When<br />
created with PDEColorSpaceCreate, the atom used to specify this color space is<br />
Lab, <strong>and</strong> the color structure must be a PDELabCalFlt.
12.10 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
ICC Based<br />
This is a color model promoted by the International Color Consortium (ICC). Its<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
purpose is to encode color intent, so that this intent may be correctly realized in any<br />
medium.<br />
This color model includes a Color Profile, which specifies the number of channels in<br />
use, <strong>and</strong> the range <strong>and</strong> limits of those values. In essence, this is a calibrated color space<br />
schema, which permits grayScale, RGB, CMYK <strong>and</strong> Lab specifications within itself.<br />
This color model may not be created by PDEColorSpaceCreateFromName. When<br />
it is created by PDEColorSpaceCreate, its atom is ICCBased, <strong>and</strong> the color<br />
structure must be PDEICCBasedColorData.
Color <strong>and</strong> its Use 12.11<br />
Advanced Color Spaces<br />
The preceding color spaces all represent colors as a spectrum, from lighter to darker.<br />
The following color spaces do not do so: instead, each color is viewed as an<br />
individual.<br />
Separation<br />
This color space names a color, where the color value is a number between zero (none<br />
of this tint applied) to 1 (full tint applied).<br />
If the name specified in this space is known to the display device, then that tint will be<br />
used. If it is not known, a fallback color model will be used, <strong>and</strong> a transformation<br />
function from the tint amount to that fallback model’s color channel is provided in the<br />
model.<br />
This color space may not be created from PDEColorSpaceCreateFromName.<br />
When created by PDEColorSpaceCreate, its atom is Separation <strong>and</strong> the color<br />
structure used must be a PDESeparationColorData.<br />
DeviceN<br />
This color space is a generalization of the separation model. In it, an array of names is<br />
specified, rather than a single name. The number of color channels used by a DeviceN<br />
color is the number of names specified in the DeviceN name array. The value of each<br />
channel is from zero to 1.<br />
NOTE: The structure PDColorValue, used to set values for colors, permits only<br />
4 channels.<br />
This color space may not be created by PDEColorSpaceCreateFromName. When<br />
created by PDEColorSpaceCreate, its atom name is DeviceN, <strong>and</strong> it must use a<br />
color structure of PDEDeviceNColorData.
12.12 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
Indexed<br />
Indexed color spaces are most often used in images, but are by no means limited to<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
images.<br />
An indexed color space first selects a device color space in which it will be rendered.<br />
This must be DeviceRGB, DeviceGray, DeviceCMYK, DeviceN or ICCBased.<br />
It then supplies an array of from 1 to n entries, each entry having the value of a color<br />
in the selected model. (For DeviceGray, there would be one entry per color; for<br />
DeviceRGB, three; <strong>and</strong> so on).<br />
Color is specified as a single channel, which must be an integer between zero <strong>and</strong> n-1.<br />
This value is used as an index to the array of colors, <strong>and</strong> the selected entry is imaged<br />
in the underlying color space.<br />
This color space cannot be created with PDEColorSpaceCreateFromName. When<br />
created with PDEColorSpaceCreate, its atom is Indexed <strong>and</strong> the color structure<br />
must be a PDEIndexedColorData.<br />
Patterned<br />
A patterned color space is not really a color space at all. Rather, it is an image which<br />
will fill or stroke an area or line. It may contain colors of its own, or it may be a<br />
black-<strong>and</strong>-white image which is colored per the underlying color space.<br />
Any valid PDF marking comm<strong>and</strong>s may be used to construct the pattern image. The<br />
image itself is constructed as a rectangular space, which is overlaid on the area being<br />
filled or stroked. Specification of how far apart each tile is to be placed (horizontally<br />
<strong>and</strong> vertically) permits the appearance of non-rectangular areas.<br />
<strong>DLI</strong> contains an interface (dlpdfpatterncreate) which will accept a container<br />
<strong>and</strong> convert it into a patterned color space. This space may then be used within a<br />
container via the interface’s dlpdfcontentusefillpattern or<br />
dlpdfcontentusestrokepattern methods.
Color <strong>and</strong> its Use 12.13<br />
Building Patterned Color Spaces<br />
<strong>DLI</strong> permits patterned color spaces to be easily defined <strong>and</strong> used.<br />
A patterned color space is created by marking a container, exactly as if writing text,<br />
then converting that container into a patterned color space. It is used by instructing<br />
the container in which marks are made to use a particular patterned color space for<br />
filling or stroking.<br />
For example, to make a patterned color space like this:<br />
1 Define one tile of the angled line, by creating a content area <strong>and</strong> drawing that line<br />
in that area.<br />
2 Create a pattern of that tile with dlpdfpatterncreate.<br />
3 Set the current container fill pattern to that pattern via<br />
dlpdfcontentusefillpattern.<br />
For example, the following code fragment can be used to build patterned color spaces:
12.14 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
"C" Example: Filling An Area With A Pattern<br />
DLPDFPATTERN<br />
*Pattern;<br />
DLPDFCONTENT<br />
*PatContent, *PageCont;<br />
PDGraphicState Concepts <strong>and</strong> State; Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
ASFixedMatrix Matrix;<br />
ASFixedRect BBox;<br />
/* Initialize the graphics state */<br />
State.strokeColorSpec.space = State.fillColorSpec.space =<br />
PDEColorSpaceCreateFromName(ASAtomFromString("DeviceGray"));<br />
State.strokeColorSpec.value.color[0] =<br />
State.strokeColorSpec.value.color[0] = 0;<br />
State->GState.miterLimit = fixedTen;<br />
State->GState.flatness = fixedOne;<br />
State->GState.lineWidth = fixedTwo;<br />
/* Draw the pattern “tile” */<br />
PatContent = dlpdfcontentcreate (Doc);<br />
dlpdfcontentline (PatContent, &State, kPDEStroke,<br />
0, 0, fixedTen + fixedTwo, fixedTen + fixedTwo);<br />
BBox.left = BBox.bottom = 0;<br />
BBox.right = BBox.top = fixedTen + fixedTwo;<br />
Matrix.a = Matrix.d = fixedTwo / 3;<br />
Matrix.b = Matrix.c = Matrix.h = Matrix.v = 0;<br />
Pattern = dlpdfpatterncreate (Doc, PatContent, &BBox, &Matrix,<br />
FALSE, 1, BBox.right - fixedTwo, BBox.top - fixedTwo);<br />
/* Set this pattern as the fill pattern */<br />
dlpdfcontentusefillpattern (PageCont, Pattern);<br />
/* Draw <strong>and</strong> fill the structure */<br />
...<br />
/* Cancel the fill pattern */<br />
dlpdfcontentusefillpattern (PageCont, NULL);<br />
NOTE: A fill pattern is never destroyed. It becomes a part of the document, <strong>and</strong><br />
the space used to define the pattern will be freed automatically when the<br />
document is freed.<br />
Repeating Pattern <strong>Reference</strong>s<br />
Most often, you will want to create a repertoire of fill patterns that matches the<br />
capabilities of your existing composition engine or of the display devices you have
Color <strong>and</strong> its Use 12.15<br />
been using prior to PDF. If you do this, <strong>and</strong> save the pointers to the patterns in a<br />
findable manner, then the patterns can be used repeatedly throughout a document.<br />
Note that they are specific to a document, however, so you may not share them<br />
between documents.
12.16 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
Conversion between Models<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
On some occasions, it is useful to be able to convert color values between color<br />
spaces. This does not occur often, as most composition engines permit only a single<br />
definition of color, but you may occasionally, for example, need to collapse colors to<br />
fewer models, such as when using grayscale in place of RGB when the color selected is<br />
a gray.<br />
The folowing examples assume a gray image encoded as RGB or CMYK.<br />
Collapsing RGB to Gray<br />
If all three channels of the RGB color are the same value, then the color specified is a<br />
gray. It may be simulated in gray by using that value as the gray color value.<br />
"C" Example: Collapsing RGB to Gray<br />
if (State->fillColorSpec.space) == GlobalRGBSpace)<br />
{<br />
if ((State->fillColorSpec.value.color[1] ==<br />
State->fillColorSpec.value.color[2]) &&<br />
(State->fillColorSpec.value.color[2] ==<br />
State->fillColorSpec.value.color[3]))<br />
{<br />
State->fillColorSpec.Space = GlobalGraySpace;<br />
}<br />
}<br />
Collapsing CMYK To Gray<br />
If the first three channels of the CMYK color are the same, then the color is gray. The<br />
amount is 1 minus the sum of one of the first three channels, plus the fourth channel.<br />
If this is less than zero, then the amount is zero.
Color <strong>and</strong> its Use 12.17<br />
"C" Example: Collapsing CMYK to Gray<br />
if (State->fillColorSpec.space) == GlobalCMYKSpace)<br />
{<br />
if ((State->fillColorSpec.value.color[1] ==<br />
State->fillColorSpec.value.color[2]) &&<br />
(State->fillColorSpec.value.color[2] ==<br />
State->fillColorSpec.value.color[3]))<br />
{<br />
State->fillColorSpec.Space = GlobalGraySpace;<br />
State->fillColorSpec.value.color[0] =<br />
(fixedOne - (State->fillColorSpec.value.color[0] +<br />
State->fillColorSpec.value.color[3]));<br />
if (State->fillColorSpec.value[0] < 0)<br />
State->fillColorSpec.Value[0] = 0;<br />
}<br />
}<br />
Converting RGB to CMYK<br />
RGB <strong>and</strong> CMY are complements, so we can turn one to the other by subtracting the<br />
value from 1. However, the “K” component of CMYK (Black) is present to enhance<br />
the distribution of ink on a printer, <strong>and</strong> should be maintained correctly across such<br />
conversions.<br />
In converting RGB to CMYK, we complement each of the channels, then identify the<br />
smallest of the three values, subtract it from each channel, <strong>and</strong> use it as the value for<br />
channel 4.
12.18 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
"C" Example: Converting RGB to CMYK<br />
if (State->fillColorSpec.space) == GlobalRGBSpace)<br />
{<br />
State->fillColorSpec.space Concepts <strong>and</strong> Facilities: = <strong>Guide</strong> GlobalCMYKSpace;<br />
to the DL Pager Composition System<br />
State->fillColorSpec.value.color[3] = fixedOne;<br />
for (i = 0; i < 3; i++)<br />
{<br />
State=>fillColorSpec.value.color[i] =<br />
fixedOne - State->fillColorSpec.value.color[i];<br />
if (State->fillColorSpec.value.color[i] <<br />
State->fillColorSpec.value.color[3])<br />
{<br />
State->fillColorSpec.value.color[3] =<br />
State->fillColorSpec.value.color[i];<br />
}<br />
}<br />
for (i = 0; i < 3; i++)<br />
State->fillColorSpec.value.color[i] -=<br />
State->fillColorSpec.value.color[3];<br />
}<br />
Converting CMYK to RGB<br />
Very similar to conversion of RGB to CMYK, of course.<br />
"C" Example: Converting CMYK to RGB<br />
if (State->fillColorSpec.space) == GlobalCMYKSpace)<br />
{<br />
State->fillColorSpec.space = GlobalRGBSpace;<br />
for (i = 0; i < 3; i++)<br />
State->fillColorSpec.value.color[i] +=<br />
State->fillColorSpec.value.color[3];<br />
for (i = 0; i < 3; i++)<br />
{<br />
State=>fillColorSpec.value.color[i] =<br />
fixedOne - State->fillColorSpec.value.color[i];<br />
if (State->fillColorSpec.value.color[i] < 0)<br />
State->fillColorSpec.value.color[i] = 0;<br />
}<br />
}
13<br />
Annotations<br />
<strong>and</strong> Links<br />
Annotations are structures within the PDF document, as<br />
children or subordinate structures to a page, which<br />
permit special actions to be initiated by the user. <strong>DLI</strong><br />
supports the creation of text annotations <strong>and</strong> link<br />
annotations within the document.<br />
13.1
13.2 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
Overview<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Pages may contain text annotations, which are notes appended to the document, <strong>and</strong><br />
link annotations, which indicate that an area of the page (always a rectangular area)<br />
connects to another area of this or another document. Links to external documents<br />
must be supported externally to this package.<br />
The methods used for creation of annotations return the CosObj which is the<br />
annotation. This object need not be picked up by the application, <strong>and</strong> does not need<br />
to be deallocated by the application.<br />
Modifying for Other Actions<br />
The objects may be modified, either immediately after creation or at any time prior to<br />
writing the document, to permit access to functionalities beyond those described in<br />
these method interfaces. There are fourteen or more different annotation types, <strong>and</strong><br />
not all are represented by <strong>DLI</strong> methods, so in some circumstances you will need to<br />
create an object as one type, but then modify it to be another.<br />
Therefore, if you plan to change the annotations to perform other actions, you must<br />
make your changes before the document is released from the resources. See following<br />
sections of this chapter for further details.<br />
Annotation Components<br />
All annotations consist of two parts: a hot spot, which is defined as a rectangular area<br />
of the page, <strong>and</strong> an action.<br />
Hot Spots<br />
The hot spot can be defined as an ASFixedRectangle, or as a reference to a name<br />
contained in a special Name Tree within the document.
Annotations <strong>and</strong> Links 13.3<br />
Actions<br />
Actions can be specified in a number of ways, depending on the complexity of the<br />
action.<br />
<strong>DLI</strong> directly supports the most basic forms of annotations, <strong>and</strong> returns the created<br />
CosObj for all annotations, so that your application can easily construct more<br />
complex forms by modifying the basic forms provided here.<br />
Borders<br />
Borders may be placed around an annotation hot spot to highlight it to the user. Prior<br />
to version v4.0, the Adobe PDF Library allowed a definition of a border as an array<br />
of three ASFixed values:<br />
• Horizontal Corner Radius<br />
• Overcall Corner Radius<br />
• Border Width<br />
When Border Width is zero, the border is not drawn.<br />
<strong>DLI</strong> directly supports this definition only. In the following methods, a reference to<br />
borders is presumably to a NULL pointer, in which case the border is omitted, or a<br />
pointer to an array of three ASFixed values, interpreted as above.<br />
Annotation <strong>and</strong> Link Colors<br />
Color has a different meaning for each type of annotation:<br />
• For text annotations, it is the color to be used for the background of the closed<br />
annotation.<br />
• For links, it is the border color.<br />
Prior to v4.0 of the Adobe PDF Library, colors could be specified only as an array of<br />
three ASFixed values, representing an RGB color. When used below, color means a<br />
pointer to such an array, or NULL. If NULL, then the viewer will select a color.
13.4 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfpageaddtextannotation<br />
The simplest annotation in PDF is a text annotation. This appears as a “sticky note”<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
in Adobe Acrobat or Adobe Reader <strong>and</strong> can be opened to display a text message.<br />
• The first parameter is a pointer to the page which will contain this annotation.<br />
• The second parameter is a pointer to an ASFixedRectangle whose upper left<br />
corner will be the upper left corner of the closed annotation.<br />
• The third is a pointer to a border specification.<br />
• The fourth is a pointer to a color specification.<br />
• The fifth is a pointer to a string, which will be used as a title of the opened<br />
annotation. This may be a NULL pointer.<br />
• The sixth parameter is a pointer to a string which is the content of this annotation.<br />
If this is a NULL pointer, the method will raise an exception (genErrBadParm).<br />
• Finally, the seventh parameter is a flag. If TRUE, then this annotation will be open<br />
when first displayed. If FALSE, it will be closed.<br />
From the full example of creating annotations:<br />
"C" Example: Creating Text Annotations<br />
DLPDFDOC *Doc;<br />
DLPDFPAGE *Page1, *Page2;<br />
ASFixedRect NoteRect;<br />
ASFixed Border[3], Color[3];<br />
dlpdfpageaddtextannotation (Page1, &NoteRect, Border,<br />
Color, "Page 1 Note",<br />
"This is a closed note placed on page one", FALSE);<br />
dlpdfpageaddtextannotation (Page2, &NoteRect, Border,<br />
Color, "Page 2 Note",<br />
"This is an open note placed on page Two", TRUE);<br />
dlpdfpageaddlinkannotation<br />
This is the most frequently used annotation. It links an area of the page which<br />
contains this annotation to a separate area on that or another page. The viewer uses
Annotations <strong>and</strong> Links 13.5<br />
these links, when selected, to modify the view of the document to display the<br />
destination area.<br />
This method assumes that the destination will be specified as a page number, an<br />
ASFixedRectangle describing a portion of that destination page, <strong>and</strong> a<br />
FitDescription, saying how the portion of the page should be displayed.<br />
• The first 4 parameters of this method are identical to the text annotation above,<br />
except that the ASFixedRectangle is used for both location <strong>and</strong> size, <strong>and</strong> defines<br />
the hot spot where the user might select this link.<br />
• The fifth parameter is the page number of the destination page. The first page is<br />
considered to be page 0. The page referenced need not have been created yet.<br />
• The sixth parameter is the FitType. This is a text string which is one of the set of<br />
“XYZ”, “Fit”, “FitH’, “FitV”, “FitR”, “FitB”, “FitBH”, or “FitBV”. The<br />
meanings of these various types can be seen in the Adobe PDF Library <strong>Reference</strong><br />
<strong>Guide</strong>, or the PDF Specification, section 7.3.1.<br />
• The seventh parameter defines a rectangle which will be fitted according to the<br />
sixth parameter. In general, this should describe the extent of the text that you want<br />
the user to see when selecting this link. The values actually used will vary with the<br />
FitType specified.<br />
• The eighth parameter is a zoom amount, used only with fit type “XYZ”. It is an<br />
ASFixed value, where 1.0 is no zoom, 2.0 is double size, <strong>and</strong> 0.5 is 1/2 size. If<br />
you want the view to remain unchanged, set this value to PDViewDestNull.
13.6 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
From the full example of creating annotations:<br />
"C" Example: Creating Concepts A Link <strong>and</strong> Annotation Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
DLPDFPAGE *Page1<br />
ASFixedRect BBLink1, PageRect;<br />
ASFixed Border[3], Color[3];<br />
/* Set up the border <strong>and</strong> color arrays */<br />
Border[0] = Border[1] = 0; /* This is a square box */<br />
Border[2] = fixedTwo; /* Two points in thickness */<br />
Color[0] = Color[2] = 0; /* Its color will be blue */<br />
Color[1] = fixedOne;<br />
dlpdfpageaddlinkannotation (Page1, &BBLink1, Border,<br />
Color, 1, "Fit", &PageRect, PDViewDestNULL);<br />
dlpdfpageaddlinkannotationfromname<br />
An optional structure within the PDF document is a name tree. This consists of an<br />
ordered collection of strings (names) <strong>and</strong> a value for each name, which is an array in<br />
the form defined in the PDF Specification, section 7.3.1. The named destination itself<br />
is described in sections 7.3.2 <strong>and</strong> 6.9.<br />
In the Adobe PDF Library, only the DEST name tree may be defined, <strong>and</strong> within <strong>DLI</strong>,<br />
there is direct support only for the name tree. Names may be added to the name tree<br />
via dlpdfdocnameadd.<br />
Names vs. Destinations<br />
A link may be accomplished using a name, rather than a specific destination. When<br />
cross-document links are to be used, referring to a name permits a more flexible<br />
linkage: if the document referred to is modified, you need not recompose the referring<br />
documents.<br />
In practice, this means that you would need to create a name tree which names all of<br />
the possible interesting sites for a link, <strong>and</strong> publish the names of those sites to<br />
potential linking documents. These names should be derived directly from the text, to
Annotations <strong>and</strong> Links 13.7<br />
identify them by their relevance to the context, rather than their position within the<br />
document.<br />
For example, you might create a name of "Maintaining Backup Files," rather than<br />
"Chapter 2," using the text of the title rather than its sequential position, so you can<br />
preserve the link even if the document chapters are later reorganized.<br />
This method is intended to permit linkages by names within a document. Making a<br />
link between documents is fairly straightforward:<br />
• The first 4 parameters are the same as the previous two methods.<br />
• The fifth parameter is a string giving the name of the destination.<br />
From the full example of adding annotations:<br />
"C" Example: Creating A Link To A Named Destination<br />
DLPDFPAGE *Page2<br />
ASFixedRect BBLink2;<br />
ASFixed Border[3], Color[3];<br />
Border[0] = fixedFive; /* A box with elliptical corners */<br />
Border[1] = fixedTen; /* longer horizontal than vert. */<br />
Border[2] = fixedTwo; /* Two points in thickness */<br />
Color[0] = Color[2] = 0; /* Its color will be black */<br />
Color[1] = 0;<br />
dlpdfpageaddlinkannotationfromname (Page2, &BBLink2,<br />
Border, Color, "Link1");<br />
dlpdfpageaddwebannotation<br />
This procedure supports adding a link structure which is identical in appearance to a<br />
link annotation, but which references a URI (Uniform Resource Indicator, equivalent<br />
to a URL) passed as the last character string. This method is used to place hyperlinks<br />
to external documents, on the World Wide Web for example, within a PDF document.<br />
NOTE: You should have your internet browser running before calling this<br />
procedure or you may receive a “browser is busy” error. Your browser can be<br />
specified in Acrobat via File->Preferences->Weblink.
13.8 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfdocnameadd<br />
This method allows the user to add one destination to the name tree structure, the<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
optional ordered list of names <strong>and</strong> destinations.<br />
The method accepts four parameters:<br />
• The first is a h<strong>and</strong>le for the document in which the name is to reside.<br />
• The second is a string representing the tree name (can be NULL).<br />
• The third is a string containing the destination name.<br />
• The fourth is a COS structure, which must be an array with contents as described in<br />
the PDF Specification, section 7.3.1.<br />
"C" Example: Creating A Named Destination<br />
/* Create a Destination structure to fit a given rectangle to<br />
* the viewer window */<br />
Dest = CosNewarray (Doc, TRUE, 6);<br />
CosArrayPut (Dest, 0, Page); /* The current page */<br />
CosArrayPut (Dest, 1, CosNewName (Doc, FALSE,<br />
ASAtomFromString (“FitR”)));<br />
CosArrayPut (Dest, 2, CosNewFixed (Doc, FALSE, Left));<br />
CosArrayPut (Dest, 3, CosNewFixed (Doc, FALSE, Bottom));<br />
CosArrayPut (Dest, 4, CosNewFixed (Doc, FALSE, Right));<br />
CosArrayPut (Dest, 5, CosNewFixed (Doc, FALSE, Top));<br />
dlpdfdocnameadd (Doc, "Name Tree", "Destination Name",<br />
Dest);<br />
dlpdfdocnamefind<br />
This method will return the Cos structure associated with a destination name. If that<br />
name does not exist, a CosNull structure will be returned.<br />
The method accepts two parameters:<br />
• a document h<strong>and</strong>le<br />
• a string containing the desired name
Annotations <strong>and</strong> Links 13.9<br />
Modifying the Link Cos Object<br />
Each of the three methods which create an annotation return a CosObj. This<br />
structure is the annotation dictionary, <strong>and</strong> may be modified freely. In practice, it is the<br />
link annotation that will most often be modified.<br />
As created by <strong>DLI</strong>, the link annotation dictionary will contain the following key/value<br />
pairs:<br />
• Type Annot<br />
• SubType Link<br />
• Rect [x, y, x+wide, y+depth]<br />
• Border [v1, v2, v3] (if Border is not NULL)<br />
• Color [r, g, b] (if Color is not NULL)<br />
• Dest [...], where the destination is described in the array<br />
This will create a link whose action is defaulted to “GoTo.”<br />
Although "GoTo" is the normal state for a link within a document, there are 13<br />
possible actions for selecting a link permitted in PDF Specification 1.2, <strong>and</strong> a<br />
fourteenth added in PDF Specification 1.3. More may be added in the future.<br />
In order to modify this link to use one of the other actions, you must replace the Dest<br />
couplet with an A key <strong>and</strong> an action dictionary:<br />
1 The Dest couplet is removed, using<br />
CosDictRemove(Dict, ASAtomFromString (“Dest”));.<br />
2 The action dictionary is created, always as a new, indirect, dictionary structure. It<br />
has a Type of Action, a SubType of the action desired (See PDF Specification,<br />
section 6.8), <strong>and</strong> additional parameters depending on the action selected.<br />
The following is extracted from the full example of creating annotations:
13.10 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
"C" Example: Modifying a Goto Link into a GotoR Link<br />
/* Create a link to another document */<br />
local_inserttext (Doc, Content1, &gState,<br />
"Link Concepts to Line <strong>and</strong> Drawing Facilities: Sample", <strong>Guide</strong> to fixedFour the DL Pager * 72, Composition System<br />
fixedEight * 72, &BBLink3);<br />
CosLink3 = dlpdfpageaddlinkannotation (Page1, &BBLink3,<br />
Border, Color, 0, "XYZ", &BBLink3, PDViewDestNULL);<br />
CosDictRemove (CosLink3, ASAtomFromString ("Dest"));<br />
Action = CosNewDict (Doc->cosDoc, TRUE, 3);<br />
CosDictPut (CosLink3, ASAtomFromString ("A"), Action);<br />
CosDictPut (Action, ASAtomFromString ("Type"),<br />
CosNewName (Doc->cosDoc, FALSE,<br />
ASAtomFromString ("Action")));<br />
CosDictPut (Action, ASAtomFromString ("S"),<br />
CosNewName (Doc->cosDoc, FALSE,<br />
ASAtomFromString ("GoToR")));<br />
Dest = CosNewArray (Doc->cosDoc, FALSE, 2);<br />
CosArrayPut (Dest, 0, CosNewInteger (Doc->cosDoc,<br />
FALSE, 0));<br />
CosArrayPut (Dest, 1, CosNewName (Doc->cosDoc, FALSE,<br />
ASAtomFromString ("Fit")));<br />
CosDictPut (Action, ASAtomFromString ("D"),Dest);<br />
CosDictPut (Action, ASAtomFromString ("F"),<br />
CosNewString (Doc->cosDoc, FALSE,<br />
"ExampleDraw1.pdf", 16));
14<br />
Bookmark<br />
Creation<br />
Bookmarks, or an outline tree, are used to help the<br />
reader navigate a document. In essence, they form a<br />
Table of Contents for a document. They are displayed on<br />
a collapsible navigation pane adjacent to the window in<br />
which the document body is displayed when using Adobe<br />
Acrobat or Adobe Reader.<br />
14.1
14.2 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
Overview<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
You are not limited to a single tree of contents which matches your document. You<br />
may build multiple trees within the outline tree, <strong>and</strong> you may order material<br />
differently than the way it is ordered in the document. You may use bookmarks to<br />
point out <strong>and</strong> highlight material in any way that you believe to be useful to a reader of<br />
your document.<br />
The outline tree itself must be a single tree, with a single root node. <strong>DLI</strong> will h<strong>and</strong>le<br />
the mechanics of constructing the actual tree, allowing you to be concerned only with<br />
its content.<br />
<strong>DLI</strong> represents the outline tree as a collection of DLPDFOUTLINE structures. These<br />
have a number of properties, in addition to a pointer to the COS structure which this<br />
structure represents. The collection of such structures is the property of a single given<br />
document, <strong>and</strong> will be destroyed when that document is destroyed.
Bookmark Creation 14.3<br />
dlpdfdocoutlineadd<br />
This method adds a new outline entry to the document:<br />
• The first parameter specifies the document in which it is to reside.<br />
• The second, if not NULL, is the h<strong>and</strong>le of a parent structure.<br />
• The third, if not NULL, is the desired younger sibling (if NULL, it will be added as<br />
the last child of that parent).<br />
• The fourth parameter is required <strong>and</strong> is the text that will be displayed for this<br />
outline entry.<br />
• The fifth is a flag. If TRUE, the entry will be displayed initially as open (its children<br />
will be displayed). If FALSE, it will be displayed initially as closed.<br />
The following parameters describe a location which is to be displayed if this entry is<br />
selected.<br />
• First is a page number (the first page is zero)<br />
• Second is a FitType, a text string, as defined in the PDF Specification, section<br />
6.8.1.<br />
• Third is an ASFixed Rectangle, describing a location of the page to be<br />
displayed<br />
• Last is a zoom factor, indicating how much the size of the display should increase or<br />
decrease. (PDViewDestNull indicates “Do not change.”)<br />
These last 4 parameters are identical to the destination specifications for links, in the<br />
previous section.
14.4 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
From the full example on creating annotations, this segment shows the creation of an<br />
outline entry:<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
"C" Example: Adding Outline Entries<br />
RootBookMark = dlpdfdocoutlineadd (Doc, NULL, NULL,<br />
"All Pages", TRUE, 0, "Fit", &PageRect, PDViewDestNULL);<br />
/* An annotation for each page, linking to display<br />
* entire page */<br />
Page1BookMark = dlpdfdocoutlineadd (Doc, RootBookMark, NULL,<br />
"Page 1", FALSE, 0, "Fit", &PageRect, PDViewDestNULL);<br />
dlpdfdocoutlineaddfromname<br />
This method is the same as the previous in its action <strong>and</strong> in its first 4 parameters. It<br />
differs in that the destination is specified as a text string, a name in the destination<br />
dictionary of the document. (See the previous section for adding names <strong>and</strong><br />
description of the use of name.)<br />
The following is an extract from the full example on annotations:<br />
"C" Example: Adding an Outline with a Named Destination<br />
dlpdfdocoutlineaddfromname (Doc, Page1BookMark, NULL,<br />
"Link to 2", FALSE, "Link1");<br />
Each time you create a DLPDFOUTLINE, a pointer to that structure is returned. You<br />
may keep these pointers in your own data structures as an aid in building the<br />
document tree, or you may navigate the existing structure using the following<br />
methods.<br />
dlpdfdocoutline<br />
This method accepts a document h<strong>and</strong>le, <strong>and</strong> returns the h<strong>and</strong>le of the root outline<br />
node. If there are no outlines, it will return a NULL pointer.
Bookmark Creation 14.5<br />
dlpdfdocoutlinefirst<br />
This method accepts an outline h<strong>and</strong>le, <strong>and</strong> returns the h<strong>and</strong>le of the first child of this<br />
outline. If there are no outlines, it will return a NULL pointer.<br />
dlpdfdocoutlinelast<br />
This method accepts an outline h<strong>and</strong>le, <strong>and</strong> returns the last child of that outline. If<br />
there are no children in the outline, it returns a NULL pointer.<br />
dlpdfdocoutlineprev<br />
This method accepts an outline pointer, <strong>and</strong> returns the h<strong>and</strong>le of the previous child of<br />
this outline entry’s parent. If there is no previous child, it returns a NULL pointer.<br />
dlpdfdocoutlinenext<br />
This method accepts an outline pointer, <strong>and</strong> returns the pointer of the next child of<br />
this outline entry’s parent. If there is no next child, it returns a NULL pointer.<br />
dlpdfdocoutlineparent<br />
This method accepts a pointer to an outline entry, <strong>and</strong> returns a pointer to that entry’s<br />
parent. If the entry is the root entry, it returns a NULL pointer.<br />
The DLPDFOUTLINE structure contains three fields which may be accessed, but not<br />
changed, by an application:<br />
• DLPDFOUTLINE->Open is a flag which will be TRUE if the outline entry was<br />
created open, FALSE if it was not.<br />
• DLPDFOUTLINE->Count is a count of the children of this entry.<br />
• DLPDFOUTLINE->Obj is a Cos Obj which is the actual entry in the outline. This<br />
entry is a dictionary, as described in the PDF Specification, section 6.7. It will<br />
always have a Dest key, never an A key. You may replace this key to obtain actions<br />
other than “GoTo”.
14.6 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
Opening the Document with Annotations Showing<br />
The default action on opening a document is to show only the document window <strong>and</strong><br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
hide the navigation pane. To define a document that should be opened with the<br />
navigation pane showing, you need to add the key PageMode with the value<br />
UseOutlines to the document catalog structure. This is done at the Cos level as:<br />
"C" Example: Setting the Page Mode to Display Navigation Pane<br />
CosDoc cosDoc;<br />
CosObj Catalog;<br />
cosDoc = dlpdfdoccosdoc (Doc);<br />
Catalog = CosDocGetRoot (cosDoc);<br />
CosDictPut (Catalog, ASAtomFromString ("PageMode"),<br />
CosNewName (cosDoc, FALSE,<br />
ASAtomFromString ("UseOutlines")));
15<br />
Digital<br />
Signatures<br />
Digital Signatures are used to validate the document’s<br />
content <strong>and</strong> protect it against unauthorized tampering,<br />
viewing or modification.<br />
15.1
15.2 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
Overview<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
PDF files created with <strong>DLI</strong> may include digital signatures for use in validating a<br />
document's contents. With a digital signature, a certificate is added to a PDF file<br />
containing information about the signer. An encrypted message, <strong>and</strong> the key to<br />
decrypt this message, are included in the certificate or the signature PDF fields. The<br />
message is generated by a non-reversible mathematical transform of the PDF file's<br />
bytes known as a hash function. A recipient of the PDF file can then decrypt this<br />
message. If the message matches what the recipient calculates using the hash function<br />
for the PDF file, the PDF file has not been altered since it was signed. If it does not<br />
match, the document has been changed.<br />
Public <strong>and</strong> Private Keys<br />
Digital signatures are based on public-key cryptography. In public-key cryptography,<br />
there are two keys, public <strong>and</strong> private:<br />
• A private key is used to encrypt data that only the public key can decrypt.<br />
• A public key may encrypt data that only the private key can decrypt.<br />
This allows you, the document creator, to distribute a public key freely, <strong>and</strong> to encrypt<br />
a message with your private key (which must be kept secret). The reader can decrypt a<br />
message, but cannot re-encrypt the message in the same way that you encrypted it<br />
when you signed it. This prevents the reader from pretending to be the document<br />
author.<br />
Digital signatures also serve the purpose of non-repudiation. Since only the author can<br />
sign a document, a valid signature means that only the author of the document could
Digital Signatures 15.3<br />
have signed the PDF file. This makes digital signatures useful for contracts or other<br />
archival legal documents.<br />
A digital signature in a PDF file has two important parts:<br />
• the certificate<br />
• a series of DLPDFFORM objects which form a visible indicator that a document is<br />
signed<br />
The certificate is supplied to <strong>DLI</strong> <strong>and</strong> contains information such as the signer's name,<br />
their location, <strong>and</strong> a signature to validate the certificate.<br />
Certificates are accepted in PKCS #7 format <strong>and</strong> in x.509 format. For PKCS #7<br />
format, the calling application must be able to supply a fully-formed certificate,<br />
complete with the signed PDF document hash (supplied by <strong>DLI</strong>); for an x.509<br />
certificate, the hash value is calculated by <strong>DLI</strong> <strong>and</strong> supplied to the application<br />
through a callback routine for signing. This is for security purposes; calling<br />
applications should use secure memory routines when signing the PDF document.<br />
The appearance of the signature is optional; if it is not set, an invisible digital<br />
signature will be added to the PDF file created by <strong>DLI</strong>. It consists of several layers:<br />
• a background layer<br />
• a layer displayed before the signature is validated<br />
• a layer for the graphical signature representation (such as a scan of a h<strong>and</strong>written<br />
signature or signature stamp)<br />
• a layer containing information about the signature<br />
Any of these layers may be omitted; if so, an empty layer is created by <strong>DLI</strong> for the<br />
signature.
15.4 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
Digital Signature Calls<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
dlpdfdoccreatesignature<br />
This call creates a digital signature object for the <strong>DLI</strong> document being created. The<br />
sigType value is one of:<br />
dlpdfsigacrox509 (Adobe self-sign plug-in compatible with an x.509 v3<br />
certificate)<br />
dlpdfsigacropkcs7 (Adobe self-sign plug-in compatible with a PKCS #7<br />
certificate)<br />
dlpdfsigverisign (VeriSign signature plug-in compatible with a PKCS #7<br />
certificate)<br />
The nameStr, reasonStr <strong>and</strong> locationStr arguments are ASCII strings<br />
representing the signatory's name, the reason for signing (such as an initial release or a<br />
document revision), <strong>and</strong> the location of the signatory respectively. This information is<br />
stored outside of the certificate <strong>and</strong> is optional.<br />
dlpdfdocsetsignatureappearance<br />
This call sets the appearance layers for the digital signature to the supplied<br />
DLPDFFORM values:<br />
• The background layer is the bottommost layer of the digital signature<br />
appearance.<br />
• The unverified layer is displayed when the signature has not been verified.<br />
• The signature layer is a graphical representation of the signature itself (such as a<br />
scanned h<strong>and</strong>written signature).<br />
• The textSigInfo layer is used to display information about the signature <strong>and</strong> the<br />
signatory.<br />
This call is optional. For an invisible digital signature, do not call this function. All the<br />
signature layers are also optional. Blank layers will be used for any omitted signature<br />
appearance layers. These forms are placed at the origin of the <strong>DLI</strong> page.
Digital Signatures 15.5<br />
dlpdfsignaturesetx509cert<br />
This call associates an x.509 v3 certificate with a DLPDFSIGNATURE object created as<br />
a dlpdfsigacrox509-certificate digital signature. Do not call this with a<br />
DLPDFSIGNATURE object created as a different certificate type.<br />
The certificate is passed as a binary buffer in the certificate parameter; <strong>DLI</strong> will read<br />
certLen bytes from this buffer <strong>and</strong> make a copy for the PDF file's digital signature.<br />
The last parameter is a required callback function, to be called during the<br />
dlpdfdocwritepdf function call. It will be passed a character string containing the<br />
SHA-1 hash for the PDF file being written, as a NULL-terminated string of<br />
hexadecimal digits using PKCS #1 padding, containing a BER OID (object identifier)<br />
for the SHA-1 algorithm. The buffer is 256 bytes long (not including the NULL<br />
terminator), <strong>and</strong> formatted as<br />
0001FFFF .. FF003021300906052B0E03021A05000414<br />
[ 40 hex digits for SHA-1 hash ]<br />
The callback function must encrypt this hash value with the private key corresponding<br />
to the public key in the signature's x.509 certificate, <strong>and</strong> fill the buffer passed in with<br />
256 hexadecimal digits representing the encrypted value for the supplied BER<br />
formatted hash. A 1024-bit key is used for encryption operations.<br />
NOTE: The signed hash will not have padding, <strong>and</strong> must be exactly 256<br />
hexadecimal digits. If necessary, use zeros to pad it to the required length.<br />
dlpdfsignaturesetpkcs7cert<br />
This function sets the certificate generation callback for DLPDFSIGNATUREs of type<br />
dlpdfsigacropkcs7 <strong>and</strong> dlpdfsigverisign. For these signature types, the<br />
application using <strong>DLI</strong> is required to generated a fully-formed PKCS #7 certificate<br />
with an MD5 checksum of the PDF document, encrypted with the private key
15.6 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
corresponding to the public key in the certificate. The RSA public-key algorithm with<br />
a 1024-bit key length is used.<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
The genPKCS7Cert callback is called by <strong>DLI</strong> during the dlpdfdocwritepdf<br />
function call. The callback is supplied a binary data buffer of length maxLen. The<br />
first 16 bytes of this buffer contain the MD5 checksum (in binary) for the PDF<br />
document to sign. The callback must generate a PKCS #7 certificate as described<br />
above, <strong>and</strong> fill the data buffer with the certificate, in binary. The callback function<br />
must return the length to read from the data buffer, in bytes.<br />
NOTE: maxLen bytes are set aside in the output PDF file for the PKCS #7<br />
certificate, <strong>and</strong> will be written to the PDF file regardless of the actual certificate<br />
length. Callers should pass length values which are close to the certificate length<br />
if possible.<br />
dlpdfsignaturesetdatacallback<br />
This call is optional for clients using PKCS #7 certificates. A callback function is<br />
supplied for the signature. The callback is called during the dlpdfdocwritepdf<br />
function with binary information from the PDF file. This information will be in<br />
sequential pieces, <strong>and</strong> may be used to generate the PDF document hash value. The<br />
information is supplied as binary values in the character buffer; the length to read is<br />
supplied as the second parameter. A length of 0 indicates that no further data is to be<br />
read, <strong>and</strong> the hash may be finalized.<br />
dlpdfpageplacesignature<br />
This call associates a digital signature to a page in the PDF file generated by <strong>DLI</strong>. The<br />
signature appearance must fit in the bounds supplied in imageBBox. This call is<br />
required for all digital signatures, even invisible signatures. For invisible digital<br />
signatures, the imageBBox is ignored <strong>and</strong> may be NULL.
16<br />
Error<br />
Testing <strong>and</strong> Recovery<br />
This chapter discusses possible errors you may encounter<br />
<strong>and</strong> how to resolve them.<br />
16.1
16.2 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
Overview<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
The Adobe PDF Library <strong>and</strong> <strong>DLI</strong> will communicate errors back to your application<br />
program by raising an exception. For this reason, it is important that you have<br />
exception h<strong>and</strong>lers placed to catch such errors as close as possible to their source, to<br />
detect the error as soon as possible <strong>and</strong> to limit the damage an error can cause. It is<br />
also important that an outer error catcher be in place, as having no exception h<strong>and</strong>ler<br />
when an exception is raised will cause a fatal error.<br />
NOTE: Follow the development guidelines for error h<strong>and</strong>ling that are included in<br />
the Adobe Acrobat Core API Overview. See chapter 12, “H<strong>and</strong>ling Errors” for more<br />
information.<br />
The Adobe PDF Library provides a mechanism in “C” to define exception h<strong>and</strong>lers.<br />
This mechanism consists of bracketing the code which may cause an exception to be<br />
raised with DURING <strong>and</strong> HANDLER, followed by a block of code to be executed only if<br />
an exception is raised, terminated by END_HANDLER.<br />
CAUTION: Your application must not exit from within the exception h<strong>and</strong>ler.<br />
Doing so will leave the exception h<strong>and</strong>ler frame on the stack, eventually leading to<br />
a stack overflow <strong>and</strong> crash. Your application should exit beyond the<br />
END_HANDLER statement, not within the HANDLER/END_HANDLER block. See<br />
“Risks of Function Returns within Exception H<strong>and</strong>lers” on page 16.3 following<br />
below.
Error Testing <strong>and</strong> Recovery 16.3<br />
Always use the macros defined by Adobe for returning from functions under various<br />
conditions. For example:<br />
"C" Example: Error H<strong>and</strong>ler<br />
DURING<br />
Image = dlpdfimagecreatefromfile (Doc, FileName);<br />
HANDLER<br />
char Buffer[1024];<br />
ASGetErrorString(ASGetExceptionErrorCode(), Buffer, 1024);<br />
printf (“Unable to process image ‘%s’ for reason ‘%s’,<br />
FileName, Buffer);<br />
Image = NULL;<br />
END_HANDLER<br />
To support you in h<strong>and</strong>ling an error, both the Adobe PDF Library <strong>and</strong> <strong>DLI</strong> report<br />
errors via exception names. These names are available via the method<br />
ASGetExceptionErrorCode. It will be translated into a meaningful text string via<br />
the call ASGetErrorString.<br />
Each method documents the exceptions that may be raised by that method. You may<br />
design error routines which examine the exception code <strong>and</strong> act differently based on<br />
its value.<br />
Be careful in placing DURING/HANDLER/END_HANDLER constructs. Try to get them as<br />
close to a definable piece of your data constructs as possible. Depending on the<br />
function of your application, this may allow a single construct to fail without<br />
removing all of a line, area, page, or the document as a whole.<br />
The more h<strong>and</strong>ler constructs you build, the smaller the effect of an error may be, <strong>and</strong><br />
the greater your chances that your application may be able to recover from that error<br />
<strong>and</strong> continue (depending on the nature of the problem, of course).<br />
Risks of Function Returns within Exception H<strong>and</strong>lers<br />
Do not return from a function while inside an exception h<strong>and</strong>ler, since doing so can<br />
cause unexpected <strong>and</strong> hard-to-trace program crashes. If an application must exit while<br />
inside a DURING/HANDLER/END_HANDLER construct, use the E_RETURN(X) macro
16.4 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
to return the value X, or the E_RTRN_VOID macro to exit a function with no return<br />
value.<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
OS/390 Platform Concerns<br />
The preceding error recovery mechanism applies on the OS/390 platform if the SAS/C<br />
compiler is used. In cases where the OS/390 application is not compiled via SAS/C, it<br />
must use a different mechanism to obtain the error status. This consists of three<br />
primary function calls:<br />
DLExceptionFlag<br />
Returns: ASInt32<br />
DLExceptionFlag returns 0 if no exception was raised by the exception h<strong>and</strong>ler in<br />
the most-recently-called Adobe PDF Library or <strong>DLI</strong> function. A non-zero return<br />
value indicates that an error was detected while processing the last function call.<br />
This error mechanism is destructive, in that the flag value is reset by accessing it with<br />
the DLExceptionFlag function call.<br />
NOTE: If DLExceptionFlag returns a non-zero return code, the return value<br />
of the function in which the error occurred is undefined.<br />
DLExceptionCode<br />
Returns: ASInt32<br />
DLExceptionCode returns the last exception code set by an exception raised by an<br />
Adobe PDF Library or <strong>DLI</strong> function. The code value returned by the<br />
DLExceptionCode function may be used to retrieve an error message via a call to<br />
ASGetErrorString, as documented in the Adobe PDF Library Developer <strong>Guide</strong>.
Error Testing <strong>and</strong> Recovery 16.5<br />
DLExceptionMessage<br />
Returns: char*<br />
DLExceptionMessage returns a non-NULL pointer if an additional message string<br />
was generated by Adobe PDF Library or <strong>DLI</strong> when an exception was raised. This<br />
pointer may be NULL when an error is raised if the Adobe PDF Library or <strong>DLI</strong><br />
function does not supply the optional message string.<br />
The application should call DLExceptionFlag after each Adobe PDF Library <strong>and</strong><br />
<strong>DLI</strong> function call to determine if an exception was raised. If the flag is non-zero, the<br />
application should use DLExceptionCode <strong>and</strong>/or DLExceptionMessage to<br />
obtain additional information, then h<strong>and</strong>le the exception as appropriate.<br />
These are the basic steps that should be followed:<br />
1 Call the desired Adobe PDF Library/<strong>DLI</strong> function<br />
2 Get the Exception Status by calling DLExceptionFlag<br />
3 If DLExceptionFlag returns a non-zero value:<br />
• Get additional error information (DLExceptionCode, ASGetErrorString,<br />
DLExceptionFlag)<br />
• H<strong>and</strong>le exception as appropriate to the application (e.g. switch to a default font,<br />
flush the current statement, etc.).
16.6 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System
17<br />
Samples<br />
<strong>and</strong> Links<br />
The following pages explain the full <strong>DLI</strong> sample<br />
programs that have been compiled <strong>and</strong> tested, <strong>and</strong> which<br />
accompany this release. They illustrate various aspects of<br />
the usage of Adobe PDF Library <strong>and</strong> <strong>DLI</strong>.<br />
17.1
17.2 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
Running <strong>DLI</strong> Sample Applications<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Notes on each specific <strong>DLI</strong> sample follow below. You are not required to test any or<br />
all of them, but if you do, we suggest running them in the order given below.<br />
Some samples require one or more comm<strong>and</strong>-line arguments, <strong>and</strong> will prompt for<br />
them if not given.<br />
You should find the following <strong>DLI</strong> samples in individual subfolders under<br />
C:\<strong>Datalogics</strong>\APDFL6.1.1\<strong>DLI</strong>\Samples (or similar). On Windows<br />
platforms, a Visual Studio C++ v6.0 Workspace file, including all <strong>DLI</strong> samples as<br />
Projects within, can be found in<br />
C:\<strong>Datalogics</strong>\APDFL6.1.0\<strong>DLI</strong>\Samples\All (see dli_samples.dsw).<br />
NOTE: Sample applications included in each release are subject to change. Some<br />
samples may not appear in releases on certain platforms.<br />
Activating Files-in-Memory within Samples<br />
For most samples, adding the comm<strong>and</strong>-line keyword "MEMORY" will run the<br />
application using Files-in-Memory methods. This will make use of memory work files<br />
instead of I/O processing to disk, <strong>and</strong> as a result should show improved processing<br />
times.<br />
Review the source code of any sample to see whether the MEMORY keyword is<br />
supported in that application. (Most <strong>DLI</strong> samples include it.) Typically this is<br />
recognized as an indicator which then determines the calling arguments for<br />
dlpdfinit, as shown in the following excerpt from the Paths sample application,
Samples <strong>and</strong> Links 17.3<br />
where FileSystemType is defined as eMemFileSys if MEMORY was found in the<br />
calling arguments for the application:<br />
switch (FileSystemType)<br />
{<br />
case eStdFileSys:<br />
pdfInstance=dlpdfinit(&DataRec, NULL, NULL);<br />
break;<br />
case eMemFileSys:<br />
pdfInstance=dlpdfinit(&DataRec, dlpdfmemfilesys(), NULL);<br />
break;<br />
default:<br />
printf("Unknown File System requested.");<br />
return 8;
17.4 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
Hello<strong>DLI</strong><br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
This application is similar to the Adobe PDF Library sample HeloWrld, generating a<br />
single page reading "Hello <strong>DLI</strong>!" via <strong>DLI</strong> methods. Comparing Hello<strong>DLI</strong>.c to<br />
HeloWrld.c can show the simplified coding available via <strong>DLI</strong> for performing<br />
common Adobe PDF Library tasks.
Samples <strong>and</strong> Links 17.5<br />
Paths<br />
This sample shows how to draw various simple shapes using <strong>DLI</strong>, <strong>and</strong> how to draw<br />
PDF paths with <strong>DLI</strong>. A path in PDF, like in PostScript, consists of a series of<br />
movements from a starting point. A path is filled with the fill color in the<br />
graphics state, <strong>and</strong> the lines connecting the movements of the path are drawn with<br />
the stroke color in the graphics state. This sample also demonstrates some<br />
common matrix operations, such as rotations <strong>and</strong> translations of paths.<br />
For common shapes, <strong>DLI</strong> has shortcut operations to create paths, such as for<br />
rectangles <strong>and</strong> arcs.<br />
This sample also demonstrates the use of CMYK color spaces. For an example of<br />
using RGB color spaces, please see “Annotations” on page 17.15.
17.6 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
Graphics<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
This sample demonstrates how to imports graphics from <strong>DLI</strong>-supported graphic file<br />
formats ( RAW, EPS, PNG, JPEG/JPG, GIF, TIFF <strong>and</strong> PDF ) into a PDF document,<br />
how to scale these to the individual graphic's design width <strong>and</strong> height, <strong>and</strong> how to<br />
place these on the page. Details on some graphic formats follow below.<br />
NOTE: An Encapsulated PostScript (EPS) image written to an output PDF file will<br />
be present in the file, but will not display when viewed in PDF output. It will<br />
appear when produced as PostScript (e.g. to a PostScript printer). You may need to<br />
define EPSF_ENABLED in this example in order to process the EPS sample image.
Samples <strong>and</strong> Links 17.7<br />
EPS<br />
EPS graphics will not show when viewing the output PDF graphic; EPS graphics will<br />
only print, <strong>and</strong> only when printing to a PostScript device. These graphics are stored in<br />
PDF as comments.<br />
If you need to convert EPS files to PDF, please contact <strong>Datalogics</strong> for information on<br />
licensing Adobe Normalizer, or use Adobe Distiller.<br />
PDF<br />
PDF pages are imported as graphical elements, <strong>and</strong> some items such as annotations<br />
<strong>and</strong> bookmarks are not imported with the PDF file. Additionally, Acrobat Forms are<br />
not imported at this time. PDF images created with the<br />
dlpdfimagecreatefromfile call are created from the first page; to import other<br />
pages, use the dlpdfimagecreatefrompdf function.<br />
PNG<br />
Alpha channels are currently flattened into a 1-bit plane (visible/invisible) to facilitate<br />
placement using a threshhold algorithm. This threshhold cannot be changed at this<br />
time.<br />
TIFF<br />
Only the first page of a multipage TIFF image will be processed at this time.<br />
Alpha channels are currently flattened into a 1-bit plane (visible/invisible) to facilitate<br />
placement using a threshhold algorithm. This threshhold cannot be changed at this<br />
time.
17.8 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
BMP<br />
NOTE: Some BMP images with LZW skip markers may not embed properly. If<br />
possible, avoid images with LZW skip markers.<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
For all raster images, <strong>DLI</strong> attempts to do as little image alteration as possible, though<br />
usually some image processing is required to create stream information suitable for<br />
inclusion in PDF files.<br />
NOTE: All images are cached by <strong>DLI</strong> by filename. Applications should not attempt<br />
to change image file data during a job, as unpredictable or unexpected results<br />
could occur.
Samples <strong>and</strong> Links 17.9<br />
Encrypt<br />
This produces a simple PDF document (a blank page with a red square), applying<br />
encryption to the output PDF file, requiring one of two passwords for viewing:<br />
When prompted by Adobe Acrobat or Adobe Reader, entering the user password<br />
"ValidUser" (case-sensitive, must be entered as shown) will open the document for
17.10 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
viewing <strong>and</strong> printing.<br />
Entering the owner password "DocOwner" will open the document for viewing <strong>and</strong><br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
printing as before, but will also allow current protection to be modified or removed.<br />
Compare the action under either password when following the "File-<br />
>SaveAs..." menu <strong>and</strong> attempting to change the Security settings on the new file to<br />
be created. The owner password must be given before Security settings can be viewed<br />
or modified:
Samples <strong>and</strong> Links 17.11<br />
FontFaux<br />
This sample demonstrates how to create a font for use in a PDF file when the font is<br />
not present on the system on which an application is running, <strong>and</strong> illustrates the<br />
meanings of the various font attributes available to the user in the PDEFontAttrs<br />
structure. It demonstrates font fauxing techniques for simulating the appearance of<br />
various referenced fonts which are neither embedded in the document nor available<br />
on the viewing user machine.<br />
The sample creates a number of simulated ("faux") fonts, each with different<br />
attributes. When the created PDF document is opened, Adobe Acrobat or Adobe<br />
Reader will substitute a font for that used by the PDF file. The document contains
17.12 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
enough information for each font that a viewer can create a lookalike font. That<br />
lookalike will not be suitable for precise typography, but should be acceptable for<br />
web-delivery documents.<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
NOTE: Only fonts using characters in the Adobe st<strong>and</strong>ard encodings (St<strong>and</strong>ard,<br />
WinAnsi <strong>and</strong> MacRoman) can be fauxed correctly. Attempting to do this with<br />
fonts containing characters outside the range of st<strong>and</strong>ard encodings will result in<br />
a bad display. Set the PD_STD_ENCODING font flag in the PDEFontAttrs<br />
structure to indicate that the font uses only "st<strong>and</strong>ard" characters.
Samples <strong>and</strong> Links 17.13<br />
FontVerification<br />
This application is useful for creating a quick-reference table of fonts available to your<br />
application. It compiles a directory of all fonts found in the current resource listing,<br />
including a hyperlinked Table of Contents <strong>and</strong> a sample listing, font dump <strong>and</strong><br />
encoding grid page for every font found. It demonstrates basic font creation using
17.14 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
<strong>DLI</strong>, <strong>and</strong> displays the fonts which the Adobe PDF Library was able to locate on the<br />
host system.<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
NOTE: On machines with lengthy resource listings (i.e. numerous fonts available),<br />
this application may take a minute or two to complete. Some time may elapse<br />
before any completion messages appear onscreen.<br />
For each single-byte Type 1 or TrueType font found, a font will be created in <strong>DLI</strong><br />
with the same name <strong>and</strong> type. Each character of a target encoding will then be<br />
displayed in a grid formation, to verify proper font creation. Fonts of other types (e.g.<br />
MultiMaster fonts, Type 0 fonts) will be noted in the Table of Contents, but not used<br />
for font creation.<br />
See the source code comments in Fontverification.c for more information on<br />
how the resource lists are compiled, <strong>and</strong> what options are available for maintaining<br />
them <strong>and</strong> controlling how they are compiled.
Samples <strong>and</strong> Links 17.15<br />
Annotations<br />
This sample demonstrates types of PDF annotations for which <strong>DLI</strong> provides output<br />
support. (Other annotation types can be done at the COS layer; see the sample<br />
“AcroForm” on page 17.18 for more details.) This sample also shows how to<br />
manipulate RGB color spaces to produce colored text <strong>and</strong> path elements.<br />
Annotations include features such as "sticky notes" (open or closed), bookmarks <strong>and</strong><br />
hyperlinks (enabling the user to jump to other places in the current document, to<br />
other PDF documents or other files, or to Internet addresses elsewhere).<br />
The first two pages of output demonstrate links to other documents <strong>and</strong> to other<br />
pages within the same document. (e.g. a link on Page 1 will take you to Page 2, <strong>and</strong> a<br />
link on Page 2 will take you to Page 1.)<br />
Notice that the link can specify not only the destination being pointed to but also the<br />
type of screen display to use when you arrive. For example, Page 1’s "Link to page 2,"
17.16 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
if selected, will take you to a full-page view of Page 2. However, Page 2’s "Link to<br />
page 1," if selected, will zoom in on its Page 1 target note to fill the entire screen.<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Finally, the third page demonstrates two methods of visually cueing the reader to<br />
embedded hyperlinks: boxing the hyperlink area with an outline rule, or generating<br />
text of a different color. In either case, clicking on the links should trigger a jump to<br />
the <strong>Datalogics</strong> website at http://www.datalogics.com.<br />
memFiles<br />
This sample demonstrates use of the <strong>Datalogics</strong> Files-in-Memory file system. Using<br />
this filesystem, a <strong>DLI</strong> user can create ASFile objects from a memory buffer ,<br />
enabling creation of images from memory such as database blobs (Binary Large<br />
OBjects). The filesystem also allows the user to write PDF files to memory buffers,<br />
which can then be retrieved, written to other files or manipulated in various ways.<br />
Temporary files are also written to the Files-in-Memory filesystem, if it is active at the<br />
time the temporary file is opened. This usually occurs when a document is created.<br />
MultiDoc<br />
This sample controls the generation of multiple documents from a single run of the<br />
application. It has two required arguments:<br />
• Argument 1 must be the number of documents to produce.<br />
• Argument 2 must be the number of pages per document to produce.<br />
Several additional, optional arguments may also be used to vary the output as desired,<br />
such as PSTOUT or PDFOUT keywords to generate PostScript or PDF output<br />
respectively. (This sample is mainly intended to demonstrate program operation, not<br />
text output.) Other comm<strong>and</strong>-line arguments can also be given in order to test output<br />
variations or application performance. Run the sample with no comm<strong>and</strong>-line<br />
arguments for a short usage message; see the source code file MultiDoc.c for more<br />
details.
Samples <strong>and</strong> Links 17.17<br />
NestedPDF<br />
This sample generates a set of output documents, in which a pair of PDF graphic files<br />
are in turn included within a larger PDF file, repeating the process several times. It<br />
demonstrates the ability of the interface to embed PDF files as graphics, in the<br />
presence of conflicting names, to show PDF Form XObject name scoping rules.<br />
This sample also demonstrates how to create patterns in <strong>DLI</strong> for painting content<br />
areas with a background.
17.18 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
AcroForm<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
This sample demonstrates how to create an Acrobat Form using the Adobe PDF<br />
Library <strong>and</strong> <strong>DLI</strong>, creating a number of different field types using COS-layer object<br />
manipulation.
Samples <strong>and</strong> Links 17.19<br />
SignDoc<br />
This sample demonstrates how to place a digital signature into a PDF file generated by<br />
<strong>DLI</strong>. This signature will be compatible with the Adobe self-sign plugin, <strong>and</strong> will<br />
contain an x.509 certificate.<br />
NOTE: Included in this project is a file "rsasign.cpp", containing a very slow<br />
implementation of the RSA encryption algorithm. <strong>Datalogics</strong> does not recommend<br />
using this implementation as a basis for Production code.<br />
<strong>DLI</strong> can also produce signatures with PCKS #7-format certificates, for the Adobe selfsign<br />
plugin <strong>and</strong> the VeriSign signature plugin. Customers wishing to do this will<br />
follow a slightly different path, <strong>and</strong> must be able to generate these certificates.<br />
This sample uses a dummy x.509 certificate; the key pair used to generate this<br />
certificate is stored in the sample.key.info file in the @Data directory.<br />
As of Adobe PDF Library v6.1.1 <strong>and</strong> <strong>DLI</strong> v3.0.23, this sample application produces<br />
digital signatures compatible with the Adobe Acrobat v5 validation plug-in. In a<br />
future release, <strong>DLI</strong> will be upgraded to generate digital signatures compatible with
17.20 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
Adobe Acrobat v6 or higher. You should also be aware that this sample takes a long<br />
time to run.<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
psOutput<br />
This sample demonstrates generation of PostScript from the Adobe PDF Library <strong>and</strong><br />
<strong>DLI</strong>. The sample will create a new <strong>DLI</strong> document, add the pages (in reverse order) of
Samples <strong>and</strong> Links 17.21<br />
a sample PDF file to the document, <strong>and</strong> write a PostScript Level 2 output file.<br />
Additionally, an output PDF file will be written.<br />
The application does all processing of the material in PDF form; the PostScript is<br />
generated by exporting the PDF file created by the Adobe PDF Library <strong>and</strong> <strong>DLI</strong> to<br />
PostScript output. This sample shows how one might write an application to convert<br />
PDF files to PostScript for printing or other processing.<br />
WideText<br />
This sample demonstrates the <strong>DLI</strong> interface to the ICU functionality, used to typeset<br />
lines of text in Unicode or other wide-text encodings. This functionality supercedes<br />
the Unicode functionality present in the <strong>DLI</strong> v2.2.x series. This functionality is<br />
available for TrueType, TrueType Collection <strong>and</strong> OpenType font files. This sample<br />
also demonstrates the use of DLPDFTEXT areas for placement of text.<br />
NOTE: This sample uses ArialUnicodeMS <strong>and</strong> BitstreamCyberbit, fonts which are<br />
not distributed with Adobe PDF Library or <strong>DLI</strong>. You must ensure that these fonts are<br />
accessible (or that the sample is modified to use others instead) when running this<br />
program, or problems may occur, as either a raised exception or an output<br />
document containing blank glyphs.
17.22 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System
A<br />
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
This appendix defines methods available with <strong>DLI</strong>.<br />
A.1
A.2 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfcontentarc (DLPDFCONTENT *Content,<br />
PDEGraphicState *gState, int PaintOp, ASFixed X1, ASFixed<br />
Y1, ASFixed Radius, ASFixed Angle1, ASFixed Angle2)<br />
Return Value: void<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Description<br />
Parameters<br />
Return Value<br />
Included as an aid in transitioning from Post-<br />
Script to PDF. It will draw an arc centered at<br />
(X1,Y1), at a radius of Radius, from Angle1<br />
to Angle2, counter-clockwise, where the angles<br />
are considered to be in degrees.<br />
• DLPDFCONTENT *Content: Element<br />
structures, destroyed when associated with a<br />
page or form; pointers to them should not be<br />
used after that time.<br />
• PDEGraphicState *gState: Color<br />
definitions; path-drawing line sizes <strong>and</strong><br />
parameters.<br />
• int PaintOp: A composite of text-display<br />
flags, set by performing a bitwise OR with the<br />
desired combination of flag values<br />
kPDEFill, kPDEStroke, kPDEEoFill<br />
<strong>and</strong> kPDEInvisible.<br />
• ASFixed X1<br />
• ASFixed Y1<br />
• ASFixed Radius<br />
• ASFixed Angle1<br />
• ASFixed Angle2<br />
void<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfcontentarcn,<br />
dlpdfcontentarcto<br />
All <strong>DLI</strong> supported platforms.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.3<br />
dlpdfcontentarcn (DLPDFCONTENT *Content,<br />
PDEGraphicState *gState, int PaintOp, ASFixed X1, ASFixed<br />
Y1, ASFixed Radius, ASFixed Angle1, ASFixed Angle2)<br />
Return Value: void<br />
Description<br />
Parameters<br />
Return Value<br />
This procedure is included as an aid in transitioning<br />
from PostScript to PDF. It will draw an<br />
arc centered at (X1,Y1), at a radius of Radius,<br />
from Angle1 to Angle2, clockwise, where the<br />
angles are considered to be in degrees.<br />
• DLPDFCONTENT *Content: Represents the<br />
content element. These structures are<br />
destroyed when associated with a page or<br />
form, <strong>and</strong> pointers to them should not be<br />
used after that time.<br />
• PDEGraphicState *gState: Contains<br />
definitions of colors to be applied, <strong>and</strong> line<br />
sizes <strong>and</strong> parameters to be used when<br />
drawing a path.<br />
• int PaintOp: A composite of flags which<br />
define how the text will be displayed. It is set<br />
by performing a bitwise OR with the desired<br />
combination of the Adobe PDF Library flag<br />
values kPDEFill, kPDEStroke,<br />
kPDEEoFill <strong>and</strong> kPDEInvisible.<br />
• ASFixed X1<br />
• ASFixed Y1<br />
• ASFixed Radius<br />
• ASFixed Angle1<br />
• ASFixed Angle2<br />
void<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfcontentarc,<br />
dlpdfcontentarcto<br />
All <strong>DLI</strong>-supported platforms.
A.4 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfcontentarcto (DLPDFCONTENT *Content,<br />
PDEGraphicState *gState, int PaintOp, ASFixed X1, ASFixed<br />
Y1, ASFixed Radius, ASFixed X2, ASFixed Y2, ASFixed Xint,<br />
ASFixed Yint)<br />
Return Value: void<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Description<br />
Parameters<br />
Return Value<br />
This is a convenience method to mimic the Post-<br />
Script ArcTo operator. It will locate the intersections<br />
of the line (X1,Y1)->(Xint,Yint), <strong>and</strong><br />
(X2,Y2)->(Xint,Yint), <strong>and</strong> draw an arc of the<br />
specified radius tangent to those two lines. The<br />
line segment from (X1,Y1) to the arc will be<br />
drawn. Unlike the PostScript ArcTo operator,<br />
the segment from the tangent to (X2,Y2) will<br />
also be drawn.<br />
• DLPDFCONTENT *Content: Represents the<br />
content element. These structures are<br />
destroyed when associated with a page or<br />
form, <strong>and</strong> pointers to them should not be<br />
used after that time.<br />
• PDEGraphicState *gState: Contains<br />
definitions of colors to be applied, <strong>and</strong> line<br />
sizes <strong>and</strong> parameters to be used when<br />
drawing a path.<br />
• int PaintOp: A composite of flags which<br />
define how the text will be displayed. It is set<br />
by performing a bitwise OR with the desired<br />
combination of the Adobe PDF Library flag<br />
values kPDEFill, kPDEStroke,<br />
kPDEEoFill <strong>and</strong> kPDEInvisible.<br />
• ASFixed X1<br />
• ASFixed Y1<br />
• ASFixed Radius<br />
• ASFixed X2<br />
• ASFixed Y2<br />
• ASFixed Xint<br />
• ASFixed Yint<br />
void
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.5<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfcontentarc,<br />
dlpdfcontentarcn<br />
All <strong>DLI</strong>-supported platforms.
A.6 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfcontentcircle (DLPDFCONTENT *Content,<br />
PDEGraphicState *gState, int PaintOp, ASFixed X, ASFixed<br />
Y, ASFixed Radius)<br />
Return Value: void<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Description<br />
Parameters<br />
Return Value<br />
This procedure is included as an aid in transitioning<br />
from PostScript to PDF. It will draw a<br />
circle centered at (X,Y) at a radius of Radius.<br />
• DLPDFCONTENT *Content: Represents the<br />
content element. These structures are<br />
destroyed when associated with a page or<br />
form, <strong>and</strong> pointers to them should not be<br />
used after that time.<br />
• PDEGraphicState *gState: Contains<br />
definitions of colors to be applied, <strong>and</strong> line<br />
sizes <strong>and</strong> parameters to be used when<br />
drawing a path.<br />
• int PaintOp: A composite of flags which<br />
define how the text will be displayed. It is set<br />
by performing a bitwise OR with the desired<br />
combination of the Adobe PDF Library flag<br />
values kPDEFill, kPDEStroke,<br />
kPDEEoFill <strong>and</strong> kPDEInvisible.<br />
• ASFixed X<br />
• ASFixed Y<br />
• ASFixed Radius<br />
void<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfcontentellipse<br />
All <strong>DLI</strong>-supported platforms.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.7<br />
dlpdfcontentclip (DLPDFCONTENT *Content,<br />
ASFixed *Path, int PathLen, int EOClip)<br />
Return Value: void<br />
Description<br />
Parameters<br />
Return Value<br />
Establish a clipping path. Note that clipping<br />
paths are not established automatically for<br />
images, forms, or line drawings. Generally, PDF<br />
images page more efficiently if there is no clipping<br />
involved.<br />
• DLPDFCONTENT *Content: Represents the<br />
content element. These structures are<br />
destroyed when associated with a page or<br />
form, <strong>and</strong> pointers to them should not be<br />
used after that time.<br />
• ASFixed *Path: Specifies path; identical<br />
to dlpdfcontentpath oper<strong>and</strong>.<br />
• int PathLen: Specifies path length;<br />
identical to dlpdfcontentpath oper<strong>and</strong><br />
• int EOClip: Should be FALSE (0) for a<br />
normal clip <strong>and</strong> TRUE (1) for an even/odd<br />
clip.<br />
void<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfcontentclipend,<br />
dlpdfcontentpath<br />
All <strong>DLI</strong>-supported platforms.
A.8 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
Technical Notes<br />
1 Clipping paths are not established automatically for images, forms, or line<br />
drawings. Generally, Concepts PDF <strong>and</strong> images Facilities: page more <strong>Guide</strong> efficiently to the if DL there Pager is no Composition clipping System<br />
involved.<br />
2 A clipping region is considered a part of the content structure, <strong>and</strong> will be ended at<br />
the end of a content structure. Clipping regions may be nested, but each nested<br />
region must fit within the previous region. A clipping region can <strong>and</strong> should be<br />
ended as soon as possible, using the dlpdfcontentclipend call.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.9<br />
dlpdfcontentclipend (DLPDFCONTENT *Content)<br />
Return Value: void<br />
Description<br />
Parameters<br />
Return Value<br />
This call is used to manually end a clipping<br />
region prior to the end of the content structure.<br />
It should be called as soon as possible after a<br />
clipping region is established.<br />
DLPDFCONTENT *Content: Represents the<br />
content element. These structures are destroyed<br />
when associated with a page or form, <strong>and</strong><br />
pointers to them should not be used after that<br />
time.<br />
void<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfcontentclip<br />
All <strong>DLI</strong>-supported platforms.
A.10 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfcontentcomment (DLPDFCONTENT<br />
*Content, char *Comment)<br />
Return Value: void<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Description<br />
Parameters<br />
Return Value<br />
This method will insert the specified text string<br />
as a comment, in the order provided, into the<br />
content elements.<br />
• DLPDFCONTENT *Content: Represents the<br />
content element. These structures are<br />
destroyed when associated with a page or<br />
form, <strong>and</strong> pointers to them should not be<br />
used after that time.<br />
• char *Comment: A text string<br />
void<br />
Exceptions<br />
Header<br />
dli.h<br />
Related Methods<br />
Availability<br />
All <strong>DLI</strong>-supported platforms.<br />
Technical Notes<br />
1 The comment string will always be placed on a separate line, beginning with a<br />
percent sign (“%”) provided by <strong>DLI</strong> to mark it as a comment.<br />
2 The comment text must not contain a new line character, unless you provide a<br />
percent sign immediately following it. (<strong>DLI</strong> provides only the initial percent sign<br />
for each comment. Follow-on new lines within the comment text must contain<br />
their own starting percent sign for each comment line of output.)<br />
3 The content element must be valid: the comment pointer must point at a valid non-<br />
NULL, non-zero length string.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.11<br />
dlpdfcontentcreate (DLPDFDOC *Doc)<br />
Return Value: DLPDFCONTENT*<br />
Description<br />
Parameters<br />
Return Value<br />
Creates a new content element with a rotation<br />
of zero degrees, a position of (0,0) <strong>and</strong> scaling<br />
of (1,1).<br />
DLPDFDOC *Doc: represents the document<br />
structure <strong>and</strong> the current status of the document<br />
at all times.<br />
DLPDFCONTENT*<br />
Exceptions<br />
Header<br />
dli.h<br />
Related Methods<br />
Availability<br />
All <strong>DLI</strong>-supported platforms.
A.12 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfcontentellipse (DLPDFCONTENT *Content,<br />
PDEGraphicState *gState, int PaintOp, ASFixed X, ASFixed<br />
Y, ASFixed RadiusH, ASFixed RadiusV)<br />
Return Value: void<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Description<br />
Parameters<br />
Return Value<br />
This procedure is included as an aid in transitioning<br />
from PostScript to PDF. It will draw an<br />
ellipse centered at (X,Y), at a vertical radius of<br />
RadiusV, <strong>and</strong> a horizontal radius of RadiusH.<br />
• DLPDFCONTENT *Content: Represents the<br />
content element. These structures are<br />
destroyed when associated with a page or<br />
form, <strong>and</strong> pointers to them should not be<br />
used after that time.<br />
• PDEGraphicState *gState: Contains<br />
definitions of colors to be applied, <strong>and</strong> line<br />
sizes <strong>and</strong> parameters to be used when<br />
drawing a path.<br />
• int PaintOp: A composite of flags which<br />
define how the text will be displayed. It is set<br />
by performing a bitwise OR with the desired<br />
combination of the Adobe PDF Library flag<br />
values kPDEFill, kPDEStroke,<br />
kPDEEoFill <strong>and</strong> kPDEInvisible.<br />
• ASFixed X<br />
• ASFixed Y<br />
• ASFixed RadiusH<br />
• ASFixed RadiusV<br />
void<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfcontentcircle<br />
All <strong>DLI</strong>-supported platforms.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.13<br />
dlpdfcontentfontskew (DLPDFCONTENT<br />
*Content, ASFixedMatrix *Matrix)<br />
Return Value: void<br />
Description<br />
Parameters<br />
Return Value<br />
Causes the font currently in effect for this content<br />
structure to appear "twisted" according to<br />
the matrix supplied.<br />
• DLPDFCONTENT *Content: Represents the<br />
content element. These structures are<br />
destroyed when associated with a page or<br />
form, <strong>and</strong> pointers to them should not be<br />
used after that time.<br />
• ASFixedMatrix *Matrix<br />
void<br />
Exceptions<br />
Header<br />
dli.h<br />
Related Methods<br />
Availability<br />
All <strong>DLI</strong>-supported platforms.<br />
Technical Notes<br />
1 This may be used to simulate an italic or reverse-italic font using a Roman font.
A.14 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfcontentgstate (DLPDFCONTENT *Content,<br />
const PDEGraphicState *newGState)<br />
Return Value: void<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Description<br />
Parameters<br />
Return Value<br />
Sets the graphics state of the specified<br />
DLPDFCONTENT to that of the<br />
PDEGraphicState. This may be done at any<br />
point during content placement operations.<br />
• DLPDFCONTENT* Content: Represents the<br />
document structure <strong>and</strong> the current status of<br />
the document at all times.<br />
• const PDEGraphicState *newGState<br />
void<br />
Exceptions<br />
Header<br />
dli.h<br />
Related Methods<br />
Availability<br />
All <strong>DLI</strong>-supported platforms.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.15<br />
dlpdfcontentline (DLPDFCONTENT *Content,<br />
PDEGraphicState *gState, int PaintOp, ASFixed X1, ASFixed<br />
Y1, ASFixed X2, ASFixed Y2)<br />
Return Value: void<br />
Description<br />
Parameters<br />
Return Value<br />
This procedure will mark a line in the content,<br />
extending from (X1,Y1) to (X2,Y2).<br />
• DLPDFCONTENT *Content: Represents the<br />
content element. These structures are<br />
destroyed when associated with a page or<br />
form, <strong>and</strong> pointers to them should not be<br />
used after that time.<br />
• PDEGraphicState *gState: Contains<br />
definitions of colors to be applied, <strong>and</strong> line<br />
sizes <strong>and</strong> parameters to be used when<br />
drawing a path.<br />
• int PaintOp: A composite of flags which<br />
define how the text will be displayed. It is set<br />
by performing a bitwise OR with the desired<br />
combination of the Adobe PDF Library flag<br />
values kPDEFill, kPDEStroke,<br />
kPDEEoFill <strong>and</strong> kPDEInvisible.<br />
• ASFixed X1: Start X-axis coordinate<br />
• ASFixed Y1: Start Y-axis coordinate<br />
• ASFixed X2: End X-axis coordinate<br />
• ASFixed Y2: End Y-axis coordinate<br />
void<br />
Exceptions<br />
Header<br />
dli.h<br />
Related Methods<br />
Availability<br />
All <strong>DLI</strong>-supported platforms.
A.16 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfcontentpath (DLPDFCONTENT *Content,<br />
PDEGraphicState *gState, int PaintOp, ASFixed *Path, int<br />
PathLen)<br />
Return Value: void<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Description<br />
Parameters<br />
Return Value<br />
This procedure will mark a path within the content.<br />
• DLPDFCONTENT *Content: Represents the<br />
content element. These structures are<br />
destroyed when associated with a page or<br />
form, <strong>and</strong> pointers to them should not be<br />
used after that time.<br />
• PDEGraphicState *gState<br />
• int PaintOp: A composite of flags which<br />
define how the text will be displayed. It is set<br />
by performing a bitwise OR with the desired<br />
combination of the Adobe PDF Library flag<br />
values kPDEFill, kPDEStroke,<br />
kPDEEoFill <strong>and</strong> kPDEInvisible.<br />
• ASFixed *Path: Specifies path<br />
• int PathLen: Specifies path length<br />
void<br />
Exceptions<br />
Header<br />
dli.h<br />
Related Methods<br />
Availability<br />
All <strong>DLI</strong>-supported platforms.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.17<br />
Technical Notes<br />
1 This is in all ways the same path as would be used by the Adobe PDF Library path<br />
operators. Such a path may be created manually or by use of the Edit Layer of the<br />
Adobe PDF Library.<br />
2 If created with the Adobe PDF Library, the pointer returned by<br />
PDEPathGetData is sufficient for this call. The length returned by that call must<br />
be the number of entries in the list, not the size in bytes of the list.
A.18 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfcontentpieslice (DLPDFCONTENT *Content,<br />
PDEGraphicState *gState, int PaintOp, ASFixed X1, ASFixed<br />
Y1, ASFixed Radius, ASFixed Angle1, ASFixed Angle2)<br />
Return Value: void<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Description<br />
Parameters<br />
Return Value<br />
This procedure is included as an aid in graph<br />
construction. It will draw a pie slice, centered at<br />
(X1,Y1), at a radius of Radius, from Angle1<br />
to Angle2, counter-clockwise, where the angles<br />
are specified in degrees.<br />
• DLPDFCONTENT *Content: Represents the<br />
content element. These structures are<br />
destroyed when associated with a page or<br />
form, <strong>and</strong> pointers to them should not be<br />
used after that time.<br />
• PDEGraphicState *gState: Contains<br />
definitions of colors to be applied, <strong>and</strong> line<br />
sizes <strong>and</strong> parameters to be used when<br />
drawing a path.<br />
• int PaintOp: A composite of flags which<br />
define how the text will be displayed. It is set<br />
by performing a bitwise OR with the desired<br />
combination of the Adobe PDF Library flag<br />
values kPDEFill, kPDEStroke,<br />
kPDEEoFill <strong>and</strong> kPDEInvisible.<br />
• ASFixed X1<br />
• ASFixed Y1<br />
• ASFixed Radius<br />
• ASFixed Angle1<br />
• ASFixed Angle2<br />
void<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfcontentpieslicen<br />
All <strong>DLI</strong>-supported platforms.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.19<br />
dlpdfcontentpieslicen (DLPDFCONTENT<br />
*Content, PDEGraphicState *gState, int PaintOp, ASFixed<br />
X1, ASFixed Y1, ASFixed Radius, ASFixed Angle1, ASFixed<br />
Angle2)<br />
Return Value: void<br />
Description<br />
Parameters<br />
Return Value<br />
This procedure is included as an aid in graph<br />
construction. It will draw a pie slice, centered at<br />
(X1,Y1), at a radius of Radius, from Angle1<br />
to Angle2, clockwise, where the angle is specified<br />
in degrees.<br />
• DLPDFCONTENT *Content: Represents the<br />
content element. These structures are<br />
destroyed when associated with a page or<br />
form, <strong>and</strong> pointers to them should not be<br />
used after that time.<br />
• PDEGraphicState *gState: Contains<br />
definitions of colors to be applied, <strong>and</strong> line<br />
sizes <strong>and</strong> parameters to be used when<br />
drawing a path.<br />
• int PaintOp: A composite of flags which<br />
define how the text will be displayed. It is set<br />
by performing a bitwise OR with the desired<br />
combination of the Adobe PDF Library flag<br />
values kPDEFill, kPDEStroke,<br />
kPDEEoFill <strong>and</strong> kPDEInvisible.<br />
• ASFixed X1<br />
• ASFixed Y1<br />
• ASFixed Radius<br />
• ASFixed Angle1<br />
• ASFixed Angle2<br />
void<br />
Exceptions<br />
Header<br />
Related Methods<br />
dli.h<br />
dlpdfcontentpieslice
A.20 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
Availability<br />
All <strong>DLI</strong>-supported platforms.<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.21<br />
dlpdfcontentrect (DLPDFCONTENT *Content,<br />
PDEGraphicState *gState, int PaintOp, ASFixed X, ASFixed<br />
Y, ASFixed Width, ASFixed Height)<br />
Return Value: void<br />
Description<br />
Parameters<br />
Return Value<br />
This procedure marks a rectangle in the content.<br />
It will be located such that its lower left h<strong>and</strong><br />
corner is at (X,Y).<br />
• DLPDFCONTENT *Content: Represents the<br />
content element. These structures are<br />
destroyed when associated with a page or<br />
form, <strong>and</strong> pointers to them should not be<br />
used after that time.<br />
• PDEGraphicState *gState: Contains<br />
definitions of colors to be applied, <strong>and</strong> line<br />
sizes <strong>and</strong> parameters to be used when<br />
drawing a path.<br />
• int PaintOp: A composite of flags which<br />
define how the text will be displayed. It is set<br />
by performing a bitwise OR with the desired<br />
combination of the Adobe PDF Library flag<br />
values kPDEFill, kPDEStroke,<br />
kPDEEoFill <strong>and</strong> kPDEInvisible.<br />
• ASFixed X: The X location of the rectangle.<br />
• ASFixed Y: The Y location of the rectangle.<br />
• ASFixed Width: The width of the<br />
rectangle. This may not be specified as zero,<br />
but may be specified as a negative value,<br />
which results in flopping the rectangle (i.e.<br />
right instead of left).<br />
• ASFixed Height: The height of the<br />
rectangle. This may not be specified as zero,<br />
but may be specified as a negative value,<br />
which results in flopping the rectangle (i.e.<br />
down instead of up).<br />
void<br />
Exceptions
A.22 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
Header<br />
Availability<br />
dli.h<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
All <strong>DLI</strong>-supported platforms.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.23<br />
dlpdfcontentreferenceform (DLPDFCONTENT<br />
*Content, DLPDFFORM *Form, ASFixed X, ASFixed Y,<br />
ASFixed Rotate, ASFixed ScaleX, ASFixed ScaleY)<br />
Return Value: void<br />
Description<br />
Parameters<br />
Return Value<br />
Places a reference to the specified DLPDFFORM<br />
into the specified content structure, with the<br />
lower left corner of the form positioned at<br />
(X,Y), <strong>and</strong> with the specified rotation <strong>and</strong> scaling<br />
factors.<br />
• DLPDFCONTENT *Content: Represents the<br />
content element. These structures are<br />
destroyed when associated with a page or<br />
form, <strong>and</strong> pointers to them should not be<br />
used after that time.<br />
• DLPDFFORM *Form<br />
• ASFixed X: X coordinate for Form<br />
placement<br />
• ASFixed Y: Y coordinate for Form<br />
placement.<br />
• ASFixed Rotate: Degrees to rotate the<br />
form counterclockwise<br />
• ASFixed ScaleX: X-axis Scale Factor. “No<br />
scaling” is represented by the value 1.<br />
• ASFixed ScaleY: Y-axis Scale Factor. “No<br />
scaling” is represented by the value 1.<br />
void<br />
Exceptions<br />
Header<br />
dli.h<br />
Related Methods<br />
Availability<br />
All <strong>DLI</strong>-supported platforms.
A.24 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfcontentreferenceimage<br />
(DLPDFCONTENT *Content, DLPDFIMAGE *Image, ASFixed<br />
X, ASFixed Y, ASFixed Rotate, ASFixed ScaleX, ASFixed<br />
ScaleY)<br />
Return Value: void<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Description<br />
Parameters<br />
Return Value<br />
This procedure places a copy of the referenced<br />
image into the current content.<br />
• DLPDFCONTENT *Content: Represents the<br />
content element. These structures are<br />
destroyed when associated with a page or<br />
form, <strong>and</strong> pointers to them should not be<br />
used after that time.<br />
• DLPDFIMAGE *Image<br />
• ASFixed X: The X-axis location of the<br />
rotation point<br />
• ASFixed Y: The Y-axis location of the<br />
rotation point<br />
• ASFixed Rotate: Amount of<br />
counterclockwise rotation in degrees<br />
• ASFixed ScaleX: X-axis Scale Factor<br />
• ASFixed ScaleY: Y-axis Scale Factor<br />
void<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfimagegetsize (New in <strong>DLI</strong> v2.2.5)<br />
All <strong>DLI</strong>-supported platforms.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.25<br />
Technical Notes<br />
1 The image will be placed so as to align its lower left h<strong>and</strong> corner with the given<br />
(X,Y) location, scaled as per ScaleX <strong>and</strong> ScaleY, <strong>and</strong> rotated as per Rotate.<br />
2 Image rotation, if any, always occurs about its origin, typically the lower-left<br />
corner of the image, <strong>and</strong> the point of rotation is located by the given (X,Y)<br />
location.<br />
3 The Scale Factors will determine the resulting size of the image. You need to know<br />
the original image resolution <strong>and</strong> its intended size in order to determine whether a<br />
Scale Factor on either axis is required. In <strong>DLI</strong> v2.2.5 or higher, the<br />
dlpdfimagegetsize method can retrieve image sizing data for you, <strong>and</strong><br />
dividing the intended print size by the file size for each dimension (delivered by<br />
dlpdfimagegetsize) will yield a Scale Factor ratio which<br />
dlpdfcontentreferenceimage uses to calculate the final output image size.<br />
4 The typical scaling calculation using values returned by dlpdfimagegetsize<br />
would be to divide the intended print size by the image size on each axis (e.g.<br />
"dlpdfcontentreferenceimage(Content, Image,<br />
Int32ToFixed(72), Int32ToFixed(92), 0,<br />
ASFixedDiv(xPoints,Int32ToFixed(xRasters)),<br />
ASFixedDiv(yPoints,Int32ToFixed(yRasters)));").<br />
5 An image in which each pixel of each raster line represents one PDF unit of output<br />
will return the same values for both image dimension (xRasters <strong>and</strong> yRasters)<br />
<strong>and</strong> print size (xPoints <strong>and</strong> yPoints), <strong>and</strong> thus a Scale Factor of 1 on both<br />
axes.
A.26 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfcontentrotate (DLPDFCONTENT *Content,<br />
ASFixed Rotate)<br />
Return Value: void<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Description<br />
Parameters<br />
Return Value<br />
Rotates all of the contents of a given content<br />
structure by the specified amount.<br />
• DLPDFCONTENT *Content: Represents the<br />
content element. These structures are<br />
destroyed when associated with a page or<br />
form, <strong>and</strong> pointers to them should not be<br />
used after that time.<br />
• ASFixed Rotate: May be any amount, but<br />
will be reduced to between 0 <strong>and</strong> 360<br />
degrees. Considered to be in degrees of<br />
counterclockwise rotation about the content<br />
structure’s lower left corner.<br />
void<br />
Exceptions<br />
Header<br />
dli.h<br />
Related Methods<br />
Availability
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.27<br />
dlpdfcontentscale (DLPDFCONTENT *Content,<br />
ASFixed XScale, ASFixed YScale)<br />
Return Value: void<br />
Description<br />
Parameters<br />
Return Value<br />
Scales all of the content of a given content structure<br />
by the specified amount.<br />
• DLPDFCONTENT *Content: Represents the<br />
content element. These structures are<br />
destroyed when associated with a page or<br />
form, <strong>and</strong> pointers to them should not be<br />
used after that time.<br />
• ASFixed XScale: X-axis scale factor, a<br />
positive number greater than 0.0001.<br />
• ASFixed YScale: Y-axis scale factor, a<br />
positive number greater than 0.0001.<br />
void<br />
Exceptions<br />
Header<br />
dli.h<br />
Related Methods<br />
Availability<br />
All <strong>DLI</strong>-supported platforms.
A.28 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfcontenttext (DLPDFCONTENT *Content,<br />
DLPDFFONT *Font, char *str, PDEGraphicState *gState,<br />
PDETextState *tState, ASFixed pointSize, ASFixed setWidth,<br />
ASFixed XPos, ASFixed YPos, ASFixed Rotate)<br />
Return Value: void<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Description<br />
Parameters<br />
Adds a NULL-terminated string of text to the<br />
content. It will be placed such that the baseline<br />
of the left edge of the first character aligns to<br />
the position (XPos,YPos) in points.<br />
• DLPDFCONTENT *Content: Represents the<br />
content element. These structures are<br />
destroyed when associated with a page or<br />
form, <strong>and</strong> pointers to them should not be<br />
used after that time.<br />
• DLPDFFON *Font: Reflects the font. It is<br />
created by dlpdffontcreate on a perdocument<br />
basis, <strong>and</strong> may only be used within<br />
the document it was created in. Fonts are<br />
tracked within the document <strong>and</strong> destroyed<br />
when the document is destroyed. Pointers to<br />
fonts are invalid after the destruction of their<br />
document.<br />
• char *str: Text string<br />
• PDEGraphicState *gState: Contains<br />
definitions of colors to be applied, <strong>and</strong> line<br />
sizes <strong>and</strong> parameters to be used when<br />
drawing a path.<br />
• PDETextState *tState: The current text<br />
state. This should not be NULL. A zero-filled<br />
PDETextState parameter is permitted.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.29<br />
Parameters (Continued)<br />
Return Value<br />
• ASFixed pointSize: Point size<br />
• ASFixed setWidth: Set width<br />
• ASFixed XPos: Position along the X axis<br />
where the baseline of the left edge of the first<br />
character will be aligned.<br />
• ASFixed YPos: Position along the Y axis<br />
where the baseline of the left edge of the first<br />
character will be aligned.<br />
• ASFixed Rotate: Angle at which the<br />
baseline should proceed, where zero is to the<br />
right <strong>and</strong> positive numbers express<br />
counterclockwise rotation in degrees.<br />
void<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfcontenttextwidth,<br />
dlpdfcontentwidetext,<br />
dlpdfcontentwidetextwidth<br />
All <strong>DLI</strong>-supported platforms.
A.30 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfcontenttextwidth (DLPDFFONT *Font, char<br />
*Text, ASFixed SetWidth, PDETextState *TState)<br />
Return Value: ASFixed<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Description<br />
Parameters<br />
Return Value<br />
Returns the width (in points) of the specified<br />
Text set in the specified Font with the specified<br />
SetWidth. The fourth parameter is an optional<br />
Current Text State, which may be NULL.<br />
• DLPDFFONT *Font: The specified font<br />
• char *Text: The specified text<br />
• ASFixed SetWidth: The specified width<br />
• PDETextState *TState: The current text<br />
state. This may be NULL. A zero-filled<br />
PDETextState parameter is also permitted.<br />
ASFixed<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfcontenttext,<br />
dlpdfcontentwidetext,<br />
dlpdfcontentwidetextwidth<br />
All <strong>DLI</strong>-supported platforms.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.31<br />
dlpdfcontenttopage (DLPDFCONTENT *Content,<br />
DLPDFPAGE *Page)<br />
Return Value: void<br />
Description<br />
Parameters<br />
Return Value<br />
This procedure will make the markings placed<br />
into content a part of the specified page. Following<br />
this call, the content structure no longer<br />
exists; pointers to it are invalid <strong>and</strong> should not<br />
be used.<br />
• DLPDFCONTENT *Content: Represents the<br />
content element. This structure is destroyed<br />
when associated with a page or form, <strong>and</strong><br />
pointers to them should not be used after that<br />
time.<br />
• DLPDFPAGE *Page: Represents a page. This<br />
structure is tracked within the package <strong>and</strong><br />
destroyed when the document is destroyed.<br />
Pointers to this structure remain valid until<br />
the document is destroyed.<br />
void<br />
Exceptions<br />
Header<br />
dli.h<br />
Related Methods<br />
Availability<br />
All <strong>DLI</strong>-supported platforms.
A.32 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfcontenttranslate (DLPDFCONTENT<br />
*Content, ASFixed X, ASFixed Y)<br />
Return Value: void<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Description<br />
Parameters<br />
Return Value<br />
Moves all the contents of a content structure by<br />
the specified amounts.<br />
• DLPDFCONTENT *Content: Represents the<br />
content element. These structures are<br />
destroyed when associated with a page or<br />
form, <strong>and</strong> pointers to them should not be<br />
used after that time.<br />
• ASFixed X: The X-axis amount by which<br />
content structure will be moved, in points.<br />
Positive X values move right; negative X<br />
values move left.<br />
• ASFixed Y: The Y-axis amount by which<br />
content structure will be moved, in points.<br />
Positive Y values move up; negative Y values<br />
move down.<br />
void<br />
Exceptions<br />
Header<br />
dli.h<br />
Related Methods<br />
Availability<br />
All <strong>DLI</strong>-supported platforms.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.33<br />
dlpdfcontentusefillpattern (DLPDFCONTENT<br />
*Content, DLPDFPATTERN *Pattern)<br />
Return Value: void<br />
Description<br />
Parameters<br />
Return Value<br />
Applies the fill pattern.<br />
• DLPDFCONTENT *Content: Represents the<br />
content element. These structures are<br />
destroyed when associated with a page or<br />
form, <strong>and</strong> pointers to them should not be<br />
used after that time.<br />
• DLPDFPATTERN *Pattern: If this is NULL,<br />
the patterned color space will be turned Off.<br />
void<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfpatterncreate,<br />
dlpdfcontentusestrokepattern<br />
All <strong>DLI</strong>-supported platforms.
A.34 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfcontentusestrokepattern<br />
(DLPDFCONTENT *Content, DLPDFPATTERN *Pattern)<br />
Return Value: void<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Description<br />
Parameters<br />
Similar to dlpdfcontentusefillpattern,<br />
but strokes instead of filling.<br />
• DLPDFCONTENT *Content: Represents the<br />
content element. These structures are<br />
destroyed when associated with a page or<br />
form, <strong>and</strong> pointers to them should not be<br />
used after that time.<br />
• DLPDFPATTERN *Pattern<br />
Return Value<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfcontentusefillpattern<br />
All <strong>DLI</strong>-supported platforms.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.35<br />
dlpdfcontentwidetext (DLPDFCONTENT<br />
*Content, DLPDFFONT *Font, char *str, int Length,<br />
PDEGraphicState *gState, PDETextState *tState, ASFixed PS,<br />
ASFixed SW, ASFixed X, ASFixed Y, ASFixed Rotate)<br />
Return Value: void<br />
Description<br />
Parameters<br />
Return Value<br />
Same as dlpdfcontenttext, but permits<br />
Unicode <strong>and</strong> MultiByte text.<br />
• DLPDFCONTENT *Content: Represents the<br />
content element. These structures are<br />
destroyed when associated with a page or<br />
form, <strong>and</strong> pointers to them should not be<br />
used after that time.<br />
• DLPDFFON *Font<br />
• char *str: A text string<br />
• int Length<br />
• PDEGraphicState *gState: Contains<br />
definitions of colors to be applied, <strong>and</strong> line<br />
sizes <strong>and</strong> parameters to be used when<br />
drawing a path.<br />
• PDETextState *tState: The current text<br />
state. This may be NULL. A zero-filled<br />
PDETextState parameter is also permitted.<br />
• ASFixed PS: Point Size scale factor along<br />
the Y axis (vertical). 1 = no scaling (2 =<br />
double the original size, 0.5 = ½ the original<br />
size, etc...)<br />
• ASFixed SW: Set Width scale factor along<br />
the X axis (horizontal). 1 = no scaling.<br />
• ASFixed X: X coordinate of the lower left<br />
corner of the bounding box for the text<br />
• ASFixed Y: Y coordinate of the lower left<br />
corner of the bounding box for the text<br />
• ASFixed Rotate: Angle of rotation. 0 = no<br />
rotation.<br />
void<br />
Exceptions
A.36 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
Header<br />
dli.h<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Related Methods<br />
dlpdfcontenttext,<br />
dlpdfcontenttextwidth,<br />
dlpdfcontentwidetextwidth<br />
Availability<br />
All <strong>DLI</strong>-supported platforms.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.37<br />
Technical Notes<br />
1 Double-byte NULL values acting as Unicode string terminators are not required,<br />
<strong>and</strong>, if present, are not included in any Unicode string length calculations.
A.38 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfcontentwidetextwidth (DLPDFFONT<br />
*Font, char *string, int Length, ASFixed SetWidth,<br />
PDETextState *TState, PDEGraphicState *GState)<br />
Return Value: ASFixed<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Description<br />
Parameters<br />
Return Value<br />
Same as dlpdfcontenttextwidth, but<br />
permits multi-byte (Unicode) text.<br />
• DLPDFFONT *Font<br />
• char *string<br />
• int Length<br />
• ASFixed SetWidth<br />
• PDETextState *TState: The current text<br />
state. This should not be NULL. A zero-filled<br />
PDETextState parameter is permitted.<br />
• PDEGraphicState *GState: Contains<br />
definitions of colors to be applied, <strong>and</strong> line<br />
sizes <strong>and</strong> parameters to be used when<br />
drawing a path.<br />
ASFixed<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfcontenttext,<br />
dlpdfcontenttextwidth,<br />
dlpdfcontentwidetext<br />
All <strong>DLI</strong>-supported platforms.<br />
Technical Notes<br />
1 Double-byte NULL values acting as Unicode string terminators are not required,<br />
<strong>and</strong>, if present, are not included in any Unicode string length calculations.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.39<br />
dlpdfdocasciips (DLPDFDOC *Doc)<br />
Return Value: void<br />
Description<br />
Parameters<br />
Return Value<br />
This method supports creation of PostScript<br />
output suitable for transmission through channels<br />
<strong>and</strong> to devices which do not accept binary<br />
data. Most PostScript printers cannot properly<br />
process binary PostScript input, although Distiller<br />
<strong>and</strong> most print spoolers will accept binary<br />
PostScript data.<br />
DLPDFDOC *Doc: Represents the document<br />
structure <strong>and</strong> the current status of the document<br />
at all times.<br />
void<br />
Exceptions<br />
Header<br />
dli.h<br />
Related Methods<br />
Availability<br />
All <strong>DLI</strong>-supported platforms.
A.40 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfdoccomplete (DLPDFDOC *Doc)<br />
Return Value: void<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Description<br />
Parameters<br />
Return Value<br />
Completes the page tree for a document <strong>and</strong><br />
creates specified thumbnails. It is called internally<br />
by dlpdfdocwritepdf <strong>and</strong> dlpdfdocwritePS,<br />
<strong>and</strong> may be manually called to<br />
write the document using other interface elements<br />
(e.g. writing to a custom file system), or<br />
as a method of imaging pages prior to writing<br />
the document.<br />
DLPDFDOC *Doc: Represents the document<br />
structure <strong>and</strong> the current status of the document<br />
at all times.<br />
void<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfdocwritepdf,<br />
dlpdfdocwritePS<br />
All <strong>DLI</strong>-supported platforms.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.41<br />
dlpdfdoccompress (DLPDFDOC *Doc)<br />
Return Value: void<br />
Description<br />
Parameters<br />
Return Value<br />
Turns compression On (by default, it is Off) for<br />
text streams used within the PDF document.<br />
When on, Flate compression will be used on all<br />
textual content, images <strong>and</strong> forms. This method<br />
should be called before any content is placed<br />
onto a page. Content placed prior to this call<br />
will not be compressed.<br />
DLPDFDOC *Doc: Represents the document<br />
structure <strong>and</strong> the current status of the document<br />
at all times.<br />
void<br />
Exceptions<br />
Header<br />
dli.h<br />
Related Methods<br />
Availability<br />
All <strong>DLI</strong>-supported platforms.
A.42 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfdoccosdoc (DLPDFDOC *Doc)<br />
Return Value: CosDoc<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Description<br />
Parameters<br />
Return Value<br />
Used with the COS layer of the Adobe PDF<br />
Library to accomplish functions outside <strong>DLI</strong>.<br />
DLPDFDOC *Doc: Represents the document<br />
structure <strong>and</strong> the current status of the document<br />
at all times.<br />
CosDoc: Reflects the constructed document<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfdocpddoc,<br />
dlpdfdoccomplete<br />
All <strong>DLI</strong>-supported platforms.<br />
Technical Notes<br />
1 The COS form of the document must not be used in any way that accesses pages<br />
prior to writing the document or calling dlpdfdoccomplete. Prior to those<br />
calls, the page tree is not complete.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.43<br />
dlpdfdoccreate (DLPDFINSTANCE *instance)<br />
Return Value: DLPDFDOC *<br />
Description<br />
Parameters<br />
Creates a new, empty document.<br />
DLPDFINSTANCE *instance: The DLPD-<br />
FINSTANCE to use for the document<br />
Return Value DLPDFDOC *<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
genErrBadParam<br />
dli.h<br />
dlpdfdocdestroy,<br />
dlpdfdocsetpsname,<br />
dlpdfdocwritePS (See Technical Notes<br />
below)<br />
All <strong>DLI</strong>-supported platforms.<br />
Technical Notes<br />
1 Processing is much faster if the Adobe PDF Library is not invoked; however, the<br />
Library must be invoked if PDF <strong>and</strong> PostScript are to be created.<br />
2 See the Adobe API <strong>Reference</strong> <strong>Guide</strong> for information on Adobe PostScript support.<br />
3 As of <strong>DLI</strong> v3.0, this call no longer accepts a PostScript filename. (Use<br />
dlpdfdocsetpsname, or supply one to dlpdfdocwritePS.) The PDFNeeded<br />
flag has been removed; PDF processing is always performed.
A.44 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfdoccreatesignature (DLPDFDOC *Doc,<br />
dlpdfsigh<strong>and</strong>ler sigType, char *nameStr, char *reasonStr,<br />
char *locationStr)<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Return Value: DLPDFSIGNATURE *<br />
Description<br />
Parameters<br />
This call creates a digital signature object for<br />
the <strong>DLI</strong> document being created.<br />
• DLPDFDOC *Doc: The document for which<br />
the signature object will be created<br />
• dlpdfsigh<strong>and</strong>ler sigType: The<br />
signature type, one of dlpdfsigacrox509,<br />
dlpdfsigacropkcs7 or<br />
dlpdfsigverisign; see Technical Notes<br />
below.<br />
• char *nameStr: (Optional) Signatory<br />
Name<br />
• char *reasonStr: (Optional) Reason for<br />
signing (e.g. Initial Release; Document<br />
Revision)<br />
• char *locationStr: (Optional) Location<br />
of the signatory<br />
Return Value DLPDFSIGNATURE *<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfdocsetsignatureappearance<br />
dlpdfpageplacesignature<br />
All <strong>DLI</strong>-supported platforms.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.45<br />
Technical Notes<br />
1 The sigType is one of:<br />
• dlpdfsigacrox509 (Adobe self-sign plug-in compatible with an x.509 v3<br />
certificate)<br />
• dlpdfsigacropkcs7 (Adobe self-sign plug-in compatible with a PKCS #7<br />
certificate)<br />
• dlpdfsigverisign (VeriSign signature plug-in compatible with a PKCS #7<br />
certificate)
A.46 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfdocdestroy (DLPDFDOC *Doc)<br />
Return Value: void<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Description<br />
Parameters<br />
Return Value<br />
Destroys the specified document, releasing all<br />
resources used in the document.<br />
DLPDFDOC *Doc: represents the document<br />
structure <strong>and</strong> the current status of the document<br />
at all times.<br />
void<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfdoccreate,<br />
dlpdfinstancesetgrcachelimits<br />
All <strong>DLI</strong>-supported platforms.<br />
Technical Notes<br />
1 All documents should be destroyed before terminating <strong>DLI</strong>.<br />
2 A pointer to a DLPDFDOC structure is invalid <strong>and</strong> should not be used after calling<br />
dlpdfdocdestroy for that structure.<br />
3 The collection of information regarding where elements lie within a document is<br />
the responsibility of the composition engine. <strong>DLI</strong> cannot provide assistance with<br />
this.<br />
4 If dlpdfinstancesetgrcachelimits had been set previously, the graphics<br />
cache size is evaluated at this time, <strong>and</strong> graphics are purged if the cache size<br />
exceeds its preset high-water mark limit.<br />
5 If applicable, dlpdfdocdestroy removes the Files In Memory file representing<br />
the <strong>DLI</strong> document if no h<strong>and</strong>le has been acquired to the file in memory.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.47<br />
dlpdfdocembedfonts (DLPDFDOC *Doc)<br />
Return Value: void<br />
Description<br />
Parameters<br />
Return Value<br />
This call will set the input document to embed<br />
<strong>and</strong> subset all fonts which are present on the<br />
system when created, regardless of the font call<br />
used to create them. Fonts created with dlpdffontcreateembedded<br />
or dlpdffontcreatewithmetricsembedded<br />
with the<br />
Subset parameter set to FALSE will be fully<br />
embedded after calling this function (license<br />
permitting; see Technical Notes below).<br />
DLPDFDOC *Doc: The document for which to<br />
embed all fonts<br />
void<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdffontcreateembedded,<br />
dlpdffontcreatewithmetricsembedded<br />
All <strong>DLI</strong>-supported platforms.<br />
Technical Notes<br />
1 If a font is available but not licensed for embedding, it will be created as a<br />
referenced font rather than an embedded font. An exception is not returned for<br />
this condition, but the NotEmbedded flag of the DLPDFFONT structure can be<br />
inspected after the dlpdfdocembedfonts call, if desired.
A.48 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfdocencrypt (DLPDFDOC *Doc, char *UserPW,<br />
char *OwnerPW, PDPerms Permissions)<br />
Return Value: void<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Description<br />
Parameters<br />
Return Value<br />
Applies the Adobe PDF Library st<strong>and</strong>ard security<br />
mechanism to the document, using the permissions<br />
specified in the Permissions<br />
parameter as outlined in the Acrobat Core API<br />
<strong>Reference</strong> Manual in the PDPerms definition<br />
on page 2101.<br />
• DLPDFDOC *Doc: Represents the document<br />
structure <strong>and</strong> the current status of the<br />
document at all times.<br />
• char *UserPW: (Case sensitive) string for<br />
User Password<br />
• char *OwnerPW: (Case sensitive) string for<br />
Owner Password<br />
• PDPerm Permissions<br />
void<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfdocsetencryptkeylen<br />
Adobe PDF Library v4.05 <strong>and</strong> higher; all <strong>DLI</strong>supported<br />
platforms.<br />
Technical Notes<br />
1 Both Owner Password <strong>and</strong> User Password are case-sensitive. Either password will<br />
allow viewing of the document, but only the Owner can modify its Security<br />
settings.<br />
2 This call may be made at any time prior to dlpdfdocwritepdf.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.49<br />
dlpdfdoclinearize (DLPDFDOC *Doc)<br />
Return Value: void<br />
Description<br />
Parameters<br />
Return Value<br />
Instructs <strong>DLI</strong> to linearize any PDF output created<br />
from this document, regardless of the setting<br />
of the linearization flag used at document<br />
output time.<br />
DLPDFDOC *Doc: Represents the document<br />
structure <strong>and</strong> the current status of the document<br />
at all times.<br />
void<br />
Exceptions<br />
Header<br />
dli.h<br />
Related Methods<br />
Availability<br />
All <strong>DLI</strong>-supported platforms.<br />
Technical Notes<br />
1 This is included in support of document processing systems which know the<br />
desired result of document creation at the start of document processing, but which<br />
may not retain that knowledge until the end of processing.
A.50 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfdocmakethumbnails (DLPDFDOC *Doc)<br />
Return Value: void<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Description<br />
Parameters<br />
Return Value<br />
Instructs the application to create thumbnail<br />
page images. These will be added to all pages<br />
when the file is written to PDF.<br />
DLPDFDOC *Doc: Represents the document<br />
structure <strong>and</strong> the current status of the document<br />
at all times.<br />
void<br />
Exceptions<br />
Header<br />
dli.h<br />
Related Methods<br />
Availability<br />
Adobe PDF Library v4.05 <strong>and</strong> later; all <strong>DLI</strong>supported<br />
platforms.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.51<br />
dlpdfdocnameadd (DLPDFDOC *Doc, char<br />
*TreeName, char *Name, CosObj Dest)<br />
Return Value: void<br />
Description<br />
Parameters<br />
Return Value<br />
Adds a new name <strong>and</strong> an associated destination<br />
(as a COS structure) to the name tree, which<br />
will be named as defined in TreeName.<br />
“Dests” is the default TreeName value, which<br />
is assumed if NULL is used.<br />
• DLPDFDOC *Doc: Represents the document<br />
structure <strong>and</strong> the current status of the<br />
document at all times.<br />
• char *TreeName: TreeName string, or<br />
NULL for default TreeName.<br />
• char *Name: Name string<br />
• CosObj Dest<br />
void<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfdocnamefind<br />
All <strong>DLI</strong>-supported platforms.
A.52 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfdocnamefind (DLPDFDOC *Doc, char<br />
*TreeName, char *Name,)<br />
Return Value: CosObj<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Description<br />
Parameters<br />
Return Value<br />
Locates a name in the tree, <strong>and</strong> returns its associated<br />
COS structure.<br />
• DLPDFDOC *Doc: Represents the document<br />
structure <strong>and</strong> the current status of the<br />
document at all times.<br />
• char *TreeName: TreeName string, or<br />
NULL for default TreeName<br />
• char *Name: Name string<br />
CosObj<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfdocnameadd<br />
All <strong>DLI</strong>-supported platforms.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.53<br />
dlpdfdocoutline (DLPDFDOC *Doc)<br />
Return Value: DLPDFOUTLINE*<br />
Description<br />
Parameters<br />
Return Value<br />
Returns a pointer to the root outline node. This<br />
node contains no text; it is used simply as a container<br />
for nodes at the root layer. If there are no<br />
outlines, this pointer will be NULL.<br />
DLPDFDOC *Doc: Represents the document<br />
structure <strong>and</strong> the current status of the document<br />
at all times.<br />
DLPDFOUTLINE*<br />
Exceptions<br />
Header<br />
dli.h<br />
Related Methods<br />
Availability<br />
All <strong>DLI</strong>-supported platforms.
A.54 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfdocoutlineadd (DLPDFDOC *Doc,<br />
DLPDFOUTLINE *Parent, DLPDFOUTLINE *Before, char<br />
*Text, int Open, long PageNumber, char *Fit, ASFixedRect<br />
*Where, ASFixed Zoom)<br />
Return Value: DLPDFOUTLINE*<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Description<br />
Parameters<br />
Creates an outline structure within the document<br />
specified.<br />
• DLPDFDOC *Doc: Specifies the document in<br />
which the new outline will reside<br />
• DLPDFOUTLINE *Parent: If specified, the<br />
new outline structure will be contained<br />
within the parent. If not specified, the new<br />
outline structure will be placed within the<br />
root node.<br />
• DLPDFOUTLINE *Before: If specified, the<br />
new outline entry will be positioned directly<br />
after the previous outline entry given. If not<br />
specified, the new entry will be created as the<br />
last within the parent or root.<br />
• char *Text: Text that will appear in the<br />
displayed outline <strong>and</strong> which must be<br />
specified<br />
• int Open: A Boolean operator: if TRUE, the<br />
entry will be open <strong>and</strong> its children will be<br />
displayed; if FALSE, it will be closed.<br />
• long PageNumber: The zero-relative<br />
number of the page to which this link<br />
connects<br />
• char *Fit: valid PDF fit type expressed as<br />
a string.<br />
• ASFixedRect *Where: location of the<br />
rectangle to be displayed. Only portions are<br />
used, based on the Fit Type specified in<br />
Fit.<br />
• ASFixed Zoom: factor by which the size of<br />
the display should be increased or decreased.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.55<br />
Return Value<br />
DLPDFOUTLINE*: Internal structure that<br />
reflects the outline entry<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfdocoutlineaddfromname,<br />
dlpdfdocoutlinecosobj,<br />
dlpdfdocoutlinefirst,<br />
dlpdfdocoutlinelast,<br />
dlpdfdocoutlinenext,<br />
dlpdfdocoutlineparent,<br />
dlpdfdocoutlineprev<br />
All <strong>DLI</strong>-supported platforms.<br />
Technical Notes<br />
1 Only internal destinations (within the same document) are supported by this<br />
method.<br />
2 Valid Fit Type values are “Fit”, “FitH”, “FitV”, “FitBH”, “FitBV”,<br />
“FitR”, “FitB”, <strong>and</strong> “XYZ”. See the Adobe PDF Library <strong>Reference</strong> <strong>Guide</strong> for<br />
explanations of the meaning of each fit type <strong>and</strong> which values of rectangle <strong>and</strong><br />
zoom are used for each.<br />
3 If nested outlines are desired, these structures should be saved by the application.<br />
They will be destroyed automatically when the document is destroyed <strong>and</strong> may<br />
not be accessed after that time. Their contents must not be modified, as they are<br />
maintained within the package.<br />
4 Zero values in the rectangle will behave as PDViewNull values, as will a zero<br />
value for Zoom.<br />
5 The most common values used are XYZ as the fit type, Zero for Zoom, <strong>and</strong> the<br />
(X,Y) coordinates of the upper left h<strong>and</strong> edge of the desired target text in<br />
Where.top <strong>and</strong> Where.left. This will change to the target page <strong>and</strong> position<br />
the specified text so it is within the display window, leaving the Magnification<br />
factor where the user last set it.
A.56 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfdocoutlineaddfromname (DLPDFDOC<br />
*Doc, DLPDFOUTLINE *Parent, DLPDFOUTLINE *Before, char<br />
*Text, int Open, char *DestName)<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Return Value: DLPDFOUTLINE*<br />
Description<br />
Parameters<br />
Return Value<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
Adds a new outline entry using the named destination,<br />
rather than a specified document.<br />
• DLPDFDOC *Doc: Represents the document<br />
structure <strong>and</strong> the current status of the<br />
document at all times.<br />
• DLPDFOUTLINE *Parent<br />
• DLPDFOUTLINE *Before<br />
• char *Text: Text string<br />
• int Open<br />
• char *DestName: String for destination<br />
name<br />
DLPDFOUTLINE*<br />
dlpdfdocoutlineadd,<br />
dlpdfdocoutlinecosobj,<br />
dlpdfdocoutlinefirst,<br />
dlpdfdocoutlinelast,<br />
dlpdfdocoutlinenext,<br />
dlpdfdocoutlineparent,<br />
dlpdfdocoutlineprev<br />
dli.h<br />
dlpdfdocoutlineadd<br />
All <strong>DLI</strong>-supported platforms.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.57<br />
dlpdfdocoutlinecosobj (DLPDFOUTLINE *Outline)<br />
Return Value: CosObj<br />
Description<br />
Parameters<br />
Return Value<br />
Returns the COS structure that is the outline<br />
entry. It may be modified by the user to accomplish<br />
actions other than those specified by this<br />
package.<br />
DLPDFOUTLINE *Outline<br />
CosObj<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfdocoutline<br />
All <strong>DLI</strong>-supported platforms.<br />
Technical Notes<br />
1 Only the Title, Dest, A (Action), or AA (Additional Action) keys should be<br />
modified. Modification of other keys may result in invalid documents.
A.58 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfdocoutlinefirst (DLPDFOUTLINE *Outline)<br />
Return Value: DLPDFOUTLINE*<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Description<br />
Parameters<br />
Return Value<br />
Returns a pointer to the first child outline of the<br />
specified outline<br />
DLPDFOUTLINE *Outline<br />
DLPDFOUTLINE*<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfdocoutlinelast,<br />
dlpdfdocoutlinenext,<br />
dlpdfdocoutlineparent,<br />
dlpdfdocoutlineprev<br />
All <strong>DLI</strong>-supported platforms.<br />
Technical Notes<br />
1 If the specified outline contains no children, this method will return a NULL.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.59<br />
dlpdfdocoutlinelast (DLPDFOUTLINE *Outline)<br />
Return Value: DLPDFOUTLINE*<br />
Description<br />
Parameters<br />
Return Value<br />
Returns a pointer to the last child outline of a<br />
specified outline node. If the node contains no<br />
children, this method will return a NULL.<br />
DLPDFOUTLINE *Outline<br />
DLPDFOUTLINE*<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfdocoutlinefirst,<br />
dlpdfdocoutlinenext,<br />
dlpdfdocoutlineparent,<br />
dlpdfdocoutlineprev<br />
All <strong>DLI</strong>-supported platforms.
A.60 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfdocoutlinenext (DLPDFOUTLINE *Outline)<br />
Return Value: DLPDFOUTLINE*<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Description<br />
Parameters<br />
Return Value<br />
Returns a pointer to the outline node that follows<br />
the specified node<br />
DLPDFOUTLINE *Outline<br />
DLPDFOUTLINE*<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfdocoutlinefirst,<br />
dlpdfdocoutlinelast,<br />
dlpdfdocoutlineparent,<br />
dlpdfdocoutlineprev<br />
All <strong>DLI</strong>-supported platforms.<br />
Technical Notes<br />
1 If the specified node is the last within its parent, this method will return a NULL.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.61<br />
dlpdfdocoutlineparent (DLPDFOUTLINE<br />
*Outline)<br />
Return Value: DLPDFOUTLINE*<br />
Description<br />
Parameters<br />
Return Value<br />
Returns a pointer to the parent of the specified<br />
node<br />
DLPDFOUTLINE *Outline<br />
DLPDFOUTLINE*<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfdocoutlinefirst,<br />
dlpdfdocoutlinelast,<br />
dlpdfdocoutlinenext,<br />
dlpdfdocoutlineprev<br />
All <strong>DLI</strong>-supported platforms.<br />
Technical Notes<br />
1 If this node is the root node, this method will return a NULL.
A.62 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfdocoutlineprev (DLPDFOUTLINE *Outline)<br />
Return Value: DLPDFOUTLINE*<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Description<br />
Parameters<br />
Return Value<br />
Returns a pointer to the outline node that precedes<br />
this node within its container.<br />
DLPDFOUTLINE *Outline<br />
DLPDFOUTLINE*<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfdocoutlinefirst,<br />
dlpdfdocoutlinelast,<br />
dlpdfdocoutlinenext,<br />
dlpdfdocoutlineparent<br />
All <strong>DLI</strong>-supported platforms.<br />
Technical Notes<br />
1 If this is the first node in the container, this node will return a NULL.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.63<br />
dlpdfdocpddoc (DLPDFDOC *Doc)<br />
Return Value: PDDoc<br />
Description<br />
Parameters<br />
Return Value<br />
Used with the PD Layer of the Adobe PDF<br />
Library to accomplish functions outside of <strong>DLI</strong>.<br />
DLPDFDOC *Doc represents the document<br />
structure <strong>and</strong> the current status of the document<br />
at all times.<br />
PDDoc reflects the constructed document.<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfdoccosdoc<br />
All <strong>DLI</strong>-supported platforms.<br />
Technical Notes<br />
1 The PDDoc must not be used in any way prior to calling dlpdfdocwritepdf,<br />
dlpdfdocwritePS or dlpdfdoccomplete. Prior to those calls, the page tree is<br />
not complete.
A.64 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfdocsetdocinfo (DLPDFDOC *Doc, ASAtom<br />
Field, char *Value)<br />
Return Value: void<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Description<br />
Parameters<br />
Return Value<br />
Creates or replaces an entry in the document’s<br />
DocInfo directory<br />
• DLPDFDOC *Doc: Represents the document<br />
structure <strong>and</strong> the current status of the<br />
document at all times.<br />
• ASAtom Field: Any name is valid,<br />
although only certain names have meaning to<br />
PDF readers<br />
• char *Value: A string pair<br />
void<br />
Exceptions<br />
Header<br />
dli.h<br />
Related Methods<br />
Availability<br />
All <strong>DLI</strong>-supported platforms.<br />
Technical Notes<br />
1 This method may be called at any time.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.65<br />
dlpdfdocsetencoding (DLPDFDOC *Doc, ASAtom<br />
Encoding)<br />
Return Value: void<br />
Description<br />
Parameters<br />
Return Value<br />
Exceptions<br />
Header<br />
Sets the default encoding for fonts used within<br />
the document.<br />
• DLPDFDOC *Doc: Represents the document<br />
structure <strong>and</strong> the current status of the<br />
document at all times.<br />
• ASAtom Encoding: Valid values are<br />
ASAtoms containing<br />
“MacRomanEncoding”,<br />
“MacExpertEncoding” or<br />
“WinAnsiEncoding”. A NULL ASAtom, as<br />
returned by the ASAtomNull function, is<br />
also allowed, meaning “St<strong>and</strong>ard”<br />
encoding<br />
void<br />
genErrBadParam: Raised if any encoding<br />
value other than the values specified above (or a<br />
NULL document pointer) is passed to this function.<br />
dli.h<br />
Related Methods<br />
Availability<br />
All <strong>DLI</strong>-supported platforms.
A.66 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfdocsetencryptkeylen (DLPDFDOC *Doc,<br />
unsigned int KeyLenBytes)<br />
Return Value: void<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Description<br />
Parameters<br />
Return Value<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
Enables variable-length encryption keys as supported<br />
by the Adobe PDF Library.<br />
• DLPDFDOC *Doc: Represents the document<br />
structure <strong>and</strong> the current status of the<br />
document at all times.<br />
• unsigned int KeyLenBytes: The<br />
desired encryption key length in bytes, from<br />
5 to 15 inclusive<br />
void<br />
This function itself throws no specific exceptions,<br />
but the underlying functions within the<br />
Adobe PDF Library may throw exceptions.<br />
dli.h<br />
dlpdfdocencrypt<br />
All <strong>DLI</strong>-supported platforms.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.67<br />
Technical Notes<br />
1 For more information on Encryption, please refer to the beginning of section 3.5<br />
in the Adobe PDF Specification <strong>Guide</strong>. For information on<br />
PDDocSetNewSecurityData <strong>and</strong> StdSecurityDataRec, see the Adobe<br />
Core API <strong>Reference</strong> <strong>Guide</strong>.<br />
2 This function can be called to set the length of the encryption key before a call to<br />
dlpdfdocencrypt, if the application requires an encryption key length other<br />
than the original 40-bit length of previous versions.<br />
3 This function is optional if the original 40-bit key length will be used. Subsequent<br />
calls to dlpdfdocencrypt will use the number of bytes specified in the call to<br />
dlpdfdocsetencryptkeylen. If the key length has not been set previously, the<br />
st<strong>and</strong>ard 5-byte value is used as the default.<br />
4 For applications generating multiple documents, dlpdfdocsetencryptkeylen<br />
must be called for each document for which an encryption key length other than<br />
the st<strong>and</strong>ard 5-byte value is desired.
A.68 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfdocsetpdfname (DLPDFDOC *Doc, char<br />
*Name)<br />
Return Value: void<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Description<br />
Parameters<br />
Return Value<br />
Saves the desired location of a PDF file which<br />
results from this document.<br />
• DLPDFDOC *Doc: Represents the document<br />
structure <strong>and</strong> the current status of the<br />
document at all times.<br />
• char *Name: This name will be used in<br />
place of any name specified in a<br />
dlpdfdocwritepdf procedure call.<br />
void<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfdocsetpsname<br />
All <strong>DLI</strong>-supported platforms.<br />
Technical Notes<br />
1 This is included in support of document processing systems which know the<br />
desired result of document creation at the start of document processing, but which<br />
may not retain that knowledge until the end of processing.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.69<br />
dlpdfdocsetpsname (DLPDFDOC *Doc, char<br />
*Name)<br />
Return Value: void<br />
Description<br />
Parameters<br />
Return Value<br />
Saves the desired location of a PostScript file<br />
which results from this document.<br />
• DLPDFDOC *Doc: Represents the document<br />
structure <strong>and</strong> the current status of the<br />
document at all times.<br />
• char *Name: This name will be used in<br />
place of any name specified in a<br />
dlpdfdocwritePS procedure call.<br />
void<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfdocsetpdfname<br />
All <strong>DLI</strong>-supported platforms.<br />
Technical Notes<br />
1 This is included in support of document processing systems which know the<br />
desired result of document creation at the start of document processing, but which<br />
may not retain that knowledge until the end of processing.
A.70 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfdocsetsignatureappearance<br />
(DLPDFDOC *Doc, DLPDFSIGNATURE *Sig, DLPDFFORM<br />
*background, DLPDFFORM *unverified, DLPDFFORM<br />
*signature, DLPDFFORM *textSigInfo)<br />
Return Value: void<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Description<br />
Parameters<br />
Return Value<br />
This call sets the appearance layers for the digital<br />
signature to the supplied DLPDFFORM values.<br />
This call is optional. For an invisible digital<br />
signature, do not call this function. All the signature<br />
layers are also optional. Blank layers will<br />
be used for any omitted signature appearance<br />
layers.<br />
• DLPDFDOC *Doc: document for which the<br />
signature object will be created<br />
• DLPDFSIGNATURE *Sig: signature to<br />
which appearance settings will be assigned<br />
• DLPDFFORM *background: bottom-most<br />
layer of the digital signature appearance<br />
• DLPDFFORM *unverified: layer displayed<br />
when the signature has not been verified<br />
• DLPDFFORM *signature: graphical<br />
representation of the signature itself (such as<br />
a scanned h<strong>and</strong>written signature)<br />
• DLPDFFORM *textSigInfo: layer<br />
displaying information about the signature<br />
<strong>and</strong> the signatory<br />
void<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfdoccreatesignature,<br />
dlpdfpageplacesignature<br />
All <strong>DLI</strong>-supported platforms.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.71<br />
dlpdfdocwritepdf (DLPDFDOC *Doc, char<br />
*FileName, int Linearize)<br />
Return Value: void<br />
Description<br />
Parameters<br />
Return Value<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
Writes the document to PDF.<br />
• DLPDFDOC *Doc: Represents the document<br />
structure <strong>and</strong> the current status of the<br />
document at all times.<br />
• char *FileName: May be NULL if it was<br />
set by a previous call to<br />
dlpdfdocsetpdfname, otherwise, if the<br />
filename is not specified, a<br />
genErrBadParam exception will be raised.<br />
If the filename was set,<br />
dlpdfdocsetpdfname has been called.<br />
• int Linearize: If true, linear optimized<br />
output will be created. If the procedure<br />
dlpdfdoclinearize has been called<br />
prior to a call to write the document, the<br />
document will be linearized regardless of the<br />
setting of the linearization flag.<br />
void<br />
genErrBadParam: Raised if the filename is<br />
not specified.<br />
dli.h<br />
dlpdfdocwritePS<br />
All <strong>DLI</strong>-supported platforms.
A.72 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfdocwritePS (DLPDFDOC *Doc, char<br />
*FileName)<br />
Return Value: void<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Description<br />
Parameters<br />
Return Value<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
Writes the document to PostScript.<br />
• DLPDFDOC *Doc: Represents the document<br />
structure <strong>and</strong> the current status of the<br />
document at all times.<br />
• char *FileName: May be NULL if it was<br />
set by a previous call to<br />
dlpdfdocsetpsname, otherwise, if the<br />
filename is not specified, a<br />
genErrBadParam exception will be raised.<br />
If the filename was set,<br />
dlpdfdocsetpsname has been called.<br />
void<br />
genErrBadParam: Raised if the filename is<br />
not specified.<br />
dli.h<br />
dlpdfdocwritepdf<br />
All <strong>DLI</strong>-supported platforms.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.73<br />
dlpdffontcreate (DLPDFDOC *Doc, char *fontName,<br />
char *fontType)<br />
Return Value: DLPDFFONT*<br />
Description<br />
Parameters<br />
Return Value<br />
This function call will cause the Adobe PDF<br />
Library to search the system default font locations<br />
<strong>and</strong> the locations supplied at initialization<br />
time for a font of the specified name (<strong>and</strong> of the<br />
specified type, if supplied). If a font cannot be<br />
located, this call will raise an exception. The<br />
font returned will be created in the document's<br />
default encoding if that encoding is compatible<br />
with the font; otherwise, a platform-dependent<br />
default will be used.<br />
• DLPDFDOC *Doc: The document for which<br />
to embed all fonts<br />
• char *fontName: The font name to search<br />
for<br />
• char *fontType: The type of font (e.g.<br />
"Type1," "TrueType," "Type3") to<br />
search for. This may be NULL.<br />
The DLPDFFONT * which has been created<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfdocembedfonts,<br />
dlpdffontcreateembedded,<br />
dlpdffontcreatewithmetrics,<br />
dlpdffontcreatewithmetricsembedded<br />
All <strong>DLI</strong>-supported platforms.
A.74 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
Technical Notes<br />
1 When a font type is specified, a font of that type <strong>and</strong> name is sought. If no such<br />
font is found, Concepts any type of <strong>and</strong> font Facilities: with the same <strong>Guide</strong> name to the is sought. DL Pager Please Composition see “Font System<br />
Searching Sequence” on page 4.7 for the specific order of search tests followed<br />
when the font creation process attempts to locate a font in resources.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.75<br />
dlpdffontcreateembedded (DLPDFDOC *Doc,<br />
char *fontName, char *fontType, ASBool Subset)<br />
Return Value: DLPDFFONT*<br />
Description<br />
Parameters<br />
Return Value<br />
This function call will cause the Adobe PDF<br />
Library to search the system default font locations<br />
<strong>and</strong> the locations supplied at initialization<br />
time for a font of the specified name (<strong>and</strong> of the<br />
specified type, if supplied). If a font cannot be<br />
located, this call will raise an exception. The<br />
font returned will be embedded <strong>and</strong> created in<br />
the document's default encoding if that encoding<br />
is compatible with the font; otherwise, a<br />
platform-dependent default will be used. If the<br />
Subset parameter is set to TRUE, the font will<br />
be embedded <strong>and</strong> subset.<br />
• DLPDFDOC *Doc: The document for which<br />
to embed all fonts<br />
• char *fontName: Font name to search for<br />
• char *fontType: The type of font (e.g.<br />
"Type1," "TrueType," "Type3") to<br />
search for. This may be NULL.<br />
• ASBool Subset: If TRUE, then the font is<br />
both embedded <strong>and</strong> subset. If FALSE, the<br />
entire font file is embedded in the PDF<br />
document. For Type0 fonts, this must be<br />
TRUE.<br />
The DLPDFFONT which has been created<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfdocembedfonts,<br />
dlpdffontcreate,<br />
dlpdffontcreatewithmetrics,<br />
dlpdffontcreatewithmetricsembedded<br />
All <strong>DLI</strong>-supported platforms.
A.76 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdffontcreatewithmetrics (DLPDFDOC<br />
*Doc, char *fontName, PDEFontAttrs *fontAttrs, unsigned<br />
short *Widths, char *Encoding [])<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Return Value: DLPDFFONT*<br />
Description<br />
Parameters<br />
Return Value<br />
This function call will cause the Adobe PDF<br />
Library to search the system default font locations<br />
<strong>and</strong> the locations supplied at initialization<br />
time for a font of the specified name <strong>and</strong><br />
attributes. If the font cannot be found, one will<br />
be created if a width table <strong>and</strong> valid font<br />
attributes have been supplied. If no encoding is<br />
specified in the font attributes, the font will be<br />
created with the document's default font encoding.<br />
• DLPDFDOC *Doc: The document for which<br />
to embed all fonts<br />
• char *fontName: Font name to search for<br />
• PDEFontAttrs *fontAttrs: A<br />
PDEFontAttrs structure which has been<br />
zero-filled <strong>and</strong> set with parameters which the<br />
caller wants to see reflected in the returned<br />
font. See the Adobe Acrobat Core API<br />
<strong>Reference</strong> for details on this structure.<br />
• unsigned short Widths: If non-NULL,<br />
an array of 256 values; see Technical Note 1<br />
below.<br />
• char *Encoding: If non-NULL, an array of<br />
256 values; see Technical Note 2 below.<br />
The DLPDFFONT which has been created<br />
Exceptions<br />
Header<br />
dli.h
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.77<br />
Related Methods<br />
Availability<br />
dlpdfdocembedfonts,<br />
dlpdffontcreate,<br />
dlpdffontcreateembedded,<br />
dlpdffontcreatewithmetricsembedded<br />
All <strong>DLI</strong>-supported platforms.<br />
Technical Notes<br />
1 Each of these is the width of the character in that position, in EMs. If this is NULL,<br />
the default character widths in the requested encoding of the FontAttrs<br />
structure are used. This must be NULL for Type0 fonts.<br />
2 Each of these is the PostScript name of the character to use for the specified code<br />
point. If this is NULL, the encoding specified in the PDEFontAttrs structure is<br />
used. This must be NULL for Type0 fonts. It is highly recommended that you<br />
supply a width table when specifying an encoding vector.
A.78 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdffontcreatewithmetricsembedded<br />
(DLPDFDOC *Doc, char *fontName, PDEFontAttrs<br />
*fontAttrs, unsigned short *Widths, char *Encoding [],<br />
ASBool Subset)<br />
Return Value: DLPDFFONT*<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Description<br />
Parameters<br />
Return Value<br />
This function call will cause the Adobe PDF<br />
Library to search the system default font locations<br />
<strong>and</strong> the locations supplied at initialization<br />
time for a font of the specified name <strong>and</strong><br />
attributes. If the font cannot be found, an<br />
exception will be raised. If no encoding is specified<br />
in the font attributes, the font will be created<br />
with the document's default font encoding.<br />
The created font will be embedded; if Subset<br />
is set to TRUE, then the font will be subset as<br />
well.<br />
• DLPDFDOC *Doc: The document for which<br />
to embed all fonts<br />
• char *fontName: The font name to search<br />
for<br />
• PDEFontAttrs *fontAttrs: A<br />
PDEFontAttrs structure which has been<br />
zero-filled <strong>and</strong> set with parameters which the<br />
caller wants to see reflected in the returned<br />
font. See the Adobe Acrobat Core API<br />
<strong>Reference</strong> for details on this structure.<br />
• unsigned short *Widths: If non-NULL,<br />
an array of 256 values; see Technical Note 1<br />
below.<br />
• char *Encoding: If non-NULL, an array of<br />
256 values; see Technical Note 2 below.<br />
• ASBool Subset: If TRUE, then the font is<br />
both embedded <strong>and</strong> subset. If FALSE, the<br />
entire font file is embedded in the PDF<br />
document. For Type0 fonts, this must be<br />
TRUE.<br />
The DLPDFFONT which has been created
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.79<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfdocembedfonts,<br />
dlpdffontcreate,<br />
dlpdffontcreateembedded,<br />
dlpdffontcreatewithmetrics<br />
All <strong>DLI</strong>-supported platforms.<br />
Technical Notes<br />
1 Each of these is the width of the character in that position, in EMs. If NULL, the<br />
default character widths in the requested encoding of the PDEFontAttrs<br />
structure are used. This must be NULL for Type0 fonts.<br />
2 Each of these is the PostScript name of the character to use for the specified code<br />
point. If NULL, the encoding specified in the PDEFontAttrs structure is used.<br />
This must be NULL for Type0 fonts. When specifying an encoding vector, a width<br />
table is highly recommended.
A.80 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfformcreate (DLPDFDOC *Doc, DLPDFCONTENT<br />
*Content, ASFixedRect *BBox)<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Return Value: DLPDFFORM*<br />
Description<br />
Parameters<br />
Return Value<br />
Creates a new form in the document specified as<br />
Doc., with the content previously placed into<br />
the container Content. The form will be considered<br />
to be of the size specified in BBox. The<br />
Bounding Box need not be located at (0,0);<br />
however, it must have a positive Width <strong>and</strong><br />
Depth.<br />
• DLPDFDOC *Doc: Name of new form<br />
created with this call<br />
• DLPDFCONTENT *Content: Represents the<br />
content element. The content block used to<br />
create a form is destroyed in the form’s<br />
creation, <strong>and</strong> any h<strong>and</strong>les to it become<br />
invalid.<br />
• ASFixedRect *BBox: Represents the<br />
bounding box of the form, in points.<br />
DLPDFFORM*<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfformdestroy<br />
All <strong>DLI</strong>-supported platforms.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.81<br />
dlpdfformdestroy (DLPDFFORM *Form)<br />
Return Value: void<br />
Description<br />
Parameters<br />
Return Value<br />
Destroys the named form, releasing its resources<br />
<strong>and</strong> invalidating the form h<strong>and</strong>le.<br />
DLPDFFORM *Form<br />
void<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfformcreate<br />
All <strong>DLI</strong>-supported platforms.
A.82 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfimagecreatefrombmp (DLPDFDOC *Doc,<br />
char *ImageName, char *Image, long ImageSize, long<br />
Width, Long Depth, int bpc, CosObj ColorSpace, int InLine)<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Return Value: DLPDFIMAGE*<br />
Description<br />
Parameters<br />
Return Value<br />
Creates an image from a bitmap. The map is<br />
considered to be scanned left to right <strong>and</strong> top to<br />
bottom.<br />
• DLPDFDOC *Doc represents the document<br />
structure <strong>and</strong> the current status of the<br />
document at all times.<br />
• char *ImageName: Image name string<br />
• char *Image: Pointer to the image raster<br />
data<br />
• long ImageSize in bytes. Should be equal<br />
to ((Width*Depth*BitsPerComponent)/<br />
8)*CompPerPixel. Components per pixel<br />
is derived from ColorSpace.<br />
• long Width in pixels<br />
• Long Depth in pixels<br />
• int bpc<br />
• CosObj ColorSpace: this should be the<br />
color space name as a COS structure<br />
(/DeviceGray, /DeviceRGB or<br />
/DeviceCMYK, which have 1, 3, <strong>and</strong> 4<br />
components per pixel respectively), a<br />
CosNull structure (if this is a 1BPP, onechannel<br />
bitmap to be placed as an<br />
imagemask), or an indexed color space<br />
structure which has one component per pixel.<br />
• int InLine: A flag which when TRUE will<br />
embed this structure in the document each<br />
time it is used. When FALSE, it will be<br />
embedded only once.<br />
DLPDFIMAGE*<br />
Exceptions<br />
Header<br />
dli.h
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.83<br />
Related Methods<br />
Availability<br />
dlpdfimagecreatefromfile,<br />
dlpdfimagecreatefrompdf,<br />
dlpdfimagecreatefromps<br />
All <strong>DLI</strong>-supported platforms.<br />
Technical Notes<br />
1 For efficiency purposes, <strong>DLI</strong> inlines images when the ImageLength parameter is<br />
less than 500 bytes.<br />
2 The bitmap processed by this function is a “raw” bitmap with no header<br />
information or wrapper. Unprocessed BMP files are not supported by this<br />
function.
A.84 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfimagecreatefromfile (DLPDFDOC *Doc,<br />
char *Name)<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Return Value: DLPDFIMAGE*<br />
Description<br />
Parameters<br />
Return Value<br />
Invokes the graphics library conversion facility,<br />
which will convert an arbitrary file containing<br />
an image (JPG/JPEG, PNG, TIFF, GIF or PDF)<br />
into a returned DLPDFIMAGE* structure for<br />
further processing.<br />
• DLPDFDOC *Doc represents the document<br />
structure <strong>and</strong> the current status of the<br />
document at all times.<br />
• char *Name: Name string<br />
DLPDFIMAGE*<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfimagecreatefrombmp,<br />
dlpdfimagecreatefrompdf,<br />
dlpdfimagecreatefromps<br />
Not available on OS/390
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.85<br />
dlpdfimagecreatefrompdf (DLPDFDOC *Doc,<br />
char *ImageName, ASFixed Width, ASFixed Depth, ASFixed<br />
XDisp, ASFixed YDisp, long Page)<br />
Return Value: DLPDFIMAGE*<br />
Description<br />
Parameters<br />
Return Value<br />
This convenience operator will create an image<br />
from a file containing a PDF document. If<br />
importing an image containing a Rotate key,<br />
that value will be honored. Images will be<br />
placed in the same orientation displayed by<br />
Adobe Reader <strong>and</strong> Acrobat. The specified page<br />
of the PDF document will be used as a graphic<br />
image.<br />
• DLPDFDOC *Doc represents the document<br />
structure <strong>and</strong> the current status of the<br />
document at all times.<br />
• char *ImageName: Image name string<br />
• ASFixed Width<br />
• ASFixed Depth<br />
• ASFixed XDisp<br />
• ASFixed YDisp<br />
• long Page<br />
DLPDFIMAGE*<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfimagecreatefrombmp,<br />
dlpdfimagecreatefromfile,<br />
dlpdfimagecreatefromps<br />
All <strong>DLI</strong>-supported platforms.
A.86 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
Technical Notes<br />
1 As of <strong>DLI</strong> v3.0.11, a value of 0 is now accepted for the Width <strong>and</strong> Depth<br />
parameters. If Concepts either is 0, <strong>and</strong> the Facilities: PDF page's <strong>Guide</strong> crop box to the is used DL to Pager form Composition the System<br />
DLPDFIMAGE's visible region. This will be shifted using the XDisp <strong>and</strong> YDisp<br />
values to generate the imported image.<br />
2 <strong>Datalogics</strong> recommends supplying a value of 0 for the width, depth, <strong>and</strong> x- <strong>and</strong> y-<br />
displacements, unless it is otherwise known that the imported graphic should be<br />
placed with a visible region other than that visible in Adobe Acrobat or Reader.<br />
3 The BoundingBox in the returned DLPDFIMAGE is not rotated by the value of the<br />
Rotate key for the imported page, <strong>and</strong> thus can be used to determine the "real"<br />
width <strong>and</strong> depth of the imported PDF image.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.87<br />
dlpdfimagecreatefromps (DLPDFDOC *Doc,<br />
char *ImageName, char *Image, long ImageSize, int InLine)<br />
Return Value: DLPDFIMAGE*<br />
Description<br />
Parameters<br />
Return Value<br />
Creates an image from an EPS graphic. It must<br />
contain a “%%BoundingBox” statement.<br />
• DLPDFDOC *Doc represents the document<br />
structure <strong>and</strong> the current status of the<br />
document at all times.<br />
• char *ImageName: Name of Image<br />
• char *Image: The graphic is contained in<br />
this array.<br />
• long ImageSize: Size of image<br />
• int Inline: A flag, which when TRUE<br />
embeds this structure in the graphic each time<br />
it is used. When FALSE, it will be embedded<br />
only once.<br />
DLPDFIMAGE*<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfimagecreatefrombmp,<br />
dlpdfimagecreatefromfile,<br />
dlpdfimagecreatefrompdf<br />
All <strong>DLI</strong>-supported platforms.<br />
Technical Notes<br />
1 <strong>DLI</strong> does not convert PostScript fragments to PDF. Any PostScript images will not<br />
be viewable in most PDF viewers. This method is included for PDF files which will<br />
go to printers or print processors which can appropriately h<strong>and</strong>le these fragments.
A.88 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfimagegetsize (DLPDFIMAGE *Image,<br />
ASUns32 *xRasters, ASUns32 *yRasters, ASFixed *xPoints,<br />
ASFixed *yPoints)<br />
Return Value: void<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Description<br />
Parameters<br />
Return Value<br />
This procedure retrieves image size information<br />
from a graphic file.<br />
• DLPDFIMAGE *Image: Represents a pointer<br />
to the image file. This method will examine<br />
the image file <strong>and</strong> return values in the four<br />
arguments following.<br />
• ASUns32 *xRasters: Width of image in<br />
rasters or image units (depending on format)<br />
• ASUns32 *yRasters: Height of image in<br />
rasters or image units (depending on format)<br />
• ASFixed *xPoints: Intended print width<br />
in PDF units<br />
• ASFixed *yPoints: Intended print height<br />
in PDF units<br />
void<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfcontentreferenceimage<br />
All <strong>DLI</strong>-supported platforms.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.89<br />
Technical Notes<br />
1 The Scale Factors specified in dlpdfcontentreferenceimage will determine<br />
the resulting size of the image. This method gives you the image information<br />
necessary to calculate those values, dividing the intended print size by the file size<br />
for each dimension. This yields a Scale Factor ratio which<br />
dlpdfcontentreferenceimage uses to calculate the final output image size.<br />
2 The typical scaling calculation using values returned by this method would occur<br />
during the call to dlpdfcontentreferenceimage; e.g.<br />
"dlpdfcontentreferenceimage(Content, Image,<br />
Int32ToFixed(72), Int32ToFixed(92), 0,<br />
ASFixedDiv(xPoints,Int32ToFixed(xRasters)),<br />
ASFixedDiv(yPoints,Int32ToFixed(yRasters)));".<br />
3 An image in which each pixel of each raster line represents one PDF unit of output<br />
will return the same values for both image dimension (xRasters <strong>and</strong> yRasters)<br />
<strong>and</strong> print size (xPoints <strong>and</strong> yPoints), <strong>and</strong> thus a Scale Factor of 1 on both<br />
axes.
A.90 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfinit (PDFLData pdflLibData, ASFileSys defaultFS, void<br />
*unused)<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Return Value: DLPDFINSTANCE *<br />
Description<br />
Parameters<br />
Initializes the Adobe PDF Library <strong>and</strong> <strong>DLI</strong>,<br />
<strong>and</strong> should be called prior to creating the first<br />
document.<br />
• PDFLData pdflLibData: contains the<br />
initialization information for the Adobe PDF<br />
Library.<br />
• ASFileSys defaultFS: the default file<br />
system for file input/output <strong>and</strong> creation of<br />
temporary files. If this parameter is NULL, the<br />
default file system for the current platform<br />
will be used.<br />
• void *unused: NULL; reserved for future<br />
use<br />
Return Value DLPDFINSTANCE *<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfmemfilesys,<br />
dlpdfterm<br />
All <strong>DLI</strong>-supported platforms.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.91<br />
Technical Notes<br />
1 Initialization of <strong>DLI</strong> is now required; support for using <strong>DLI</strong> without initialization<br />
has been removed. If you intend to use <strong>DLI</strong> methods in your application, you must<br />
intialize <strong>DLI</strong> via dlpdfinit. <strong>DLI</strong> users should initialize the Adobe PDF Library<br />
through the <strong>DLI</strong> initialization call; PDFLInit <strong>and</strong> PDFLTerm should never be<br />
directly called from a <strong>DLI</strong> application.<br />
2 In a multi-threaded application, each thread must do its own initialization <strong>and</strong><br />
termination of the Library.<br />
3 This procedure, along with dlpdfterm, replaces the need for calls to PDFLInit<br />
<strong>and</strong> PDFLTerm. <strong>DLI</strong> should be initialized, or the Adobe PDF Library, but not<br />
both.<br />
4 You can accidentally call dlpdfinit (the <strong>DLI</strong> comm<strong>and</strong>) multiple times without<br />
problems, as it contains internal code that prevents actual initialization from<br />
occurring more than once, but you cannot call PDFLInit (the Adobe PDF<br />
Library comm<strong>and</strong>) more than once as a fatal error will occur.<br />
5 dlpdfinit <strong>and</strong> dlpdfterm are the only methods which must not be enclosed in<br />
exception h<strong>and</strong>lers (i.e. DURING/HANDLER/END_HANDLER statements), because<br />
they are not set up before initialization, <strong>and</strong> are freed during termination.<br />
6 As of <strong>DLI</strong> v3.0.11, the <strong>DLI</strong> graphics cache has been enhanced to use the default<br />
ASFileSys implementation provided to dlpdfinit for caching graphics. By<br />
default, the graphics cache file size is limited to 1.5GB. Customers who wish to use<br />
larger graphics cache files are advised to supply a filesystem to dlpdfinit which<br />
is capable of reliably h<strong>and</strong>ling files of the larger size.<br />
NOTE: The cache size limit is checked every time a document is destroyed; the<br />
cache may therefore temporarily exceed the cache size limit. When setting the<br />
cache size limit, please note that to resize the graphics cache, free space equal to<br />
the sum of the cache limit <strong>and</strong> the "low water" mark is required. Files In Memory<br />
users with large graphics workloads are advised to lower the cache size limit to a<br />
number appropriate for their target environment.
A.92 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfinstancesetcancelproc (DLPDFINSTANCE<br />
*dliInst, CancelProc cProc, void *cData)<br />
Return Value: void<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Description<br />
Parameters<br />
Return Value<br />
This call sets the cancel procedure used when<br />
writing a document using the dlpdfdocwritepdf<br />
call, along with other calls<br />
which may take a large quantity of time. This<br />
progress monitor will be used for all documents<br />
created with the specified instance.<br />
• DLPDFInstance *dliInst: The<br />
DLPDFINSTANCE for which to set the cancel<br />
procedure<br />
• CancelProc cProc: The cancel procedure<br />
to use. See the Adobe Acrobat Core API<br />
<strong>Reference</strong> for details on creating a cancel<br />
procedure.<br />
• void *cData: A pointer to client data<br />
which is passed to the cancel procedure<br />
callback. See the Adobe Acrobat Core API<br />
<strong>Reference</strong> for details.<br />
void<br />
Exceptions<br />
Header<br />
dli.h<br />
Related Methods<br />
Availability<br />
All <strong>DLI</strong>-supported platforms.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.93<br />
dlpdfinstancesetgrcachelimits<br />
(DLPDFINSTANCE *dliInst, ASUns32 highLimit, ASUns32<br />
deleteLimit)<br />
Return Value: void<br />
Description<br />
Parameters<br />
Return Value<br />
This call supports a control on the amount of<br />
filesystem storage used for the <strong>DLI</strong> graphics<br />
cache. It accepts a low-water <strong>and</strong> a high-water<br />
mark, in bytes. At document-destroy time (i.e.<br />
when a call to dlpdfdocdestroy is made),<br />
the graphics cache size is evaluated, <strong>and</strong> if it<br />
exceeds the high-water mark in size, graphics<br />
will be removed from the cache in least recently<br />
used (LRU) order until the cache falls to or<br />
below the low-water mark.<br />
• DLPDFINSTANCE *dliInst: The<br />
DLPDFINSTANCE for which the cache will be<br />
reviewed<br />
• ASUns32 highLimit: The high-water<br />
mark level, in bytes. Exceeding this level will<br />
trigger a purge of graphics in LRU order at<br />
document-destroy time.<br />
• ASUns32 deleteLimit: The low-water<br />
mark level, in bytes, above which graphics<br />
will be purged at document-destroy-time.<br />
Graphics will be removed in LRU order until<br />
the total storage is at or below this figure.<br />
void<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfdocdestroy<br />
All <strong>DLI</strong>-supported platforms.
A.94 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
Technical Notes<br />
1 The highLimit value is a trigger-point setting only, not a storage limit; the cache<br />
is allowed to Concepts grow beyond <strong>and</strong> that Facilities: point. The <strong>Guide</strong> highLimit to the DL value Pager is inspected Composition only at System<br />
document-destroy time when dlpdfdocdestroy is called, not before. The<br />
graphics cache may grow larger than the highLimit value during document<br />
creation, but will be reduced to the deleteLimit point before the next<br />
document is begun.<br />
2 As of <strong>DLI</strong> v3.0.11, the <strong>DLI</strong> graphics cache has been enhanced to use the default<br />
ASFileSys implementation provided to dlpdfinit for caching graphics. By<br />
default, the graphics cache file size is limited to 1.5GB. Customers who wish to use<br />
larger graphics cache files are advised to supply a filesystem to dlpdfinit which<br />
is capable of reliably h<strong>and</strong>ling files of the larger size.<br />
NOTE: The cache size limit is checked every time a document is destroyed; the<br />
cache may therefore temporarily exceed the cache size limit. When setting the<br />
cache size limit, please note that to resize the graphics cache, free space equal to<br />
the sum of the cache limit <strong>and</strong> the "low water" mark is required. Files In Memory<br />
users with large graphics workloads are advised to lower the cache size limit to a<br />
number appropriate for their target environment.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.95<br />
dlpdfinstancesetprogressmonitor<br />
(DLPDFINSTANCE *dliInst, ProgressMonitor pRec, void<br />
*progData)<br />
Return Value: void<br />
Description<br />
Parameters<br />
Return Value<br />
This call sets the progress monitor used when<br />
writing a document using the dlpdfdocwritepdf<br />
call, along with other calls<br />
which may take a large quantity of time. This<br />
progress monitor will be used for all documents<br />
created with the specified instance.<br />
• DLPDFINSTANCE *dliInst: The<br />
DLPDFINSTANCE for which to set the<br />
progress monitor<br />
• ProgressMonitor pRec: The progress<br />
monitor to use. See the Adobe Acrobat Core<br />
API <strong>Reference</strong> for details on creating <strong>and</strong><br />
obtaining progress monitors.<br />
• void *progData: A pointer to client data<br />
which is passed to the progress monitor<br />
callbacks. See the Adobe Acrobat Core API<br />
<strong>Reference</strong> for details.<br />
void<br />
Exceptions<br />
Header<br />
dli.h<br />
Related Methods<br />
Availability<br />
All <strong>DLI</strong>-supported platforms.
A.96 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfmatrixrotate (ASFixedMatrix *Matrix, ASFixed<br />
Angle)<br />
Return Value: void<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Description<br />
Parameters<br />
Return Value<br />
Rotates a matrix counterclockwise by the specified<br />
angle after accepting a pointer to the<br />
matrix.<br />
• ASFixedMatrix *Matrix: Matrix to be<br />
rotated<br />
• ASFixed Angle: In degrees, as an<br />
ASFixed counterclockwise value<br />
void<br />
Exceptions<br />
Header<br />
dli.h<br />
Related Methods<br />
Availability<br />
All <strong>DLI</strong>-supported platforms.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.97<br />
dlpdfmemfileacquire (ASPathName Name)<br />
Return Value: MDFile<br />
Description<br />
Parameters<br />
Return Value<br />
Acquires a Files In Memory representation for<br />
the file named FileName, previously created<br />
with an ASFileOpen call. It returns this file as<br />
an MDFile, which may then be used to obtain a<br />
representation of the file's contents.<br />
ASPathName Name<br />
MDFile<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfmemfilerelease<br />
All <strong>DLI</strong>-supported platforms.
A.98 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfmemfiledata (MDFile File)<br />
Return Value: unsigned const char *<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Description<br />
Parameters<br />
Returns a pointer (of the size returned by the<br />
dlpdfmemfilesize function call) containing<br />
a memory representation of the file passed<br />
into the function. This should be neither altered<br />
nor freed, <strong>and</strong> should be copied by the application<br />
into the application’s memory area.<br />
MDFile File<br />
Return Value unsigned const char *<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfmemfileacquire,<br />
dlpdfmemfilerelease,<br />
dlpdfmemfilesize<br />
All <strong>DLI</strong>-supported platforms.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.99<br />
dlpdfmemfiledeleteonclose (MDFile File)<br />
Return Value: void<br />
Description<br />
Parameters<br />
Return Value<br />
This method marks a Files In Memory file to be<br />
removed from the filesystem once the last open<br />
fileh<strong>and</strong>le for this file has been closed. No file is<br />
automatically removed from memory, unless<br />
this call has been made on a specific MDFile.<br />
MDFile File<br />
void<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfmemfileacquire,<br />
dlpdfmemfilerelease<br />
All <strong>DLI</strong>-supported platforms.
A.100 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfmemfilerelease (MDFile File)<br />
Return Value: int<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Description<br />
Parameters<br />
Return Value<br />
Relinquishes one acquisition as made by the<br />
dlpdfmemfileacquire call, <strong>and</strong> returns<br />
the number of acquisitions left on the file.<br />
MDFile<br />
Int<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfmemfileacquire<br />
All <strong>DLI</strong>-supported platforms.<br />
Technical Notes<br />
1 An application should make one release call for each acquire call: the<br />
release call signals that the acquiring program no longer needs the file, <strong>and</strong> its<br />
resources may be safely freed.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.101<br />
dlpdfmemfilesetbuffer (MDFile File, unsigned<br />
char * Data, ASSize_t Size)<br />
Return Value: ASBool<br />
Description<br />
Parameters<br />
Return Value<br />
This method configures Files In Memory to<br />
directly use the buffer passed in as the file contents.<br />
Unlike dlpdfmemfilesetdata, this<br />
method does not copy the buffer; the file<br />
instance <strong>and</strong> buffer instance are one <strong>and</strong> the<br />
same.<br />
• MDFile File: File to be overwritten<br />
• unsigned char * Data: Memory to<br />
replace the File’s previous content.<br />
• ASSize_t Size<br />
ASBool: TRUE is returned if the file’s data<br />
buffer could be set to this memory, FALSE if it<br />
could not.<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfmemfileacquire,<br />
dlpdfmemfilerelease,<br />
dlpdfmemfilesetdata<br />
All <strong>DLI</strong>-supported platforms.<br />
Technical Notes<br />
1 As of <strong>DLI</strong> v3.0.11, the dlpdfmemfilesetbuffer <strong>and</strong><br />
dlpdfmemfilesetdata calls no longer rewind the memory files to position 0.
A.102 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfmemfilesetdata (MDFile File, unsigned<br />
const char * Data, ASSize_t Size)<br />
Return Value: ASBool<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Description<br />
Parameters<br />
Return Value<br />
Sets the file passed in to contain the data passed<br />
to the function. This completely overwrites the<br />
file’s previous contents.<br />
• MDFile File: File to be overwritten<br />
• unsigned const char * Data: Data<br />
that replaces File content.<br />
• ASSize_t Size<br />
ASBool: TRUE is returned if the file could be<br />
set to this data, FALSE if it could not.<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfmemfileacquire,<br />
dlpdfmemfilerelease,<br />
dlpdfmemfilesetbuffer<br />
All <strong>DLI</strong>-supported platforms.<br />
Technical Notes<br />
1 As of <strong>DLI</strong> v3.0.11, the dlpdfmemfilesetbuffer <strong>and</strong><br />
dlpdfmemfilesetdata calls no longer rewind the memory files to position 0.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.103<br />
dlpdfmemfilesize (MDFile File)<br />
Return Value: ASSize_t<br />
Description<br />
Parameters<br />
Return Value<br />
Returns the size of the memory buffer which the<br />
dlpdfmemfiledata call will return if called.<br />
This is the smallest size of buffer that can<br />
accommodate the memory representation of<br />
Files In Memory passed in as a file.<br />
MDFile File<br />
ASSize_t<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfmemfileacquire,<br />
dlpdfmemfilerelease<br />
All <strong>DLI</strong>-supported platforms.
A.104 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfmemfilesys (void)<br />
Return Value: ASFileSys<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Description<br />
Parameters<br />
Return Value<br />
Returns the ASFileSys structure which represents<br />
the <strong>Datalogics</strong> Files In Memory file system.This<br />
file system will only be used if PDF<br />
output is requested.<br />
None<br />
ASFileSys<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfinit,<br />
dlpdfmemfileacquire,<br />
dlpdfmemfilerelease<br />
All <strong>DLI</strong>-supported platforms.<br />
Technical Notes<br />
1 This method is suitable as the second parameter for the dlpdfinit function, or<br />
for any other Adobe PDF Library function call requiring an ASFileSys record.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.105<br />
dlpdfmemfilesysgetmemusage (void)<br />
Return Value: ASSize_t<br />
Description<br />
Parameters<br />
Return Value<br />
This returns an ASSize_t with the current<br />
usage, in bytes, of memory for Files In Memory<br />
file contents by <strong>DLI</strong>.<br />
None<br />
ASSize_t<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfmemfileacquire,<br />
dlpdfmemfilerelease<br />
dlpdfmemfilesyssetmemlimit<br />
All <strong>DLI</strong>-supported platforms.
A.106 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfmemfilesyssetmemlimit (ASSize_t<br />
memLimit)<br />
Return Value: void<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Description<br />
Parameters<br />
Return Value<br />
This establishes an upper bound, in bytes, of the<br />
memory usage allowed for Files In Memory file<br />
contents by <strong>DLI</strong>.<br />
ASSize_t memLimit<br />
void<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfmemfileacquire,<br />
dlpdfmemfilerelease<br />
dlpdfmemfilesysgetmemusage<br />
All <strong>DLI</strong>-supported platforms.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.107<br />
dlpdfmemfiletransientprefix (void)<br />
Return Value: const char *<br />
Description<br />
Parameters<br />
Returns a NULL-terminated string representing<br />
the prefix for the transient files<br />
None<br />
Return Value const char *<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfmemfileacquire,<br />
dlpdfmemfilerelease<br />
All <strong>DLI</strong>-supported platforms.<br />
Technical Notes<br />
1 Transient files are files which are to reside entirely within the bounds of Files In<br />
Memory, <strong>and</strong> are not to be written to disk upon file closure. All temporary files<br />
created by the Adobe PDF Library <strong>and</strong> <strong>DLI</strong> are automatically transient files when<br />
Files In Memory is activated.<br />
2 Applications which wish to write PDF files to memory areas should append this<br />
prefix to the beginning of all their file names. Files which do not start with this<br />
prefix will be written to disk upon file closure or upon program termination.
A.108 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfpageaddlinkannotation (DLPDFPAGE<br />
*Page, ASFixedRect *Location, ASFixed *Border, ASFixed<br />
*Color, long PageNumber, Char *Fit, ASFixedRect *Where,<br />
ASFixed *Zoom)<br />
Return Value: CosObj<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Description<br />
Parameters<br />
Creates a link annotation in the specified page.<br />
• DLPDFPAGE *Page: Represents a page. This<br />
structure is tracked within the package <strong>and</strong><br />
destroyed when the document is destroyed.<br />
Pointers to this structure remain valid until<br />
the document is destroyed.<br />
• ASFixedRect *Location: The hot spot<br />
for the link will be located at the rectangle<br />
specified here.<br />
• ASFixed *Border: (Optional) An array of<br />
three ASFixed values in the order<br />
Horizontal Corner Radius,<br />
Vertical Corner Radius <strong>and</strong> Line<br />
Width, drawing a visible border around the<br />
hot spot.<br />
• ASFixed *Color: Optional pointer by<br />
which border color may be set. When used,<br />
this is assumed to point to an array of three<br />
ASFixed values, giving the color as Red,<br />
Green <strong>and</strong> Blue values.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.109<br />
Parameters (Continued)<br />
Return Value<br />
• long PageNumber: The zero-relative number<br />
of the page to which this link connects. The<br />
page referenced does not need to have been<br />
created yet.<br />
• Char *Fit: Must be a valid PDF fit type<br />
expressed as a string. The list of valid types<br />
are “Fit”, “FitH”, “FitV”, “FitBH”,<br />
“FitBV”, “FitR”, “FitB” <strong>and</strong> “XYZ”.<br />
See the Adobe PDF Library <strong>Reference</strong> <strong>Guide</strong><br />
for explanations of the meaning of each fit<br />
type, <strong>and</strong> which values of the rectangle <strong>and</strong><br />
zoom are used for each.<br />
• ASFixedRect *Where: The rectangle to be<br />
displayed. This is used to distinguish an<br />
annotation. Only portions of this rectangle<br />
are used, based on the Fit Type selected in<br />
Fit.<br />
• ASFixed *Zoom: Adjustment to size of link<br />
target display.<br />
CosObj: The actual link structure which may<br />
be modified by the user to access capabilities<br />
beyond this interface.<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfpageaddlinkannotationfromname,<br />
dlpdfpageaddtextannotation,<br />
dlpdfpageaddwebannotation<br />
All <strong>DLI</strong>-supported platforms.
A.110 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
Technical Notes<br />
1 Only internal destinations (within the same document) are supported in this<br />
method. Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
2 Zero values in the rectangle will behave as PDViewNull values, as will a zero<br />
value for Zoom.<br />
3 The most common values used are XYZ as the fit type, Zero for Zoom, <strong>and</strong> the<br />
(X,Y) coordinates of the upper left h<strong>and</strong> edge of the desired target text in<br />
Where.top <strong>and</strong> Where.left. This will change to the target page <strong>and</strong> position<br />
the specified text so it is within the display window, leaving the Magnification<br />
factor where the user last set it.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.111<br />
dlpdfpageaddlinkannotationfromname<br />
(DLPDFPAGE *Page, ASFixedRect *Location, ASFixed<br />
*Border, ASFixed *Color, char *Target)<br />
Return Value: CosObj<br />
Description<br />
Parameters<br />
Return Value<br />
Adds a new link to a page using the named destination<br />
rather than a specified destination.<br />
• DLPDFPAGE *Page<br />
• ASFixedRect *Location: Location of<br />
rectangle<br />
• ASFixed *Border<br />
• ASFixed *Color: Link color<br />
• char *Target<br />
CosObj<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfpageaddlinkannotation,<br />
dlpdfpageaddtextannotation,<br />
dlpdfpageaddwebannotation<br />
All <strong>DLI</strong>-supported platforms.
A.112 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfpageaddtextannotation (DLPDFPAGE<br />
*Page, ASFixedRect *Location, ASFixed *Border, ASFixed<br />
*Color, char *Title, char *Contents, int Open)<br />
Return Value: CosObj<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Description<br />
Parameters<br />
Return Value<br />
Creates a text annotation within the specified<br />
page.<br />
• DLPDFPAGE *Page: Represents a page.<br />
This structure is tracked within the package<br />
<strong>and</strong> destroyed when the document is<br />
destroyed. Pointers to this structure remain<br />
valid until the document is destroyed.<br />
• ASFixedRect *Location: The lower-left<br />
corner of where the text annotation is to be<br />
displayed.<br />
• ASFixed *Border: (Optional) an array of<br />
three ASFixed values: Horizontal<br />
Corner Radius, Vertical Corner<br />
Radius <strong>and</strong> Line Width.<br />
• ASFixed *Color: (Optional) an array of<br />
three ASFixed values giving the color as<br />
Red, Green <strong>and</strong> Blue values.<br />
• char *Title: (Optional) displayed in the<br />
title bar of an open text annotation.<br />
• char *Contents: (Required) the displayed<br />
contents of the annotation.<br />
• int Open: A Boolean where TRUE will<br />
cause the annotation to be opened by default,<br />
while FALSE will cause it to be closed by<br />
default.<br />
CosObj<br />
Exceptions<br />
Header<br />
dli.h
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.113<br />
Related Methods<br />
Availability<br />
dlpdfpageaddlinkannotation,<br />
dlpdfpageaddlinkannotationfromname,<br />
dlpdfpageaddwebannotation<br />
All <strong>DLI</strong>-supported platforms.<br />
Technical Notes<br />
1 A page may contain any number of annotations. There are capabilities of<br />
annotations beyond those described here. To access those capabilities, modify the<br />
COS structure returned by this call.
A.114 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfpageaddwebannotation (DLPDFPAGE<br />
*Page, ASFixedRect *Location, ASFixed *Border, ASFixed<br />
*Color, char *URIDestination)<br />
Return value: CosObj<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Description<br />
Parameters<br />
Return Value<br />
Adds a new link to a page, using a URI (equivalent<br />
to URL) destination given by the URIDestination<br />
parameter. This URI is assumed to<br />
be in UTF-8 text format; support for URIs in<br />
other character sets is unavailable at this time.<br />
• DLPDFPAGE *Page<br />
• ASFixedRect *Location<br />
• ASFixed *Border<br />
• ASFixed *Color<br />
• char *URIDestination: URI destination<br />
in UTF-8 text format.<br />
CosObj<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfpageaddlinkannotation,<br />
dlpdfpageaddlinkannotationfromname,<br />
dlpdfpageaddtextannotation<br />
All <strong>DLI</strong>-supported platforms.<br />
Technical Notes<br />
1 You should have your internet browser running before calling this procedure or<br />
you may receive a “browser is busy” error. Your browser can be specified in Adobe<br />
Acrobat or Adobe Reader via File->Preferences->Weblink.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.115<br />
dlpdfpagecosobj (DLPDFPAGE *Page)<br />
Return Value: CosObj<br />
Description<br />
Parameters<br />
Return Value<br />
This function will return a COS structure that<br />
represents the page in the Adobe PDF Library.<br />
It may be used to apply COS Layer operations<br />
to the page beyond those functions defined in<br />
the package.<br />
DLPDFPAGE *Page<br />
CosObj<br />
Exceptions<br />
Header<br />
dli.h<br />
Related Methods<br />
Availability<br />
All <strong>DLI</strong>-supported platforms.
A.116 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfpagecreate (DLPDFDOC *Doc, ASFixed Width,<br />
ASFixed Height)<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Return Value: DLPDFPAGE*<br />
Description<br />
Parameters<br />
Return Value<br />
Exceptions<br />
Header<br />
Creates a new page in the current document,<br />
positioned to follow all other pages in the current<br />
document.<br />
• DLPDFDOC *Doc: Represents the document<br />
structure <strong>and</strong> the current status of the<br />
document at all times.<br />
• ASFixed Width: Must be specified as<br />
greater than zero; assumed to be in points.<br />
• ASFixed Height: Must be specified as<br />
greater than zero; assumed to be in points.<br />
DLPDFPAGE*<br />
genErrBadParam: Raised if the specified document<br />
does not exist.<br />
dli.h<br />
Related Methods<br />
Availability<br />
All <strong>DLI</strong>-supported platforms.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.117<br />
dlpdfpagefindfromnumber (DLPDFDOC *Doc,<br />
long PageNumber)<br />
Return Value: DLPDFPAGE*<br />
Description<br />
Parameters<br />
Return Value<br />
Allows pages to be modified after creation without<br />
requiring pointers to all pages in the application.<br />
If the page number specified has not yet<br />
been created, a NULL pointer will be returned.<br />
The first page is considered to be page one.<br />
• DLPDFDOC *Doc represents the document<br />
structure <strong>and</strong> the current status of the<br />
document at all times.<br />
• long PageNumber<br />
DLPDFPAGE*<br />
Exceptions<br />
Header<br />
dli.h<br />
Related Methods<br />
Availability<br />
All <strong>DLI</strong>-supported platforms.
A.118 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfpagenumber (DLPDFPAGE *Page)<br />
Return Value: long<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Description<br />
Parameters<br />
Return Value<br />
Returns the sequence number of the specified<br />
page. This number may be used in conjunction<br />
with the PDDoc returned by dlpdfdocpddoc<br />
to acquire a PDPage for the specified page. This<br />
PDPage will permit Edit Layer functions to be<br />
applied to the page beyond those defined in this<br />
package.<br />
DLPDFPAGE *Page<br />
long<br />
Exceptions<br />
Header<br />
dli.h<br />
Related Methods<br />
Availability<br />
All <strong>DLI</strong>-supported platforms.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.119<br />
dlpdfpagerotate (DLPDFPAGE *Page, PDRotate<br />
Angle)<br />
Return Value: void<br />
Description<br />
Parameters<br />
Return Value<br />
Rotates page clockwise in 90-degree increments.<br />
Angles specified will be reduced if necessary by<br />
360 degrees, then rounded to the nearest 90-<br />
degree increment.<br />
• DLPDFPAGE *Page<br />
• PDRotate Angle<br />
void<br />
Exceptions<br />
Header<br />
dli.h<br />
Related Methods<br />
Availability<br />
All <strong>DLI</strong>-supported platforms.<br />
Technical Notes<br />
1 This call may be issued at any time after a page is created, <strong>and</strong> will be effective in<br />
PDF <strong>and</strong> Adobe PostScript.
A.120 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfpagesetart (DLPDFPAGE *Page, ASFixedRect<br />
*Rect)<br />
Return Value: void<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Description<br />
Parameters<br />
Return Value<br />
Sets the Art box for the DLPDFPAGE provided<br />
as input to the function. Please see the "Page<br />
Boundaries" section of Prepress Support in the<br />
Adobe PDF <strong>Reference</strong> Manual for more details.<br />
• DLPDFPAGE *Page<br />
• ASFixedRect *Rect<br />
void<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfpagesetbleed,<br />
dlpdfpagesetcrop,<br />
dlpdfpagesetmediabox,<br />
dlpdfpagesettrim<br />
All <strong>DLI</strong>-supported platforms.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.121<br />
dlpdfpagesetbleed (DLPDFPAGE *Page,<br />
ASFixedRect *Rect)<br />
Return Value: void<br />
Description<br />
Parameters<br />
Return Value<br />
Sets the Bleed box for the DLPDFPAGE provided<br />
as input to the function. Please see the "Page<br />
Boundaries" section of Prepress Support in the<br />
Adobe PDF <strong>Reference</strong> Manual for more details.<br />
• DLPDFPAGE *Page<br />
• ASFixedRect *Rect<br />
void<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfpagesetart,<br />
dlpdfpagesetcrop,<br />
dlpdfpagesetmediabox,<br />
dlpdfpagesettrim<br />
All <strong>DLI</strong>-supported platforms.
A.122 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfpagesetcrop (DLPDFPAGE *Page, ASFixedRect<br />
*Rect)<br />
Return Value: void<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Description<br />
Parameters<br />
Return Value<br />
Sets the Crop box for the DLPDFPAGE provided<br />
as input to the function. Please see the "Page<br />
Boundaries" section of Prepress Support in the<br />
Adobe PDF <strong>Reference</strong> Manual for more details.<br />
• DLPDFPAGE *Page<br />
• ASFixedRect *Rect<br />
void<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfpagesetart,<br />
dlpdfpagesetbleed,<br />
dlpdfpagesetmediabox,<br />
dlpdfpagesettrim<br />
All <strong>DLI</strong>-supported platforms.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.123<br />
dlpdfpagesetid (DLPDFPAGE *Page, char *Id)<br />
Return Value: void<br />
Description<br />
Parameters<br />
Return Value<br />
Adds an ID Entry to the page dictionary. This is<br />
generally a page’s FOLIO.<br />
• DLPDFPAGE *Page<br />
• char *Id: ID entry.<br />
void<br />
Exceptions<br />
Header<br />
dli.h<br />
Related Methods<br />
Availability<br />
All <strong>DLI</strong>-supported platforms.
A.124 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfpagesetmediabox (DLPDFPAGE *Page,<br />
ASFixedRect *Rect)<br />
Return Value: void<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Description<br />
Parameters<br />
Return Value<br />
Sets the Media box for the DLPDFPAGE provided<br />
as input to the function. Please see the<br />
"Page Boundaries" section of Prepress Support<br />
in the Adobe PDF <strong>Reference</strong> Manual for more<br />
details.<br />
• DLPDFPAGE *Page<br />
• ASFixedRect *Rect<br />
void<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfpagesetart,<br />
dlpdfpagesetbleed,<br />
dlpdfpagesetcrop,<br />
dlpdfpagesettrim<br />
All <strong>DLI</strong>-supported platforms.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.125<br />
dlpdfpagesettrim (DLPDFPAGE *Page, ASFixedRect<br />
*Rect)<br />
Return Value: void<br />
Description<br />
Parameters<br />
Return Value<br />
Sets the Trim box for the DLPDFPAGE provided<br />
as input to the function. Please see the "Page<br />
Boundaries" section of Prepress Support in the<br />
Adobe PDF <strong>Reference</strong> Manual for more details.<br />
• DLPDFPAGE *Page<br />
• ASFixedRect *Rect<br />
void<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfpagesetart,<br />
dlpdfpagesetbleed,<br />
dlpdfpagesetcrop,<br />
dlpdfpagesetmediabox<br />
All <strong>DLI</strong>-supported platforms.
A.126 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfpathaddarc (DLPDFPATH *Path, ASFixed X,<br />
ASFixed Y, ASFixed Rad, ASFixed T1, ASFixed T2)<br />
Return Value: void<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Description<br />
Parameters<br />
Return Value<br />
Appends an arc segment to the current path.<br />
The current position will be set to the ending<br />
point.<br />
• DLPDFPATH *Path: Pointer to the path.<br />
• ASFixed X: Starting X position of the arc<br />
• ASFixed Y: Starting Y position of the arc<br />
• ASFixed Rad: Radius of the arc<br />
• ASFixed T1: Start angle for the arc<br />
• ASFixed T2: End angle for the arc<br />
void<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfpathaddarcn,<br />
dlpdfpatthaddarcto,<br />
dlpdfpathaddelliparc,<br />
dlpdfpathadddelliparcn,<br />
dlpdfpathaddelliparcto<br />
All <strong>DLI</strong>-supported platforms.<br />
Technical Notes<br />
1 If the current position is not the starting position defined by<br />
(X,Y,Radius,StartAngle), then a straight line segment will be added from the<br />
current position to get there. A smooth curve of the specified radius will be drawn<br />
from that specified point counter-clockwise to the angle specified by EndAngle.<br />
2 If the starting <strong>and</strong> ending degree values specify the same angle, a full circle will be<br />
drawn, <strong>and</strong> the position following this comm<strong>and</strong> will be the specified position.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.127<br />
dlpdfpathaddarcn (DLPDFPATH *Path, ASFixed X,<br />
ASFixed Y, ASFixed Rad, ASFixed T1, ASFixed T2)<br />
Return Value: void<br />
Description<br />
Parameters<br />
Return Value<br />
Identical to dlpdfpathaddarc, except the<br />
arc will be drawn clockwise.<br />
• DLPDFPATH *Path is the pointer to the<br />
path.<br />
• ASFixed X<br />
• ASFixed Y<br />
• ASFixed Rad<br />
• ASFixed T1<br />
• ASFixed T2<br />
void<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfpathaddarc,<br />
dlpdfpatthaddarcto,<br />
dlpdfpathaddelliparc,<br />
dlpdfpathadddelliparcn,<br />
dlpdfpathaddelliparcto<br />
All <strong>DLI</strong>-supported platforms.
A.128 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfpathaddarcto (DLPDFPATH *Path, ASFixed<br />
X1, ASFixed Y1, ASFixed X2, ASFixed Y2, ASFixed Rad)<br />
Return Value: void<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Description<br />
Parameters<br />
Return Value<br />
Appends a straight line segment from the current<br />
position towards the first pair of X <strong>and</strong> Y<br />
coordinates specified, terminating when it intersects<br />
an arc connecting this line to a second line<br />
drawn between the first <strong>and</strong> second pairs of<br />
(X,Y) coordinates. The arc is circular, drawn at<br />
the specified radius.<br />
• DLPDFPATH *Path is the pointer to the<br />
path.<br />
• ASFixed X1 is the X-axis position of the<br />
intersection of tangents.<br />
• ASFixed Y1 is the Y-axis position of the<br />
intersection of tangents.<br />
• ASFixed X2 is the X-axis position of a<br />
point defining the second tangent.<br />
• ASFixed Y2 is the Y-axis position of a point<br />
defining the second tangent.<br />
• ASFixed Rad is the radius of the arc.<br />
void<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfpathaddarcn,<br />
dlpdfpatthaddarc,<br />
dlpdfpathaddelliparc,<br />
dlpdfpathadddelliparcn,<br />
dlpdfpathaddelliparcto<br />
All <strong>DLI</strong>-supported platforms.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.129<br />
Xint1/<br />
Yint1<br />
X1/Y1<br />
Xint2/<br />
Yint2<br />
Current Position<br />
X2/Y2<br />
Technical Notes<br />
1 The two lines (CurrX,CurrY)->(X1,Y1) <strong>and</strong> (X2,Y2)->(X1,Y1) are joined by an<br />
arc of radius (Rad). The line segment from the current position to the start of the<br />
arc is drawn, followed by the arc itself, finishing at (Xint2,Yint2). The line<br />
segment from the end of the arc to the point (X2,Y2) is not drawn.<br />
2 The position following this comm<strong>and</strong> will be the intersection of the arc with the<br />
line (X2,Y2)->(X1,Y1), shown above as (Xint2,Yint2). If the two lines are<br />
colinear, a straight line segment is drawn from the current position to (X1,Y1),<br />
which then becomes the current point.
A.130 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfpathaddclose (DLPDFPATH *Path)<br />
Return Value: void<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Description<br />
Parameters<br />
Return Value<br />
Appends a “close path” operator to the<br />
path. The current position after the path is<br />
closed is (1,-1).<br />
DLPDFPATH *Path is the pointer to the path<br />
void<br />
Exceptions<br />
Header<br />
dli.h<br />
Related Methods<br />
Availability<br />
All <strong>DLI</strong>-supported platforms.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.131<br />
dlpdfpathaddcurve (DLPDFPATH *Path, ASFixed<br />
Ctrl1X, ASFixed Ctrl1Y, ASFixed Ctrl2X, ASFixed Ctrl2Y,<br />
ASFixed EndX, ASFixed EndY)<br />
Return Value: void<br />
Description<br />
Parameters<br />
Return Value<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
Adds a spline or cubic Bézier curve to the path.<br />
• DLPDFPATH *Path is the pointer to the<br />
path.<br />
• ASFixed Ctrl1X is the X position of a<br />
point which will be Control Point 1.<br />
• ASFixed Ctrl1Y is the Y position of a<br />
point which will be Control Point 1.<br />
• ASFixed Ctrl2X is the X position of a<br />
point which will be Control Point 2.<br />
• ASFixed Ctrl2Y is the Y position of a<br />
point which will be Control Point 2.<br />
• ASFixed EndX is the X position which will<br />
be the end point of the curve.<br />
• ASFixed EndY is the Y position which will<br />
be the end point of the curve.<br />
void<br />
genErrBadParam is returned if no starting<br />
point is specified.<br />
dli.h<br />
dlpdfpathaddcurver,<br />
dlpdfpathaddcurvev,<br />
dlpdfpathaddcurvey<br />
All <strong>DLI</strong>-supported platforms.
A.132 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
Ctrl1X/<br />
Ctrl1Y<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
EndX/<br />
EndY<br />
StartX/<br />
StartY<br />
Ctrl2X/<br />
Ctrl2Y<br />
Technical Notes<br />
1 A smooth curve (a cubic Bézier) will be drawn from the current position to the end<br />
position, under direction of the two control points. At completion of this<br />
operation, the current position will be the end position of the line. If the end<br />
position specified is identical to the current position, no segment will be appended<br />
<strong>and</strong> no notice will be given (optimization).<br />
2 All Bézier curves consist of four points. This method (as well as<br />
dlpdfpathaddcurver, dlpdfpathaddcurvev <strong>and</strong> dlpdfpathaddcurvey)<br />
uses current position as the starting point of the curve. The first two parameters of<br />
this method are the position of Control Point1, the second two parameters are the<br />
position of Control Point 2, <strong>and</strong> the last two parameters are the position of the<br />
end point of the curve.<br />
3 If no starting point is specified, the method will raise an exception<br />
(genErrBadParm).
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.133<br />
dlpdfpathaddcurver (DLPDFPATH *Path, ASFixed<br />
Ctrl1X, ASFixed Ctrl1Y, ASFixed Ctrl2X, ASFixed Ctrl2Y,<br />
ASFixed EndX, ASFixed EndY)<br />
Return Value: void<br />
Description<br />
Parameters<br />
Return Value<br />
Identical to dlpdfpathaddcurve, except<br />
that the positions are expressed as relative distances<br />
from the current point, not absolute distances<br />
from the origin.<br />
• DLPDFPATH *Path is the pointer to the<br />
path<br />
• ASFixed Ctrl1X is the X position of a<br />
point which will be Control Point 1.<br />
• ASFixed Ctrl1Y is the Y position of a<br />
point which will be Control Point 1.<br />
• ASFixed Ctrl2X is the X position of a<br />
point which will be Control Point 2.<br />
• ASFixed Ctrl2Y is the Y position of a<br />
point which will be Control Point 2.<br />
• ASFixed EndX is the X position which will<br />
be the end point of the curve.<br />
• ASFixed EndY is the Y position which will<br />
be the end point of the curve.<br />
void<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfpathaddcurve,<br />
dlpdfpathaddcurvev,<br />
dlpdfpathaddcurvey<br />
All <strong>DLI</strong>-supported platforms.
A.134 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfpathaddcurvev (DLPDFPATH *Path, ASFixed<br />
Ctrl2X, ASFixed Ctrl2Y, ASFixed EndX, ASFixed EndY)<br />
Return Value: void<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Description<br />
Parameters<br />
Return Value<br />
Identical to dlpdfpathaddcurve, except<br />
that both the start <strong>and</strong> first control point are<br />
assumed to be the current position.<br />
• DLPDFPATH *Path: The pointer to the<br />
path.<br />
• ASFixed Ctrl2X: The X position of a<br />
point which will be Control Point 2.<br />
• ASFixed Ctrl2Y: The Y position of a<br />
point which will be Control Point 2.<br />
• ASFixed EndX: The X position which will<br />
be the end point of the curve.<br />
• ASFixed EndY: The Y position which will<br />
be the end point of the curve.<br />
void<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfpathaddcurve,<br />
dlpdfpathaddcurver,<br />
dlpdfpathaddcurvey<br />
All <strong>DLI</strong>-supported platforms.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.135<br />
EndX/<br />
EndY<br />
StartX/<br />
StartY<br />
Ctrl1X/<br />
Ctrl1Y<br />
Ctrl2X/<br />
Ctrl2Y<br />
Technical Notes<br />
1 This method is identical to dlpdfpathaddcurve, except that both the start <strong>and</strong><br />
first control point are assumed to be the current position.
A.136 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfpathaddcurvey (DLPDFPATH *Path, ASFixed<br />
Ctrl1X, ASFixed Ctrl1Y, ASFixed EndX, ASFixed EndY)<br />
Return Value: void<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Description<br />
Parameters<br />
Return Value<br />
Identical to dlpdfpathaddcurve, except<br />
that the second control point is assumed to be<br />
the ending position.<br />
• DLPDFPATH *Path is the pointer to the<br />
path<br />
• ASFixed Ctrl1X<br />
• ASFixed Ctrl1Y<br />
• ASFixed EndX<br />
• ASFixed EndY<br />
void<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfpathaddcurve,<br />
dlpdfpathaddcurver,<br />
dlpdfpathaddcurvev<br />
All <strong>DLI</strong>-supported platforms.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.137<br />
Ctrl1X/<br />
Ctrl1Y<br />
StartX/<br />
StartY<br />
EndX/<br />
EndY<br />
Ctrl2X/<br />
Ctrl2Y<br />
Technical Notes<br />
1 This method is identical to dlpdfpathaddcurve, except that the second control<br />
point is assumed to be the ending position.
A.138 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfpathaddelliparc (DLPDFPATH *Path,<br />
ASFixed CentX, ASFixed CentY, ASFixed HRad, ASFixed<br />
VRad, ASFixed T1, ASFixed T2)<br />
Return Value: void<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Description<br />
Parameters<br />
Return Value<br />
Appends an arc segment to the current path.<br />
This method accepts seven parameters.<br />
• DLPDFPATH *Path is the pointer to the<br />
path.<br />
• ASFixed CentX is the X-axis position of<br />
the arc center point.<br />
• ASFixed CentY is the Y-axis position of<br />
the arc center point.<br />
• ASFixed HRad is the horizontal radius of<br />
the ellipse defining an arc segment.<br />
• ASFixed VRad is the vertical radius of the<br />
same ellipse. The HRad <strong>and</strong> VRad functions<br />
support creating arc segments from an<br />
elliptical shape, as opposed to the circular<br />
shape described in dlpdfpathaddarc,<br />
although if the same value is used for both<br />
horizontal <strong>and</strong> vertical radii, it behaves<br />
identically to dlpdfpathaddarc.<br />
• ASFixed T1 is the beginning arc angle<br />
(where zero is directly to the right of center).<br />
• ASFixed T2 is the ending arc angle.<br />
void<br />
Exceptions<br />
Header<br />
Related Methods<br />
dli.h<br />
dlpdfpathaddarc,<br />
dlpdfpathaddarcn,<br />
dlpdfpatthaddarcto,<br />
dlpdfpathadddelliparcn,<br />
dlpdfpathaddelliparcto<br />
Availability
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.139<br />
Technical Notes<br />
1 If the current position does not coincide with the position defined by<br />
(CentX,CentY,HRad,VRad,StartAngle), then a straight line segment will be<br />
added from the current position to get there. A smooth curve of the specified<br />
radius will be drawn from that specified point counter-clockwise to the point<br />
specified by (CentX,CentY,HRad,VRad,EndAngle). The current position will be<br />
set to that ending point. If the starting <strong>and</strong> ending points specify the same angle, a<br />
full circle will be drawn.<br />
2 The position following this comm<strong>and</strong> will be the specified position.
A.140 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfpathaddelliparcn (DLPDFPATH *Path,<br />
ASFixed CentX, ASFixed CentY, ASFixed HRad, ASFixed<br />
VRad, ASFixed T1, ASFixed T2)<br />
Return Value: void<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Description<br />
Parameters<br />
Return Value<br />
This method is identical to dlpdfpathaddelliparc,<br />
except that the arc will be drawn<br />
clockwise.<br />
• DLPDFPATH *Path is the pointer to the<br />
path.<br />
• ASFixed CentX is the X-axis position of<br />
the arc center point.<br />
• ASFixed CentY is the Y-axis position of<br />
the arc center point.<br />
• ASFixed HRad is the horizontal radius of<br />
the ellipse defining an arc segment.<br />
• ASFixed VRad is the vertical radius of the<br />
same ellipse. The HRad <strong>and</strong> VRad functions<br />
support creating arc segments from an<br />
elliptical shape, as opposed to the circular<br />
shape described in dlpdfpathaddarc,<br />
although if the same value is used for both<br />
horizontal <strong>and</strong> vertical radii, it behaves<br />
identically to dlpdfpathaddarc.<br />
• ASFixed T1 is the beginning arc angle<br />
(where zero is directly to the right of center).<br />
• ASFixed T2 is the ending arc angle.<br />
void<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfpathaddarc,<br />
dlpdfpathaddarcn,<br />
dlpdfpatthaddarcto,<br />
dlpdfpathaddelliparc,<br />
dlpdfpathaddelliparcto<br />
All <strong>DLI</strong>-supported platforms.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.141<br />
dlpdfpathaddelliparcto (DLPDFPATH *Path,<br />
ASFixed X1, ASFixed Y1, ASFixed X2, ASFixed Y2, ASFixed<br />
HRad, ASFixed VRad)<br />
Return Value: void<br />
Description<br />
Parameters<br />
Return Value<br />
Appends a straight line segment from the current<br />
position towards the first pair of X <strong>and</strong> Y<br />
coordinates specified, terminating when it intersects<br />
an arc connecting this line to a second line<br />
drawn between the first <strong>and</strong> second pairs of<br />
(X,Y) coordinates. The arc is elliptical, drawn at<br />
the specified horizontal <strong>and</strong> vertical radius.<br />
• DLPDFPATH *Path: The pointer to the<br />
path<br />
• ASFixed X1: The Xposition of the<br />
intersection of tangents<br />
• ASFixed Y1: The Yposition of the<br />
intersection of tangents<br />
• ASFixed X2: The Xposition of the endpoint<br />
of the second tangent<br />
• ASFixed Y2: The Yposition of the endpoint<br />
of the second tangent<br />
• ASFixed HRad: The horizontal radius of<br />
the arc<br />
• ASFixed VRad: The vertical radius of the<br />
arc<br />
void<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfpathaddarc,<br />
dlpdfpathaddarcn,<br />
dlpdfpathaddarcto,<br />
dlpdfpathaddelliparc<br />
All <strong>DLI</strong>-supported platforms.
A.142 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfpathaddline (DLPDFPATH *Path, ASFixed X,<br />
ASFixed Y)<br />
Return Value: void<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Description<br />
Parameters<br />
Return Value<br />
Draws a line from the current position to the<br />
specified new position. If the current position is<br />
the same as the new position, no line segment<br />
will be added to the path <strong>and</strong> no notice will be<br />
given. The current position following this comm<strong>and</strong><br />
will be the specified position.<br />
• DLPDFPATH *Path is the pointer to the<br />
path.<br />
• ASFixed X is the absolute X-axis position.<br />
• ASFixed Y is the absolute Y-axis position.<br />
void<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfpathaddliner<br />
All <strong>DLI</strong>-supported platforms.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.143<br />
dlpdfpathaddliner (DLPDFPATH *Path, ASFixed X,<br />
ASFixed Y)<br />
Return Value: void<br />
Description<br />
Parameters<br />
Return Value<br />
Draws a line from the current position for the<br />
given X <strong>and</strong> Y offset distances (i.e. this is a<br />
movement relative to the current position). If<br />
the distances specified are both zero, no line<br />
segment will be added to the path <strong>and</strong> no notice<br />
will be given. The position following this comm<strong>and</strong><br />
will be the position derived by applying<br />
the X <strong>and</strong> Y offsets to the prior position.<br />
• DLPDFPATH *Path is the pointer to the<br />
path.<br />
• ASFixed X is the X-axis distance to draw<br />
from the current X position to the new X<br />
position.<br />
• ASFixed Y is the Y-axis distance to draw<br />
from the current Y position to the specified Y<br />
position.<br />
void<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfpathaddline<br />
All <strong>DLI</strong>-supported platforms.
A.144 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfpathaddmove (DLPDFPATH *Path, ASFixed<br />
X, ASFixed Y)<br />
Return Value: void<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Description<br />
Parameters<br />
Return Value<br />
Moves the current position to the specified new<br />
position without adding a stroked line. If the<br />
current position is the same as the specified new<br />
position, no adjustment of the current position<br />
will be added to the path <strong>and</strong> no notice will be<br />
given. The position following this comm<strong>and</strong><br />
will be the specified position.<br />
• DLPDFPATH *Path is the pointer to the<br />
path.<br />
• ASFixed X is the specified X-axis position.<br />
• ASFixed Y is the specified Y-axis position.<br />
void<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfpathaddmover<br />
All <strong>DLI</strong>-supported platforms.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.145<br />
dlpdfpathaddmover (DLPDFPATH *Path, ASFixed<br />
X, ASFixed Y)<br />
Return Value: void<br />
Description<br />
Parameters<br />
Return Value<br />
Moves the current position for the given X <strong>and</strong><br />
Y offset distances (i.e. this is a movement relative<br />
to the current position). If the distances<br />
specified are both zero, no movement will be<br />
added to the path <strong>and</strong> no notice will be given.<br />
The position following this comm<strong>and</strong> will be<br />
derived by applying the X <strong>and</strong> Y offsets to the<br />
prior position.<br />
• DLPDFPATH *Path is the pointer to the<br />
path.<br />
• ASFixed X is the X-axis distance to move<br />
from the current X position to the new X<br />
position.<br />
• ASFixed Y is the Y-axis distance to move<br />
from the current Y position to the new Y<br />
position.<br />
void<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfpathaddmove<br />
All <strong>DLI</strong>-supported platforms.
A.146 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfpathaddrect (DLPDFPATH *Path, ASFixed X,<br />
ASFixed Y, ASFixed Width, ASFixed Depth)<br />
Return Value: void<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Description<br />
Parameters<br />
Return Value<br />
Draws a rectangle.<br />
• DLPDFPATH *Path is the pointer to the<br />
path<br />
• ASFixed X is the X position of a point<br />
which will be one corner of the box<br />
• ASFixed Y is the Y position of a point<br />
which will be one corner of the box<br />
• ASFixed Width will be the width of the<br />
box<br />
• ASFixed Depth will be the depth of the<br />
box<br />
void<br />
Exceptions<br />
Header<br />
dli.h<br />
Related Methods<br />
Availability<br />
All <strong>DLI</strong>-supported platforms.<br />
Technical Notes<br />
1 If the specified position is not the current position, a MoveTo to the specified<br />
position will be made. A rectangle will be added to the path, starting at the<br />
specified position <strong>and</strong> proceeding upward (unless Depth is negative) <strong>and</strong> to the<br />
right (unless Width is negative). The end position after this operation will be the<br />
specified position. If Width <strong>and</strong> Depth are both zero, no segment will be<br />
appended, but the current position will still be updated.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.147<br />
dlpdfpatharray (DLPDFPATH *Path)<br />
Return Value: ASFixed*<br />
Description<br />
Parameters<br />
Return Value<br />
This method will return a pointer to the first<br />
member of the array of ASFixed integers,<br />
which is the path.<br />
DLPDFPATH *Path is the pointer to the path.<br />
ASFixed*<br />
Exceptions<br />
Header<br />
dli.h<br />
Related Methods<br />
Availability<br />
All <strong>DLI</strong>-supported platforms.
A.148 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfpathclear (DLPDFPATH *Path)<br />
Return Value: void<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Description<br />
Parameters<br />
Return Value<br />
Exceptions<br />
Header<br />
Used to reset a path, this method will set the<br />
current position to UNSET, set the matrix to<br />
UNITY, <strong>and</strong> remove any path segment present.<br />
It will not deallocate the array used to hold the<br />
path, however, since its primary purpose is to<br />
lower the overhead associated with allocation<br />
<strong>and</strong> deallocation.<br />
DLPDFPATH *Path is the pointer to the path.<br />
void<br />
genErrBadParam is raised if the method is<br />
called with a NULL pointer.<br />
dli.h<br />
Related Methods<br />
Availability<br />
All <strong>DLI</strong>-supported platforms.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.149<br />
dlpdfpathcreate (void)<br />
Return Value: DLPDFPATH*<br />
Description<br />
Parameters<br />
Return Value<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
Creates a new, empty DLPDFPATH structure.<br />
None<br />
DLPDFPATH*<br />
genErrNoMemory<br />
dli.h<br />
dlpdfpathdestroy<br />
All <strong>DLI</strong>-supported platforms.
A.150 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfpathcurrentx (DLPDFPATH *Path)<br />
Return Value: ASFixed<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Description<br />
Parameters<br />
Return Value<br />
This method will return the current X position<br />
as an ASFixed value.<br />
DLPDFPATH *Path is the pointer to the path<br />
ASFixed<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfpathcurrenty<br />
All <strong>DLI</strong>-supported platforms.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.151<br />
dlpdfpathcurrenty (DLPDFPATH *Path)<br />
Return Value: ASFixed<br />
Description<br />
Parameters<br />
Return Value<br />
This method will return the current Y position<br />
as an ASFixed value.<br />
DLPDFPATH *Path is the pointer to the path.<br />
ASFixed<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfpathcurrentx<br />
All <strong>DLI</strong>-supported platforms.
A.152 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfpathdestroy (DLPDFPATH *Path)<br />
Return Value: void<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Description<br />
Parameters<br />
Return Value<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
Destroys a DLPDFPATH structure <strong>and</strong> frees its<br />
resources.<br />
DLPDFPATH *Path: The pointer to the path<br />
void<br />
genErrBadParam: Raised if the pointer is not<br />
valid<br />
dli.h<br />
dlpdfpathcreate<br />
All <strong>DLI</strong>-supported platforms.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.153<br />
dlpdfpathsetmatrix (DLPDFPATH *Path,<br />
ASFixedMatrix *Matrix)<br />
Return Value: void<br />
Description<br />
Parameters<br />
Return Value<br />
Exceptions<br />
Header<br />
This method will accept a pointer to a path <strong>and</strong><br />
a pointer to a matrix. The specified matrix will<br />
be concatenated to the matrix of the container<br />
in each container in which this path is drawn.<br />
This allows the user complete <strong>and</strong> flexible control<br />
of the shape drawn by the path.<br />
• DLPDFPATH *Path is the pointer to the<br />
path<br />
• ASFixedMatrix *Matrix<br />
void<br />
genErrBadParam exception is raised if the<br />
pointer to the path or the matrix is NULL<br />
dli.h<br />
Related Methods<br />
Availability<br />
All <strong>DLI</strong>-supported platforms.
A.154 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfpathsize (DLPDFPATH *Path)<br />
Return Value: ASInt32<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Description<br />
Parameters<br />
Return Value<br />
This method will return the current size of the<br />
path array as an integer.<br />
DLPDFPATH *Path is the pointer to the path.<br />
ASInt32<br />
Exceptions<br />
Header<br />
dli.h<br />
Related Methods<br />
Availability<br />
All <strong>DLI</strong>-supported platforms.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.155<br />
dlpdfpatterncreate (DLPDFDOC *Doc,<br />
DLPDFCONTENT *Content, ASFixedRect *BBox,<br />
ASFixedMatrix *Matrix, int Colored, int TileType, ASFixed<br />
XStep, ASFixed YStep)<br />
Return Value: DLPDFPATTERN*<br />
Description<br />
Parameters<br />
Return Value<br />
This creates a patterned color space <strong>and</strong> returns<br />
a pointer to that space. The pointer may be used<br />
in dlpdfcontentusefillpattern or<br />
dlpdfcontentusestrokepattern to<br />
apply this colored pattern to all following material.<br />
All patterns will be destroyed <strong>and</strong> their<br />
h<strong>and</strong>les invalidated at the destruction of the<br />
document that contains them.<br />
• DLPDFDOC *Doc: represents the document<br />
structure <strong>and</strong> the current status of the<br />
document at all times.<br />
• DLPDFCONTENT *Content: Represents the<br />
content element. These structures are<br />
destroyed when associated with a page or<br />
form, <strong>and</strong> pointers to them should not be<br />
used after that time.<br />
• ASFixedRect *BBox<br />
• ASFixedMatrix *Matrix<br />
• int Colored<br />
• int TileType<br />
• ASFixed XStep<br />
• ASFixed YStep<br />
DLPDFPATTERN*<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfcontentusefillpattern,<br />
dlpdfcontentusestrokepattern<br />
All <strong>DLI</strong>-supported platforms.
A.156 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfpatternrotate (ASFixedMatrix *Matrix,<br />
ASFixed Angle)<br />
Return Value: void<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Description<br />
Parameters<br />
Return Value<br />
This function will modify the specified matrix<br />
so as to effect counter-clockwise rotation of any<br />
marks drawn via this matrix. Angle is an angle<br />
in degrees <strong>and</strong> fractions of degrees.<br />
• ASFixedMatrix *Matrix<br />
• ASFixed Angle<br />
void<br />
Exceptions<br />
Header<br />
dli.h<br />
Related Methods<br />
Availability<br />
All <strong>DLI</strong>-supported platforms.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.157<br />
dlpdfpageplacesignature (DLPDFPAGE *Page,<br />
DLPDFSIGNATURE *Sig, ASFixedRect *imageBBox)<br />
Return Value: void<br />
Description<br />
Parameters<br />
Return Value<br />
This call associates a digital signature to a page<br />
in the PDF file generated by <strong>DLI</strong>. This call is<br />
required for all digital signatures including<br />
invisible ones, although for invisible digital signatures,<br />
the imageBBox is ignored <strong>and</strong> may be<br />
NULL.<br />
• DLPDFPAGE *Page: page to receive the<br />
signature<br />
• DLPDFSIGNATURE *Sig: signature to be<br />
associated with the page<br />
• ASFixedRect *imageBBox: bounding<br />
box in which signature must fit.<br />
void<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfdoccreatesignature,<br />
dlpdfdocsetsignatureappearance<br />
dlpdfdocwritepdf<br />
All <strong>DLI</strong>-supported platforms.
A.158 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfseterrorfile (FILE *errorFilePtr)<br />
Return Value: void<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Description<br />
Parameters<br />
Return Value<br />
Sets file to which error messages will be logged.<br />
File *errorFilePtr: By default error messages<br />
are logged to stderr<br />
void<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfsetwarningfile<br />
All <strong>DLI</strong>-supported platforms.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.159<br />
dlpdfsetwarningfile (FILE * warningFilePtr)<br />
Return Value: void<br />
Description<br />
Parameters<br />
Return Value<br />
Sets file to which warning messages will be<br />
logged.<br />
File *warningFilePtr: By default warning<br />
messages are not logged.<br />
void<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfseterrorfile<br />
All <strong>DLI</strong>-supported platforms.
A.160 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfsignaturesetdatacallback<br />
(DLPDFSIGNATURE *signature, void (*dataCallback)(char *,<br />
int))<br />
Return Value: void<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Description<br />
Parameters<br />
Return Value<br />
This is an optional call for clients using PKCS<br />
#7 certificates. A callback function is supplied<br />
for the signature.<br />
• DLPDFSIGNATURE *signature: signature<br />
with which PKCS #7 certificate will be<br />
associated<br />
• void (*dataCallback)(char *,<br />
int): callback function, called during the<br />
dlpdfdocwritepdf function call; see<br />
Technical Notes below.<br />
void<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfsignaturesetpkcs7cert<br />
dlpdfdocwritepdf<br />
All <strong>DLI</strong>-supported platforms.<br />
Technical Notes<br />
1 The callback is called during the dlpdfdocwritepdf function with binary<br />
information from the PDF file. This information will be in sequential pieces, <strong>and</strong><br />
may be used to generate the PDF document hash value. The information is<br />
supplied as binary values in the character buffer; the length to read is supplied as<br />
the second parameter.<br />
• A length of 0 (zero) passed in the callback function indicates that no further data is<br />
to be read, <strong>and</strong> the hash may be finalized.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.161<br />
dlpdfsignaturesetpkcs7cert (DLPDFSIGNATURE<br />
*signature, int maxLen, int (*genPKCS7Cert)(char *))<br />
Return Value: void<br />
Description<br />
Parameters<br />
Return Value<br />
This function sets the certificate generation callback<br />
for DLPDFSIGNATUREs of type<br />
dlpdfsigacropkcs7 <strong>and</strong> dlpdfsigverisign.<br />
• DLPDFSIGNATURE *signature: signature<br />
with which certificate will be associated<br />
• int maxlen: number of bytes provided to<br />
the genPKCS7Cert callback<br />
• int (*genPKCS7Cert)(char *): callback<br />
function, called during the<br />
dlpdfdocwritepdf function call; see<br />
Technical Notes below.<br />
void<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfdocwritepdf<br />
dlpdfsignaturesetdatacallback<br />
dlpdfsignaturesetx509cert<br />
All <strong>DLI</strong>-supported platforms.<br />
Technical Notes<br />
1 For these signature types, dlpdfsigacropkcs7 <strong>and</strong> dlpdfsigverisign, the<br />
application using <strong>DLI</strong> is required to generated a fully-formed PKCS #7 certificate<br />
with an MD5 checksum of the PDF document, encrypted with the private key<br />
corresponding to the public key in the certificate. The RSA public-key algorithm<br />
with a 1024-bit key length is used.<br />
• The genPKCS7Cert callback is called by <strong>DLI</strong> during the dlpdfdocwritepdf<br />
function call. The callback is supplied a binary data buffer of length maxLen. The
A.162 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
first 16 bytes of this buffer contain the MD5 checksum (in binary) for the PDF<br />
document to sign. The callback must generate a PKCS #7 certificate as described<br />
above, <strong>and</strong> fill the data buffer with the certificate, in binary. The callback function<br />
must return the Concepts length to <strong>and</strong> read Facilities: from the data <strong>Guide</strong> buffer, to the in bytes. DL Pager Composition System<br />
NOTE: maxLen bytes are set aside in the output PDF file for the PKCS #7<br />
certificate, <strong>and</strong> will be written to the PDF file regardless of the actual certificate<br />
length. Callers should pass length values which are close to the certificate length,<br />
if possible.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.163<br />
dlpdfsignaturesetx509cert (DLPDFSIGNATURE<br />
*signature, char *certificate, int certLen, void<br />
(*encryptSHA1Hash)(char *))<br />
Return Value: void<br />
Description<br />
Parameters<br />
Return Value<br />
This call associates an x.509 v3 certificate with<br />
a DLPDFSIGNATURE object created as a<br />
dlpdfsigacrox509 certificate digital signature.<br />
• DLPDFSIGNATURE *signature: signature<br />
with which x.509 v3 certificate will be<br />
associated<br />
• char *certificate: a binary buffer in<br />
the certificate parameter; <strong>DLI</strong> will read<br />
certLen bytes from this buffer <strong>and</strong> make a<br />
copy for the PDF file's digital signature<br />
• int certLen: number of bytes to be read<br />
from certificate buffer<br />
• void (*encryptSHA1Hash)(char *):<br />
callback function, called during the<br />
dlpdfdocwritepdf function call; see<br />
Technical Notes below.<br />
void<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfdocwritepdf<br />
dlpdfsignaturesetpkcs7cert<br />
All <strong>DLI</strong>-supported platforms.<br />
Technical Notes<br />
1 It is an error to call this with a DLPDFSIGNATURE object created as a different
A.164 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
certificate type.<br />
2 The last parameter is a required callback function. This function will be called<br />
during the dlpdfdocwritepdf function call. It will be passed a character string<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
containing the SHA-1 hash for the PDF file being written, as a NULL-terminated<br />
string of hexadecimal digits using PKCS #1 padding, containing a BER OID<br />
(object identifier) for the SHA-1 algorithm. The buffer is 256 bytes long (not<br />
including the NULL terminator), <strong>and</strong> formatted as<br />
0001FFFF .. FF003021300906052B0E03021A05000414<br />
[ 40 hex digits for SHA-1 hash ]<br />
The callback function must encrypt this hash value with the private key<br />
corresponding to the public key in the signature's x.509 certificate, <strong>and</strong> fill the<br />
buffer passed in with 256 hexadecimal digits representing the encrypted value for<br />
the supplied BER formatted hash. A 1024-bit key is used for encryption<br />
operations. Note that the signed hash will not have padding, <strong>and</strong> must be exactly<br />
256 hexadecimal digits. Zeros must be used for padding, if required.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.165<br />
dlpdfterm (DLPDFINSTANCE * instance)<br />
Return Value: void<br />
Description<br />
Parameters<br />
Return Value<br />
Terminates the Adobe PDF Library <strong>and</strong> <strong>DLI</strong>.<br />
All active documents should be closed prior to<br />
this call.<br />
DLPDFINSTANCE *instance<br />
void<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdfinit,<br />
dlpdfttload<br />
All <strong>DLI</strong>-supported platforms.<br />
Technical Notes<br />
1 This will typically be one of the last calls of a program using <strong>DLI</strong>.<br />
2 In a multi-threaded application, each thread must do its own initialization <strong>and</strong><br />
termination of the Library.<br />
3 dlpdfinit <strong>and</strong> dlpdfterm are the only methods which must not be enclosed in<br />
exception h<strong>and</strong>lers (i.e. DURING/HANDLER/END_HANDLER statements), because<br />
they are not set up before initialization, <strong>and</strong> are freed during termination.<br />
4 As of <strong>DLI</strong> v3.0.11, the dlpdfterm call now removes memory files used for the<br />
dlpdfttload call if the Files In Memory filesystem is used, <strong>and</strong> if these files are<br />
no longer in use.
A.166 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdftext (void *Text, ASUns32 Length, ASAtom<br />
Encoding)<br />
Return Value: DLPDFTEXT*<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Description<br />
Parameters<br />
Return Value<br />
Returns a DLPDFTEXT structure for the given<br />
Text <strong>and</strong> Length, in the given Encoding.<br />
• void *Text: the text to be passed to the<br />
DLPDFTEXT structure<br />
• ASUns32 Length: Length of the Text<br />
string in bytes.<br />
• ASAtom Encoding: Encoding of the input<br />
Text; a valid ICU Encoding value; see<br />
Technical Notes below<br />
DLPDFTEXT*<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdftextfromutf8,<br />
dlpdftextfromutf16be,<br />
dlpdftextfromutf16he,<br />
dlpdftextfromutf16le,<br />
dlpdftextfromutf32be,<br />
dlpdftextfromutf32he,<br />
dlpdftextfromutf32le<br />
All <strong>DLI</strong>-supported platforms.<br />
Technical Notes<br />
1 Text passed to this method does not require a NULL terminator, since its Length is<br />
given as a calling argument. Conversely, the related methods listed above do not<br />
accept a Length argument, <strong>and</strong> assume that a NULL terminator is present.<br />
2 Valid ICU Encoding values for the Encoding argument of this method can be<br />
obtained via the dlpdftextshowencodingnames call.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.167<br />
dlpdftextadvance (DLPDFTEXT *Text,<br />
DLPDFFONT *Font, PDEGraphicState *GState,<br />
PDETextState *TState, ASFixed PointSize,<br />
ASFixed SetWidth, dlpdftext_X XMeaning,<br />
ASFixed Angle, ASFixedPoint *Advance)<br />
Return Value: void<br />
Description<br />
Parameters<br />
Return Value<br />
This method supplies the x <strong>and</strong> y advance for a<br />
string in a DLPDFTEXT area.<br />
• DLPDFTEXT *Text: the text structure to be<br />
acted upon<br />
• DLPDFFONT *Font: The specified font<br />
• PDEGraphicState *GState: Contains<br />
definitions of colors to be applied, <strong>and</strong> line<br />
sizes <strong>and</strong> parameters to be used when<br />
drawing a path<br />
• PDETextState *TState: Current text<br />
state; should not be NULL. A zero-filled<br />
PDETextState parameter is permitted.<br />
• ASFixed PointSize: Point size<br />
• ASFixed SetWidth: Set width<br />
• dlpdftext_X XMeaning:<br />
DLPDFTEXT_X_LEFT or<br />
DLPDFTEXT_X_RIGHT, used to indicate<br />
whether the starting location is the left or<br />
right end (respectively) of the text,<br />
distinguishing a left-to-right line order (e.g.<br />
English) from a right-to-left line order (e.g.<br />
Arabic)<br />
• ASFixed Angle: Angle of flow, in degrees,<br />
as an ASFixed counterclockwise angle<br />
• ASFixedPoint *Advance: The returned x<br />
<strong>and</strong> y position change after evaluation of the<br />
text<br />
void<br />
Exceptions
A.168 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
Header<br />
dli.h<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Related Methods<br />
Availability<br />
All <strong>DLI</strong>-supported platforms.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.169<br />
dlpdftextdestroy (DLPDFTEXT *Text)<br />
Return Value: void<br />
Description<br />
Parameters<br />
Return Value<br />
This method destroys the indicated DLPDFTEXT<br />
instance.<br />
DLPDFTEXT *Text: the text structure to be<br />
acted upon<br />
void<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdftext<br />
All <strong>DLI</strong>-supported platforms.
A.170 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdftextfromutf16be (void *Text)<br />
Return Value: DLPDFTEXT*<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Description<br />
Parameters<br />
Return Value<br />
Returns a DLPDFTEXT structure for the given<br />
UTF16 big-endian Unicode Text string.<br />
void *Text: the text to be passed to the DLP-<br />
DFTEXT structure<br />
DLPDFTEXT*<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdftext,<br />
dlpdftextfromutf16he,<br />
dlpdftextfromutf16le,<br />
dlpdftextfromutf32be,<br />
dlpdftextfromutf32he,<br />
dlpdftextfromutf32le,<br />
dlpdftextfromutf8<br />
All <strong>DLI</strong>-supported platforms.<br />
Technical Notes<br />
1 Text passed to this method requires a NULL terminator. Only the related method<br />
dlpdftext will accept unterminated text strings, since that method includes<br />
Length as an additional calling argument.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.171<br />
dlpdftextfromutf16he (void *Text)<br />
Return Value: DLPDFTEXT*<br />
Description<br />
Parameters<br />
Return Value<br />
Returns a DLPDFTEXT structure for the given<br />
UTF16 host-endian Unicode Text string.<br />
void *Text: the text to be passed to the DLP-<br />
DFTEXT structure<br />
DLPDFTEXT*<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdftext,<br />
dlpdftextfromutf16be,<br />
dlpdftextfromutf16le,<br />
dlpdftextfromutf32be,<br />
dlpdftextfromutf32he,<br />
dlpdftextfromutf32le,<br />
dlpdftextfromutf8<br />
All <strong>DLI</strong>-supported platforms.<br />
Technical Notes<br />
1 Text passed to this method requires a NULL terminator. Only the related method<br />
dlpdftext will accept unterminated text strings, since that method includes<br />
Length as an additional calling argument.
A.172 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdftextfromutf16le (void *Text)<br />
Return Value: DLPDFTEXT*<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Description<br />
Parameters<br />
Return Value<br />
Returns a DLPDFTEXT structure for the given<br />
UTF16 little-endian Unicode Text string.<br />
void *Text: the text to be passed to the DLP-<br />
DFTEXT structure<br />
DLPDFTEXT*<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdftext,<br />
dlpdftextfromutf16be,<br />
dlpdftextfromutf16he,<br />
dlpdftextfromutf32be,<br />
dlpdftextfromutf32he,<br />
dlpdftextfromutf32le,<br />
dlpdftextfromutf8<br />
All <strong>DLI</strong>-supported platforms.<br />
Technical Notes<br />
1 Text passed to this method requires a NULL terminator. Only the related method<br />
dlpdftext will accept unterminated text strings, since that method includes<br />
Length as an additional calling argument.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.173<br />
dlpdftextfromutf32be (void *Text)<br />
Return Value: DLPDFTEXT*<br />
Description<br />
Parameters<br />
Return Value<br />
Returns a DLPDFTEXT structure for the given<br />
UTF32 big-endian Unicode Text string.<br />
void *Text: the text to be passed to the DLP-<br />
DFTEXT structure<br />
DLPDFTEXT*<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdftext,<br />
dlpdftextfromutf16be,<br />
dlpdftextfromutf16he,<br />
dlpdftextfromutf16le,<br />
dlpdftextfromutf32he,<br />
dlpdftextfromutf32le,<br />
dlpdftextfromutf8<br />
All <strong>DLI</strong>-supported platforms.<br />
Technical Notes<br />
1 Text passed to this method requires a NULL terminator. Only the related method<br />
dlpdftext will accept unterminated text strings, since that method includes<br />
Length as an additional calling argument.
A.174 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdftextfromutf32he (void *Text)<br />
Return Value: DLPDFTEXT*<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Description<br />
Parameters<br />
Return Value<br />
Returns a DLPDFTEXT structure for the given<br />
UTF32 host-endian Unicode Text string.<br />
void *Text: the text to be passed to the DLP-<br />
DFTEXT structure<br />
DLPDFTEXT*<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdftext,<br />
dlpdftextfromutf16be,<br />
dlpdftextfromutf16he,<br />
dlpdftextfromutf16le,<br />
dlpdftextfromutf32be,<br />
dlpdftextfromutf32le,<br />
dlpdftextfromutf8<br />
All <strong>DLI</strong>-supported platforms.<br />
Technical Notes<br />
1 Text passed to this method requires a NULL terminator. Only the related method<br />
dlpdftext will accept unterminated text strings, since that method includes<br />
Length as an additional calling argument.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.175<br />
dlpdftextfromutf32le (void *Text)<br />
Return Value: DLPDFTEXT*<br />
Description<br />
Parameters<br />
Return Value<br />
Returns a DLPDFTEXT structure for the given<br />
UTF32 little-endian Unicode Text string.<br />
void *Text: the text to be passed to the DLP-<br />
DFTEXT structure<br />
DLPDFTEXT*<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdftext,<br />
dlpdftextfromutf16be,<br />
dlpdftextfromutf16he,<br />
dlpdftextfromutf16le,<br />
dlpdftextfromutf32be,<br />
dlpdftextfromutf32he,<br />
dlpdftextfromutf8<br />
All <strong>DLI</strong>-supported platforms.<br />
Technical Notes<br />
1 Text passed to this method requires a NULL terminator. Only the related method<br />
dlpdftext will accept unterminated text strings, since that method includes<br />
Length as an additional calling argument.
A.176 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdftextfromutf8 (void *Text)<br />
Return Value: DLPDFTEXT*<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Description<br />
Parameters<br />
Return Value<br />
Returns a DLPDFTEXT structure for the given<br />
UTF8 Unicode Text string.<br />
void *Text: the text to be passed to the DLP-<br />
DFTEXT structure<br />
DLPDFTEXT*<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdftext,<br />
dlpdftextfromutf16be,<br />
dlpdftextfromutf16he,<br />
dlpdftextfromutf16le,<br />
dlpdftextfromutf32be,<br />
dlpdftextfromutf32he,<br />
dlpdftextfromutf32le<br />
All <strong>DLI</strong>-supported platforms.<br />
Technical Notes<br />
1 Text passed to this method requires a NULL terminator. Only the related method<br />
dlpdftext will accept unterminated text strings, since that method includes<br />
Length as an additional calling argument.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.177<br />
dlpdftextlength (DLPDFTEXT *Text)<br />
Return Value: ASUns32<br />
Description<br />
Parameters<br />
Return Value<br />
This method returns the length, in bytes, of the<br />
buffer for the stored string. NULL string terminators<br />
are not stored, <strong>and</strong> thus are not counted<br />
as part of the length.<br />
DLPDFTEXT *Text: the text structure to be<br />
acted upon<br />
ASUns32<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdftext,<br />
dlpdftextstring<br />
All <strong>DLI</strong>-supported platforms.
A.178 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdftextshowencodingnames (char<br />
*FileName)<br />
Return Value: void<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Description<br />
Parameters<br />
Return Value<br />
Returns an output file of the given FileName,<br />
listing all valid Encoding names provided via<br />
the International Components for Unicode<br />
(ICU) module for use when calling dlpdftext<br />
to construct the DLPDFTEXT object.<br />
char *FileName: Name for the output file to<br />
be created<br />
void<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdftext<br />
All <strong>DLI</strong>-supported platforms.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.179<br />
dlpdftextstring (DLPDFTEXT *Text)<br />
Return Value: char *<br />
Description<br />
Parameters<br />
This method returns the byte buffer for the<br />
stored string.<br />
DLPDFTEXT *Text: the text structure to be<br />
acted upon<br />
Return Value char *<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
dlpdftext,<br />
dlpdftextlength<br />
All <strong>DLI</strong>-supported platforms.
A.180 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdftexttocontent (DLPDFTEXT *Text,<br />
DLPDFCONTENT *Content, DLPDFFONT *Font,<br />
PDEGraphicState *GState, PDETextState *TState,<br />
ASFixed PointSize, ASFixed SetWidth, ASFixed<br />
XPos, ASFixed YPos, dlpdftext_X XMeaning,<br />
ASFixed Angle)<br />
Return Value: void<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Description<br />
Parameters<br />
This method pastes the DLPDFTEXT string into<br />
a DLPDFCONTENT area.<br />
• DLPDFTEXT *Text: the text structure to be<br />
acted upon<br />
• DLPDFCONTENT *Content: the target<br />
structure in which the text will be pasted<br />
• DLPDFFONT *Font: The specified font<br />
• PDEGraphicState *GState: Contains<br />
definitions of colors to be applied, <strong>and</strong> line<br />
sizes <strong>and</strong> parameters to be used when<br />
drawing a path<br />
• PDETextState *TState: The current text<br />
state. This should not be NULL. A zero-filled<br />
PDETextState parameter is permitted.<br />
• ASFixed PointSize: Point size<br />
• ASFixed SetWidth: Set width<br />
• ASFixed Xpos: X position of starting point<br />
within DLPDFCONTENT<br />
• ASFixed Ypos: Y position of starting point<br />
within DLPDFCONTENT
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.181<br />
Parameters (continued)<br />
Return Value<br />
• dlpdftext_X XMeaning:<br />
DLPDFTEXT_X_LEFT or<br />
DLPDFTEXT_X_RIGHT, used to indicate<br />
whether the starting location is the left or<br />
right end (respectively) of the text,<br />
distinguishing a left-to-right line order (e.g.<br />
English) from a right-to-left line order (e.g.<br />
Arabic)<br />
• ASFixed Angle: Angle of flow, in degrees,<br />
as an ASFixed counterclockwise angle<br />
void<br />
Exceptions<br />
Header<br />
dli.h<br />
Related Methods<br />
Availability<br />
All <strong>DLI</strong>-supported platforms.
A.182 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfttload (DLPDFINSTANCE *Instance, ASFile<br />
TTFont, ASAtom *Names, int NameLen)<br />
Return Value: int<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Description<br />
Parameters<br />
Return Value<br />
This method loads the given font from an<br />
ASFile TrueType or OpenType font file, or the<br />
fonts from a TrueType/OpenType Collection<br />
font file. These fonts are loaded into the supplied<br />
DLPDFINSTANCE. Fonts loaded in this<br />
manner are used before searching the system<br />
directories for fonts.<br />
• DLPDFINSTANCE *Instance: the<br />
DLPDFINSTANCE for which the font(s) will<br />
be loaded<br />
• ASFile TTFont: fonts from file or<br />
collection to be loaded<br />
• ASAtom *Names: pointer to font<br />
ASAtom(s) to be loaded (one or more)<br />
• int NameLen: number of ASAtom *Names<br />
to be completed<br />
int: Number of fonts loaded<br />
Exceptions<br />
Header<br />
dli.h<br />
Related Methods<br />
Availability<br />
All <strong>DLI</strong>-supported platforms.
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.183<br />
Technical Notes<br />
1 This method does not fully support Adobe CFF-format OpenType font files.<br />
CMaps as defined in the PDF <strong>Reference</strong> Manual should be used for these fonts.<br />
<strong>Datalogics</strong> recommends creating them as CIDType0 fonts, using<br />
dlpdfcontentwidetext for setting text.<br />
2 <strong>DLI</strong> does not search directory paths or environmental variable entries for fonts<br />
loaded via dlpdfttload.<br />
3 If a given font file has already been loaded, dlpdfttload returns a -1, <strong>and</strong> does<br />
not re-parse the font file (for performance reasons).<br />
4 As of <strong>DLI</strong> v3.0.11, the dlpdfterm call now removes memory files used for the<br />
dlpdfttload call if the Files In Memory filesystem is used, <strong>and</strong> if these files are<br />
no longer in use.
A.184 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
GetGraphicFromList (DLPDFDOC *Doc, char<br />
*Name)<br />
Return Value: DLPDFIMAGE*<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Description<br />
Parameters<br />
Return Value<br />
Obtains a DLPDFIMAGE* by specifying the target<br />
document <strong>and</strong> the key for the graphic file.<br />
• DLPDFINSTANCE *Instance: Represents<br />
the document structure <strong>and</strong> the current status<br />
of the document at all times.<br />
• char *Name: Name string<br />
DLPDFIMAGE*: NULL is returned if the graphic<br />
is not found.<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
LoadGraphicList<br />
Available on OS/390 only
<strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong> A.185<br />
LoadGraphicList (char *ListFileName)<br />
Return Value: void<br />
Description<br />
Parameters<br />
Return Value<br />
Reads a cross-reference file which maps graphics<br />
keys to their physical location. The cross-reference<br />
table is accessed by the<br />
GetGraphicFromList method, <strong>and</strong>, once<br />
read, is stored in memory for the duration of<br />
the job.<br />
char *ListFileName: File name<br />
void<br />
Exceptions<br />
Header<br />
Related Methods<br />
Availability<br />
dli.h<br />
GetGraphicFromList<br />
Available on OS/390 only
A.186 <strong>DLI</strong> <strong>Reference</strong> <strong>Guide</strong><br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System
Index<br />
I.i<br />
Index<br />
A<br />
A key<br />
Use in Links 13.9<br />
AcroForm (Sample <strong>DLI</strong> Application) 17.18<br />
action (parameter)<br />
Use in Annotations <strong>and</strong> Links 13.2<br />
Action Dictionary<br />
Use in Links<br />
Creating Replacement 13.9<br />
Modifying 13.9<br />
Actions<br />
in Annotations <strong>and</strong> Links 13.3<br />
Adobe Acrobat 1.8<br />
Adobe Acrobat Distiller 1.12, 2.6<br />
Adobe Distiller 17.7<br />
Adobe Normalizer 11.2, 17.7<br />
Adobe Reader 1.7, 1.8, 1.12, 2.3, 2.6,<br />
4.10, 13.4, 14.1, 17.9, A.114<br />
Adobe Technical Notes<br />
#5189 (Adobe PDF Library Overview)<br />
1.10<br />
#5190 (Acrobat Core API Overview)<br />
1.10<br />
#5191 (Acrobat Core API <strong>Reference</strong>)<br />
1.10<br />
#5414 (PDF Library Supplement to the<br />
Acrobat Core API) 1.11<br />
#5425 (AcroColor API <strong>Reference</strong>) 1.10<br />
ADOBECMP<br />
OS/390 Location Search 4.15<br />
AdobeFnt.lst 2.3<br />
Efficient use of 2.3<br />
Naming variations 2.3<br />
Search path definition via PDFLDataRec<br />
2.3<br />
Use in Default Search Path Suppression<br />
1.20, 1.21<br />
ADOBERES<br />
OS/390 Location Search 4.15<br />
allocProc<br />
Use in Setting Memory Allocation<br />
Routines 2.5<br />
Annotation Dictionary<br />
Modifying 13.9<br />
Annotations<br />
action (parameter) 13.2<br />
Border Specification 13.4<br />
Color Specification 13.4<br />
Components 13.2<br />
Content 13.4<br />
hot spot (parameter) 13.2<br />
Introduction 13.1<br />
Link<br />
Overview 13.2<br />
Modifying for Other Actions 13.2<br />
Open/Close Flag 13.4<br />
Opening the Document with<br />
Annotations Showing 14.6<br />
Text<br />
Overview 13.2<br />
Title 13.4<br />
Annotations (Sample <strong>DLI</strong> Application) 17.15<br />
Annotations <strong>and</strong> Links<br />
Borders<br />
Color 13.3<br />
Definition 13.3<br />
Calls 13.4, 13.6, 13.7, 13.8<br />
Colors<br />
Links 13.3<br />
Text Annotations (when closed) 13.3<br />
ArcTo (PostScript operator) 8.8, A.4<br />
ASBool<br />
Use in Documents, Beginning <strong>and</strong><br />
Ending 3.2<br />
ASCII<br />
Use in Displaying Images 11.12<br />
ASCII85<br />
Use in Displaying Images 11.7<br />
ASFile 17.16<br />
ASFileSys<br />
Specifying an Alternate File System via<br />
dlpdfinit 2.9<br />
Use in Image Search using Files in
I.ii<br />
<strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
Memory 1.20, 2.11<br />
Use in Initializing <strong>and</strong> Terminating via<br />
<strong>DLI</strong> 2.9, 2.11<br />
Use in Specifying an Alternate File<br />
System 2.10<br />
ASFixed<br />
Use in Basic Color Spaces<br />
Device Gray 12.7<br />
Use in Color Channels<br />
Definitions 12.6<br />
Inversion Correction 12.6<br />
Precision Correction 12.6<br />
Use in Color Description 12.2<br />
ASFixedMatrix<br />
Use in Line Drawing 10.15<br />
ASFixedRect<br />
Use in Displaying Images 11.10<br />
ASFixedRectangle<br />
Use in Annotations <strong>and</strong> Links 13.4,<br />
13.5<br />
hot spot Definition 13.2<br />
ASGetErrorString<br />
Use in Error H<strong>and</strong>ling 16.3, 16.4, 16.5<br />
ASGetExceptionErrorCode<br />
Use in Error H<strong>and</strong>ling 16.3<br />
ASPathName<br />
Use in Writing PDF Output to Memory<br />
2.16<br />
ASSize_t<br />
Use in Writing PDF Output to Memory<br />
2.16<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
B<br />
Background patterns, creating 17.17<br />
Backwards Compatibility, Ensuring 1.12, 2.7<br />
BBox (parameter)<br />
Use in Content Interface Calls 8.19<br />
Use in Displaying Images 11.10<br />
Use in Forms 9.3<br />
Bezier Curve<br />
Use in Line Drawing<br />
Basic points 10.12, A.132<br />
Calls 10.12, 10.13<br />
Parameters 10.12, A.132<br />
Bézier curve 8.15, 8.16, 8.17<br />
Bitmaps<br />
Image Conversion from 11.2<br />
Use in Image Color Spaces 12.3<br />
blobs (Binary Large OBjects) 17.16<br />
Bookmarks<br />
Accessing DLPDFOUTLINE fields 14.5<br />
Building Multiple Trees 14.2<br />
Calls 14.3, 14.4, 14.5<br />
DLPDFOUTLINE 14.2, 14.4<br />
DLPDFOUTLINE->Count 14.5<br />
DLPDFOUTLINE->Obj 14.5<br />
DLPDFOUTLINE->Open 14.5<br />
Introduction 14.1<br />
Opening Document with Annotations<br />
Showing 14.6<br />
Outline Tree 14.2<br />
Overview 14.2<br />
PageMode 14.6<br />
PDViewDestNull 14.3<br />
Border<br />
Use in Annotations <strong>and</strong> Links 13.4<br />
Border (parameter)<br />
Use in Annotation Dictionary 13.9<br />
BoundingBox (PostScript statement) A.87<br />
Browser<br />
Specifying via Acrobat 13.7<br />
C<br />
CalGray<br />
Use in Color Spaces<br />
Basic 12.9<br />
Calibrated Gray Scale 12.5<br />
calloc<br />
Alternate Routines for 2.5<br />
PDFInit.h Interface to 2.5<br />
CalRGB<br />
Use in Color Spaces<br />
Basic 12.9<br />
Cautions<br />
Color Models must be Freed before<br />
Closing 12.3<br />
Do not Exit from within Error H<strong>and</strong>ler<br />
16.2<br />
Initialize pre-v6.1 Library <strong>and</strong> <strong>DLI</strong> only<br />
once 2.9<br />
Invalid Font Creation 4.9<br />
Scale Before Rotating Image 10.16<br />
Transformation, Undesirable Side-<br />
Effects via dlpdfcontentrotate 7.3<br />
CGM (Computer Graphics Metafile)<br />
Use in Graphical Language Forms 11.5<br />
CIDToGID Conversion Map 4.3<br />
CIDType2 font
Index<br />
I.iii<br />
Terminology usage 4.4<br />
Clipping Path A.7<br />
Use in Line Drawing 8.6<br />
CMYK Color<br />
Collapsing to Gray 12.16<br />
Converting to RGB 12.18<br />
Use in Color Description 12.2<br />
Use in ICC Based Color Profile 12.10<br />
Color<br />
Color Description Components 12.2<br />
Converting Values to Binary 12.6<br />
of Annotations <strong>and</strong> Links 13.3<br />
Use in Annotations <strong>and</strong> Links 13.4<br />
Use in Images 12.3<br />
Use with PDFGraphicState 12.2<br />
Color (parameter)<br />
Use in Annotation Dictionary 13.9<br />
Color Channels<br />
Inversion Correction 12.6<br />
Precision Correction 12.6<br />
Value Conversion <strong>and</strong> Inversion 12.6<br />
Values for 12.6<br />
Color Models<br />
/DeviceCMYK<br />
Order of Values Assumed 11.6<br />
Use in Displaying Images 11.6<br />
/DeviceGray<br />
Use in Displaying Images 11.6<br />
/DeviceRGB<br />
Order of Values Assumed 11.6<br />
Use in Displaying Images 11.6<br />
/Indexed<br />
Use in Displaying Images 11.6<br />
Order of Values 11.6<br />
Color Profile<br />
Use in Color Spaces<br />
Basic 12.10<br />
Color Spaces<br />
Advanced<br />
DeviceN 12.11<br />
Indexed 12.12<br />
Overview 12.11<br />
Patterned 12.12<br />
Separation 12.11<br />
Basic<br />
Calibrated Gray 12.8<br />
Calibrated RGB 12.9<br />
CIE Calibrated Color 12.7<br />
CIE Lab 12.9<br />
Device CMYK 12.8<br />
Device Gray 12.7<br />
Device RGB 12.8<br />
ICC Based 12.10<br />
Conversion of Values between Models<br />
CMYK To Gray 12.16<br />
CMYK to RGB 12.18<br />
Overview 12.16<br />
RGB to CMYK 12.17<br />
RGB to Gray 12.16<br />
Creating <strong>and</strong> Destroying 12.3<br />
Patterned<br />
Building 12.13<br />
Repeating <strong>Reference</strong>s 12.14<br />
ColorSpace<br />
Use in Displaying Images 11.12<br />
Comments<br />
Use in Adding to Content Elements 8.22<br />
Compression<br />
Activating 3.3, A.41<br />
Calls 3.3<br />
Flate<br />
Use in Displaying Images 11.7<br />
Use in Documents, Beginning <strong>and</strong><br />
Ending 3.3, A.41<br />
Containers within Pages 7.1<br />
Inversion 7.4<br />
Overview 7.2<br />
Scaling 7.3<br />
Content Elements<br />
representation by DLPDFCONTENT 8.2<br />
Content Interface Calls 8.3<br />
Adding Comments to Content Elements<br />
8.22<br />
Calls 8.22<br />
Associating Content to Page 8.21<br />
Calls 8.21<br />
Control Structures 8.2<br />
Creation <strong>and</strong> Positioning 8.3<br />
Calls 8.3, 8.4<br />
Line Drawing 8.5<br />
Calls 8.6, 8.7, 8.8<br />
Fill Color 8.6<br />
kPDEEoFill 8.6<br />
kPDEFill 8.6<br />
kPDEStroke 8.6<br />
Paint Operator 8.5<br />
PDEGraphicState 8.5<br />
Overview 8.2<br />
Paths 8.9<br />
Appending Line Segments 8.10
I.iv<br />
<strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
Calls 8.10, 8.11, 8.12, 8.13,<br />
8.14, 8.15, 8.16,<br />
8.17, 8.18<br />
Calls 8.9, 8.10<br />
Patterns 8.18<br />
Calls 8.19<br />
Referencing Predefined Structures 8.20<br />
Calls 8.20, 8.21<br />
Text Placement 8.4<br />
Calls 8.4<br />
Text Width Evaluation 8.4<br />
Calls 8.5<br />
Conventions, Document 1.7<br />
CosDictRemove<br />
Use in Links<br />
Replacing 13.9<br />
CosDoc<br />
Use in Document Creation 3.2<br />
cosImage<br />
Use in Displaying Images 11.13<br />
CosNull<br />
Use in Links 13.8<br />
CosObj<br />
Use in Annotations <strong>and</strong> Links 13.2,<br />
13.9<br />
Use in Image Color Spaces 12.3<br />
CosStructure<br />
Use in Image Color Spaces 12.3<br />
Cross-<strong>Reference</strong> File, OS/390<br />
Use in Displaying Images 11.11<br />
CTM Matrix<br />
Use in Line Drawing 10.7<br />
Current Point<br />
Use in Line Drawing 10.7<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
D<br />
dash<br />
Use in Line Drawing 10.18<br />
Dashed <strong>and</strong> Dotted Lines 10.18<br />
Data Structure, Library 2.2<br />
DDName<br />
Use in Displaying Images 11.12<br />
Dest (parameter)<br />
Use in Annotation Dictionary 13.9<br />
Use in Bookmarks 14.5<br />
Use in Links<br />
Replacing 13.9<br />
Destination<br />
Adding to Name Tree 13.8<br />
Obtaining Name 13.8<br />
Use in Links 13.7, 13.8<br />
Use of, vs. Name 13.6<br />
Destination Dictionary<br />
Use in Bookmarks 14.4<br />
DeviceCMYK<br />
Creating Color Space for 12.4<br />
Use in Color Spaces<br />
Advanced 12.12<br />
Basic 12.8<br />
DeviceGray<br />
Creating Color Space for 12.4<br />
Use in Color Spaces<br />
Advanced 12.12<br />
Basic 12.7<br />
DeviceN<br />
Use in Color Spaces<br />
Advanced 12.11, 12.12<br />
DeviceRGB<br />
Creating Color Space for 12.4<br />
Use in Color Spaces<br />
Advanced 12.12<br />
Basic 12.8<br />
Digital Signatures<br />
Appearance layers 15.3, 15.4<br />
Calls<br />
dlpdfdoccreatesignature 15.4<br />
dlpdfdocsetsignatureappearance<br />
15.4<br />
dlpdfpageplacesignature 15.6<br />
dlpdfsignaturesetdatacallback 15.6<br />
dlpdfsignaturesetpkcs7cert 15.5<br />
dlpdfsignaturesetx509cert 15.5<br />
Components of 15.3<br />
imageBBox (signature bounding box)<br />
15.6<br />
Introduction 15.1<br />
Overview 15.2<br />
Public <strong>and</strong> Private Keys 15.2<br />
sigType (plug-in compatibility) 15.4<br />
dirList<br />
Use in Setting Resource Directories 2.3<br />
DLExceptionCode<br />
Use in Error H<strong>and</strong>ling 16.4, 16.5<br />
DLExceptionFlag<br />
Use in Error H<strong>and</strong>ling 16.4, 16.5<br />
DLExceptionMessage<br />
Use in Error H<strong>and</strong>ling 16.5<br />
<strong>DLI</strong><br />
<strong>DLI</strong>-selected PDF Level Declarations 2.7
Index<br />
I.v<br />
How to Create a PDF Document 1.2<br />
Initialization in <strong>DLI</strong> v3.0 1.14<br />
Introduction 1.2<br />
Overriding <strong>DLI</strong>-selected PDF Level<br />
Declarations 2.7<br />
Required Initialization 1.3<br />
DLPDFCONTENT 8.2<br />
Use by dlpdftexttocontent 1.17<br />
Use in Displaying Images 11.13<br />
Use in Line Drawing 10.14<br />
Use in Patterned Colors 12.2<br />
Use with CIDType2 fonts 4.4<br />
dlpdfcontent objects 1.2<br />
dlpdfcontentarc A.2<br />
Use in Content Interface Calls 8.7<br />
Use in Line Drawing 10.4<br />
dlpdfcontentarcn A.3<br />
Use in Content Interface Calls 8.8<br />
Use in Line Drawing 10.4<br />
dlpdfcontentarcto A.4<br />
Use in Content Interface Calls 8.8<br />
Use in Line Drawing 10.5<br />
dlpdfcontentcircle A.6<br />
Use in Content Interface Calls 8.8<br />
Use in Line Drawing 10.6<br />
dlpdfcontentclip A.7<br />
Use in Content Interface Calls 8.6<br />
dlpdfcontentclipend A.8, A.9<br />
Use in Content Interface Calls 8.6, 8.7<br />
Use in Line Drawing 8.6<br />
dlpdfcontentcomment A.10<br />
Use in Content Interface Calls 8.22<br />
dlpdfcontentcreate A.11<br />
Use in Content Interface Calls 8.3<br />
dlpdfcontentdrawpath<br />
Use in Line Drawing 10.7, 10.14<br />
dlpdfcontentellipse A.12<br />
Use in Content Interface Calls 8.8<br />
Use in Line Drawing 10.6<br />
dlpdfcontentfontskew A.13<br />
dlpdfcontentgstate A.14<br />
Use in Displaying Images 11.13<br />
dlpdfcontentline A.15<br />
Use in Content Interface Calls 8.7<br />
Use in Line Drawing 10.4<br />
dlpdfcontentpath A.16<br />
Use in Content Interface Calls 8.6, 8.7<br />
Use in Line Drawing 8.6, 10.2, 10.6<br />
dlpdfcontentpieslice A.12, A.18<br />
Use in Content Interface Calls 8.8<br />
Use in Line Drawing 10.5<br />
dlpdfcontentpieslicen A.19<br />
Use in Content Interface Calls 8.8<br />
Use in Line Drawing 10.5<br />
dlpdfcontentrect A.21<br />
Use in Content Interface Calls 8.7<br />
Use in Line Drawing 10.4<br />
dlpdfcontentreferenceform A.23<br />
Use in Content Interface Calls 8.20<br />
Use in Forms 9.3<br />
dlpdfcontentreferenceimage A.24<br />
Usage example 8.21<br />
Use in Content Interface Calls 8.20<br />
Use in Displaying Images 11.2<br />
dlpdfcontentrotate A.26<br />
Use in Content Interface Calls 8.3<br />
dlpdfcontentscale A.27<br />
Use in Content Interface Calls 8.3<br />
dlpdfcontenttext A.28, A.35<br />
Use in Content Interface Calls 8.4<br />
dlpdfcontenttextwidth A.30, A.38<br />
Use in Content Interface Calls 8.5<br />
dlpdfcontenttopage A.31<br />
Use in Content Interface Calls 8.21<br />
dlpdfcontenttranslate A.32<br />
Use in Content Interface Calls 8.4<br />
dlpdfcontentusefillpattern A.33, A.34,<br />
A.155<br />
Use in Color Spaces<br />
Advanced 12.12<br />
Patterned 12.13<br />
Use in Content Interface Calls 8.19<br />
dlpdfcontentusestrokepattern A.34, A.155<br />
Use in Color Spaces<br />
Advanced 12.12<br />
Use in Content Interface Calls 8.19<br />
dlpdfcontentwidetext A.35<br />
Updates in <strong>DLI</strong> v3.0 1.17<br />
Use in Content Interface Calls 8.4<br />
dlpdfcontentwidetextwidth A.38<br />
Use in Content Interface Calls 8.5<br />
DLPDFDOC 2.7, A.46<br />
EmbedFonts<br />
Use in Documents, Beginning <strong>and</strong><br />
Ending 3.3<br />
Use in Creation Calls in <strong>DLI</strong><br />
Font Searching Sequence 4.7<br />
Repetitive Calling 4.6<br />
Use in Displaying Images 11.12<br />
Use in Document Status 3.2
I.vi<br />
<strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
Use in Documents, Beginning <strong>and</strong><br />
Ending 3.2<br />
Encryption 3.4, 3.5<br />
Use in Initializing <strong>and</strong> Terminating via<br />
<strong>DLI</strong> 2.9, 2.12<br />
Use in Multiple Document Creation 3.2<br />
dlpdfdocasciips A.39<br />
What’s New in <strong>DLI</strong> v3.0 1.16<br />
dlpdfdoccomplete A.40<br />
dlpdfdoccompress A.41<br />
Use in Documents, Beginning <strong>and</strong><br />
Ending 3.3<br />
dlpdfdoccosdoc A.42<br />
dlpdfdoccreate A.43<br />
Modifications in <strong>DLI</strong> v3.0 1.19<br />
Updates in <strong>DLI</strong> v3.0 1.14, 1.18<br />
Use in Documents, Beginning <strong>and</strong><br />
Ending 3.2<br />
dlpdfdoccreatesignature A.44<br />
Use in digital signatures 15.4<br />
What’s New in <strong>DLI</strong> v3.0 1.15<br />
dlpdfdoccreatewithinstance<br />
Removal from <strong>DLI</strong> v3.0 1.14, 1.19<br />
dlpdfdocdestroy A.46<br />
dlpdfdocembedfonts A.47, A.73, A.75,<br />
A.77, A.79<br />
Use in Documents, Beginning <strong>and</strong><br />
Ending 3.3<br />
Use of Document EmbedFonts Flag 4.5<br />
dlpdfdocencrypt A.48<br />
Use in Documents, Beginning <strong>and</strong><br />
Ending 3.4, 3.5<br />
dlpdfdocHexGraphics A.50<br />
Removal from <strong>DLI</strong> v3.0 1.19<br />
dlpdfdoclinearize A.49<br />
Use in Documents, Beginning <strong>and</strong><br />
Ending 3.4<br />
dlpdfdocmakethumbnails A.50<br />
Use in Documents, Beginning <strong>and</strong><br />
Ending 3.4<br />
dlpdfdocnameadd A.51<br />
Use in Annotations <strong>and</strong> Links 13.6<br />
Use in Links 13.8<br />
dlpdfdocnamefind A.52<br />
Use in Links 13.8<br />
dlpdfdocoutline A.53<br />
Use in Bookmarks 14.4<br />
dlpdfdocoutlineadd A.54<br />
Use in Bookmarks 14.3<br />
dlpdfdocoutlineaddfromname A.56<br />
Use in Bookmarks 14.4<br />
dlpdfdocoutlinecosobj A.57<br />
dlpdfdocoutlinefirst A.58<br />
Use in Bookmarks 14.5<br />
dlpdfdocoutlinelast A.59<br />
Use in Bookmarks 14.5<br />
dlpdfdocoutlinenext A.60<br />
Use in Bookmarks 14.5<br />
dlpdfdocoutlineparent A.61<br />
Use in Bookmarks 14.5<br />
dlpdfdocoutlineprev A.62<br />
Use in Bookmarks 14.5<br />
dlpdfdocpddoc A.63, A.118<br />
Use in Page Interface 6.3<br />
dlpdfdocsetdocinfo A.64<br />
Use in Documents, Beginning <strong>and</strong><br />
Ending 3.4<br />
dlpdfdocsetencoding A.65<br />
Use in Documents, Beginning <strong>and</strong><br />
Ending 3.3<br />
dlpdfdocsetencryptkeylen A.66<br />
Use in Documents, Beginning <strong>and</strong><br />
Ending 3.5<br />
dlpdfdocseterrorfile<br />
Removal from <strong>DLI</strong> v3.0 1.19<br />
dlpdfdocsetformsascontent<br />
Removal from <strong>DLI</strong> v3.0 1.19<br />
dlpdfdocsetpdfname A.68<br />
Use in Documents, Beginning <strong>and</strong><br />
Ending 3.3<br />
Use in Writing PDF Output to Memory<br />
2.15<br />
dlpdfdocsetpsname A.69<br />
Use required for dlpdfdoccreate 1.18,<br />
A.43<br />
dlpdfdocsetsignatureappearance A.70<br />
Use in digital signatures 15.4<br />
What’s New in <strong>DLI</strong> v3.0 1.15<br />
dlpdfdocsetwarningfile<br />
Removal from <strong>DLI</strong> v3.0 1.19<br />
dlpdfdocsevenbitsafe<br />
Removal from <strong>DLI</strong> v3.0 1.18<br />
dlpdfdocwritepdf A.68, A.71<br />
Use in digital signatures 15.5, 15.6<br />
Use in Documents, Beginning <strong>and</strong><br />
Ending 3.4<br />
with dlpdfdocencrypt 3.5<br />
Use in Writing PDF Output to Memory<br />
2.15, 2.16<br />
dlpdfdocwritePS A.69, A.72<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System
Index<br />
I.vii<br />
Use in Documents, Beginning <strong>and</strong><br />
Ending 3.3<br />
Use required for dlpdfdoccreate 1.18,<br />
A.43<br />
DLPDFFONT 3.3, 4.4, 4.5, A.47<br />
Font Attributes 4.5<br />
Font Embedding Status 4.4<br />
Font Subsetting Status 4.4<br />
Use in Creation Calls in <strong>DLI</strong> 4.6<br />
Repetitive Calling 4.6<br />
WidthTable 4.7<br />
dlpdffontcreate A.73, A.75, A.77, A.79<br />
Use in Font Creation 4.6, 4.7<br />
Use in Font Searching Sequence 4.7<br />
Use in Loading <strong>and</strong> Creating Fonts 5.3,<br />
5.4<br />
Use in Multibyte Text Work 5.3<br />
dlpdffontcreateembedded 4.6, A.73, A.75,<br />
A.77, A.79<br />
Use in Font Creation 4.6, 4.8<br />
Use in Loading <strong>and</strong> Creating Fonts 5.4<br />
dlpdffontcreatewithmetrics A.73, A.75,<br />
A.76, A.79<br />
Use in Font Creation 4.6, 4.8<br />
Use in Loading <strong>and</strong> Creating Fonts 5.4<br />
Use in Matching System Fonts 4.9<br />
dlpdffontcreatewithmetricsembedded A.73,<br />
A.75, A.77, A.78<br />
Use in Font Creation 4.6, 4.11<br />
dlpdffontverifytext<br />
Removal from <strong>DLI</strong> v3.0 1.20<br />
DLPDFFORM 9.2<br />
Use in Digital Signatures 15.3, 15.4<br />
dlpdfformcreate A.80<br />
Use in Forms 9.3<br />
dlpdfformdestroy A.81<br />
Use in Forms 9.3<br />
DLPDFIMAGE<br />
Use in Displaying Images 11.2, 11.6,<br />
11.10, 11.12, 11.13<br />
dlpdfimagecreatefrombmp A.82<br />
Use in Displaying Images 11.12<br />
Use in Image Color Spaces 12.3<br />
dlpdfimagecreatefromfile A.84<br />
Use in Displaying Images 11.10<br />
Use in Image Search using Files in<br />
Memory 1.21, 2.11<br />
dlpdfimagecreatefrompdf A.85<br />
What’s New in <strong>DLI</strong> v3.0 1.14<br />
dlpdfimagecreatefromps A.87<br />
dlpdfimagegetsize A.88<br />
Use in Content Interface Calls 8.21<br />
dlpdfimageplaceascontent<br />
Removal from <strong>DLI</strong> v3.0 1.19<br />
dlpdfinit A.90<br />
Use in Multi-Thread Initializations<br />
2.13<br />
Caution on Multiple Initializations of<br />
Library 2.9<br />
Error H<strong>and</strong>ler not required 3.2, A.91,<br />
A.165<br />
Invoking Files in Memory 17.2<br />
Note on Writing PDF Output to Memory<br />
2.10<br />
Specifying an Alternate File System 2.10<br />
Updates in <strong>DLI</strong> v3.0 1.14, 1.18<br />
Use in Default Search Path Suppression<br />
1.21<br />
Use in Files in Memory 2.8<br />
Use in Initializing <strong>and</strong> Terminating the<br />
Library 2.12<br />
Failure to Initialize 2.9<br />
Use in Initializing <strong>and</strong> Terminating via<br />
<strong>DLI</strong> 2.9, 2.11, 2.12<br />
Use in Specifying an Alternate File<br />
System 2.10<br />
Use in Terminating Library 2.11<br />
Using a Graphics Cache 2.10<br />
DLPDFINSTANCE<br />
Addition in <strong>DLI</strong> v3.0 1.13<br />
Unicode font translation via ICU 4.3<br />
Use by dlpdfttload 1.17<br />
Use in Creation Calls in <strong>DLI</strong><br />
Font Searching Sequence 4.7<br />
Use in dlpdfdoccreate 1.18, 1.19<br />
Use in Initializing <strong>and</strong> Terminating the<br />
Library 2.12<br />
Use in Initializing <strong>and</strong> Terminating via<br />
<strong>DLI</strong> 2.9, 2.12<br />
Use in Terminating Library 2.11, 2.12<br />
dlpdfinstancesetcancelproc A.92<br />
dlpdfinstancesetgrcachelimits A.93<br />
What’s New in <strong>DLI</strong> v3.0 1.16<br />
dlpdfinstancesetprogressmonitor A.95<br />
dlpdfmatrixrotate A.96<br />
Use in Line Drawing 10.16<br />
dlpdfmemfileacquire A.96, A.97<br />
Use in Writing PDF Output to Memory<br />
2.16
I.viii<br />
<strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
dlpdfmemfiledata A.98, A.99<br />
Use in Writing PDF Output to Memory<br />
2.16<br />
dlpdfmemfiledeleteonclose A.99<br />
Note on usage for file deletion 1.15<br />
What’s New in <strong>DLI</strong> v3.0 1.15<br />
dlpdfmemfilerelease A.100<br />
Use in Writing PDF Output to Memory<br />
2.16, 2.17<br />
dlpdfmemfilesetbuffer A.101<br />
What’s New in <strong>DLI</strong> v3.0 1.15<br />
dlpdfmemfilesetdata A.102<br />
Differences from dlpdfmemfilesetbuffer<br />
A.101<br />
Use in Image Search using Files in<br />
Memory 1.20, 2.11<br />
Use in Writing PDF Output to Memory<br />
2.17<br />
dlpdfmemfilesize 2.16, A.103<br />
Use in Writing PDF Output to Memory<br />
2.16<br />
dlpdfmemfilesys A.104<br />
Use in Files in Memory 2.8<br />
Use in Image Search using Files in<br />
Memory 1.20, 2.11<br />
Use in Initializing <strong>and</strong> Terminating the<br />
Library 2.9<br />
Use in Initializing <strong>and</strong> Terminating via<br />
<strong>DLI</strong> 2.11<br />
Use in Specifying an Alternate File<br />
System 2.10<br />
dlpdfmemfilesysgetmemusage A.105<br />
What’s New in <strong>DLI</strong> v3.0 1.15<br />
dlpdfmemfilesyssetmemlimit A.106<br />
What’s New in <strong>DLI</strong> v3.0 1.15<br />
dlpdfmemfiletransientprefix A.107<br />
Use in Writing PDF Output to Memory<br />
2.16, 2.17<br />
DLPDFOUTLINE<br />
Use in Bookmarks 14.2, 14.4, 14.5<br />
DLPDFPAGE 6.2<br />
dlpdfpage objects 1.2<br />
dlpdfpageaddlinkannotation A.108<br />
Use in Annotations <strong>and</strong> Links 13.4<br />
dlpdfpageaddlinkannotationfromname<br />
A.111<br />
Use in Annotations <strong>and</strong> Links 13.6<br />
dlpdfpageaddtextannotation A.112<br />
Use in Annotations <strong>and</strong> Links 13.4<br />
dlpdfpageaddwebannotation A.114<br />
Use in Links 13.7<br />
dlpdfpagecosobj A.115<br />
Use in Page Interface 6.3<br />
dlpdfpagecreate A.116<br />
Use in Page Interface 6.2<br />
dlpdfpagefindfromnumber A.117<br />
Use in Page Interface 6.2<br />
dlpdfpagenumber A.118<br />
Use in Page Interface 6.3<br />
dlpdfpageplacesignature A.157<br />
Use in digital signatures 15.6<br />
What’s New in <strong>DLI</strong> v3.0 1.15<br />
dlpdfpagerotate A.119<br />
Use in Page Interface 6.3<br />
dlpdfpagesetart A.120<br />
dlpdfpagesetbleed A.121<br />
dlpdfpagesetcrop A.122<br />
dlpdfpagesetid A.123<br />
Use in Page Interface 6.3<br />
dlpdfpagesetmediabox A.124<br />
dlpdfpagesettrim A.125<br />
DLPDFPATH<br />
Effect of DLPDFPath.scaling on<br />
PDEGraphicState.lineWidth 10.17<br />
Use in Line Drawing 10.7, 10.8, 10.14,<br />
10.17<br />
Use in Paths 8.9<br />
dlpdfpathaddarc A.126<br />
Use in Content Interface Calls 8.12<br />
Use in Line Drawing 10.9<br />
dlpdfpathaddarcn A.127<br />
Use in Content Interface Calls 8.12<br />
Use in Line Drawing 10.9<br />
dlpdfpathaddarcto A.128<br />
Use in Content Interface Calls 8.13<br />
dlpdfpathaddclose<br />
Use in Content Interface Calls 8.18<br />
Use in Line Drawing 10.7, 10.14<br />
dlpdfpathaddcurve A.131<br />
Use in Content Interface Calls 8.15<br />
Use in Line Drawing 10.12<br />
dlpdfpathaddcurver A.133<br />
Use in Content Interface Calls 8.16<br />
Use in Line Drawing 10.12<br />
dlpdfpathaddcurvev A.134<br />
Use in Content Interface Calls 8.16<br />
Use in Line Drawing 10.13<br />
dlpdfpathaddcurvey A.136<br />
Use in Content Interface Calls 8.17<br />
Use in Line Drawing 10.13<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System
Index<br />
I.ix<br />
dlpdfpathaddelliparc<br />
Use in Content Interface Calls 8.13<br />
dlpdfpathaddelliparcn A.140<br />
Use in Content Interface Calls 8.14<br />
dlpdfpathaddelliparcto A.141<br />
Use in Content Interface Calls 8.15<br />
dlpdfpathaddline A.142<br />
Use in Content Interface Calls 8.10<br />
Use in Line Drawing 10.8<br />
dlpdfpathaddliner A.143<br />
Use in Content Interface Calls 8.10<br />
Use in Line Drawing 10.9<br />
dlpdfpathaddmove A.144<br />
Use in Content Interface Calls 8.11<br />
Use in Line Drawing 10.8<br />
dlpdfpathaddmover A.145<br />
Use in Content Interface Calls 8.11<br />
Use in Line Drawing 10.8<br />
dlpdfpathaddrect A.146<br />
Use in Content Interface Calls 8.17<br />
Use in Line Drawing 10.14<br />
dlpdfpathadelliparc A.138<br />
dlpdfpatharray A.147<br />
Use in Content Interface Calls 8.10<br />
dlpdfpathclear A.148<br />
Use in Content Interface Calls 8.9<br />
Use in Line Drawing 10.8<br />
dlpdfpathclosepath A.130<br />
dlpdfpathcreate A.149<br />
Use in Content Interface Calls 8.9<br />
Use in Line Drawing 10.7<br />
dlpdfpathcurrentx A.150<br />
Use in Content Interface Calls 8.9<br />
dlpdfpathcurrenty A.151<br />
Use in Content Interface Calls 8.9<br />
dlpdfpathdestroy A.152<br />
Use in Content Interface Calls 8.9<br />
Use in Line Drawing 10.7, 10.8<br />
dlpdfpathsetmatrix A.153<br />
Use in Content Interface Calls 8.18<br />
Use in Line Drawing 10.15<br />
dlpdfpathsize A.154<br />
Use in Content Interface Calls 8.9<br />
DLPDFPATTERN 8.18<br />
Parameters<br />
BBox 8.19<br />
Colored 8.19<br />
TileType 8.19<br />
Xstep 8.19<br />
Ystep 8.19<br />
dlpdfpatterncreate A.33, A.155<br />
Use in Color Spaces<br />
Advanced 12.12<br />
Patterned 12.13<br />
Use in Content Interface Calls 8.19<br />
dlpdfpatternrotate A.156<br />
dlpdfseterrorfile A.158<br />
dlpdfsetlevel<br />
Removal from <strong>DLI</strong> v3.0 1.20<br />
dlpdfsetwarningfile A.159<br />
DLPDFSIGNATURE<br />
Use in Digital Signatures 15.5<br />
dlpdfsignaturesetdatacallback A.160<br />
Use in digital signatures 15.6<br />
What’s New in <strong>DLI</strong> v3.0 1.15<br />
dlpdfsignaturesetpkcs7cert A.161<br />
Use in digital signatures 15.5<br />
What’s New in <strong>DLI</strong> v3.0 1.15<br />
dlpdfsignaturesetx509cert A.163<br />
Use in digital signatures 15.5<br />
What’s New in <strong>DLI</strong> v3.0 1.15<br />
dlpdfterm A.165<br />
Use in Multi-Thread Initializations<br />
2.13<br />
Error H<strong>and</strong>ler not required 3.2, A.91,<br />
A.165<br />
Updates in <strong>DLI</strong> v3.0 1.18<br />
Use in Initializing <strong>and</strong> Terminating the<br />
Library 2.12<br />
Use in Initializing <strong>and</strong> Terminating via<br />
<strong>DLI</strong> 2.12<br />
Use in Terminating Library 2.11, 2.12<br />
DLPDFTEXT 17.21<br />
Use in Multibyte Text Work 5.7<br />
dlpdftext A.166<br />
Obtaining Encoding names via<br />
dlpdftextshowencodingnames<br />
1.16, A.178<br />
Use in Multibyte Text Work 5.5<br />
Associated shortcut functions 5.6<br />
What’s New in <strong>DLI</strong> v3.0 1.16<br />
DLPDFTEXT (structure) 1.20, 5.2<br />
Addition in <strong>DLI</strong> v3.0 1.13<br />
Creating 5.5<br />
Performance Considerations 5.10<br />
Shortcut Functions 5.6<br />
Unicode font translation via ICU 4.3<br />
Use by dlpdftextdestroy 1.17<br />
Use by dlpdftexttocontent 1.17
I.x<br />
<strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
Use in dlpdftext (method) A.166<br />
Use in dlpdftextadvance A.167<br />
Use in dlpdftextdestroy A.169<br />
Use in dlpdftextlength A.177<br />
Use in dlpdftextstring A.179<br />
Use in dlpdftexttocontent A.180<br />
What’s New in <strong>DLI</strong> v3.0 1.16, 1.17<br />
Working with 5.7, 5.8, 5.9, 5.10<br />
dlpdftextadvance A.167<br />
Use in Multibyte Text Work 5.8<br />
What’s New in <strong>DLI</strong> v3.0 1.17<br />
dlpdftextdestroy A.169<br />
Use in Multibyte Text Work 5.10<br />
What’s New in <strong>DLI</strong> v3.0 1.17<br />
dlpdftextfromutf16be A.170<br />
Use in Multibyte Text Work 5.6<br />
What’s New in <strong>DLI</strong> v3.0 1.16<br />
dlpdftextfromutf16he A.171<br />
Use in Multibyte Text Work 5.6<br />
What’s New in <strong>DLI</strong> v3.0 1.16<br />
dlpdftextfromutf16le A.172<br />
Use in Multibyte Text Work 5.6<br />
What’s New in <strong>DLI</strong> v3.0 1.16<br />
dlpdftextfromutf32be A.173<br />
Use in Multibyte Text Work 5.6<br />
What’s New in <strong>DLI</strong> v3.0 1.16<br />
dlpdftextfromutf32he A.174<br />
Use in Multibyte Text Work 5.6<br />
What’s New in <strong>DLI</strong> v3.0 1.16<br />
dlpdftextfromutf32le A.175<br />
Use in Multibyte Text Work 5.6<br />
What’s New in <strong>DLI</strong> v3.0 1.16<br />
dlpdftextfromutf8 A.176<br />
Use in Multibyte Text Work 5.6<br />
What’s New in <strong>DLI</strong> v3.0 1.16<br />
dlpdftextlength A.177<br />
Use in Multibyte Text Work 5.7<br />
What’s New in <strong>DLI</strong> v3.0 1.17<br />
dlpdftextshowencodingnames A.178<br />
Use in Multibyte Text Work 5.5<br />
What’s New in <strong>DLI</strong> v3.0 1.16<br />
dlpdftextstring A.179<br />
Use in Multibyte Text Work 5.7<br />
What’s New in <strong>DLI</strong> v3.0 1.17<br />
dlpdftexttocontent A.180<br />
Use in Multibyte Text Work 5.9<br />
What’s New in <strong>DLI</strong> v3.0 1.17<br />
dlpdfttload A.182<br />
Clearance of memory files by dlpdfterm<br />
1.18<br />
Note on no default font searching 2.3<br />
Use in Font Searching Sequence 4.7<br />
Use in Multibyte Text Work 5.3<br />
What’s New in <strong>DLI</strong> v3.0 1.17<br />
Document Conventions 1.7<br />
Document H<strong>and</strong>le<br />
Use in Links 13.8<br />
Document Information<br />
Calls 3.4<br />
Document Interface<br />
Use with Error H<strong>and</strong>ler 3.2<br />
Document Opening<br />
with Annotations Showing 14.6<br />
Documents, Beginning <strong>and</strong> Ending<br />
Calls 3.2, 3.3, 3.4, 3.5<br />
Overview 3.2<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
E<br />
E_RETURN(X)<br />
Use in Error H<strong>and</strong>ling 16.3<br />
E_RTRN_VOID<br />
Use in Error H<strong>and</strong>ling 16.4<br />
eMemFileSys<br />
Use in Files in Memory in <strong>DLI</strong> Samples<br />
17.3<br />
Encoding<br />
Generation of Grid via FontVerification<br />
(Sample <strong>DLI</strong> Application) 17.13<br />
Encoding Vector 4.10<br />
Encrypt (Sample <strong>DLI</strong> Application) 17.9<br />
Changing Security Settings 17.10<br />
DocOwner Password 17.10<br />
ValidUser Password 17.9<br />
Encryption<br />
Calls 3.5<br />
Setting Encryption Key Length 3.5<br />
Use in Documents, Beginning <strong>and</strong><br />
Ending 3.4<br />
EPS<br />
Image Conversion from 11.2<br />
EPS (Encapsulated PostScript)<br />
Image Conversion from 11.2<br />
Use in Graphics (Sample <strong>DLI</strong> Application)<br />
17.6<br />
Error H<strong>and</strong>ling<br />
ASGetErrorString 16.3<br />
ASGetExceptionErrorCode 16.3<br />
DURING 16.2, 16.3<br />
E_RETURN(X) 16.3
Index<br />
I.xi<br />
E_RTRN_VOID 16.4<br />
END_HANDLER 16.2, 16.3<br />
Exception Codes from Methods 16.3<br />
Exception Names 16.3<br />
HANDLER 16.2, 16.3<br />
H<strong>and</strong>ler Constructs<br />
Multiple 16.3<br />
Risks of Returning from within 16.3<br />
H<strong>and</strong>ler Mechanism 16.2<br />
OS/390 Platform Concerns 16.4<br />
Overview 16.2<br />
Errors<br />
Communication back to Application<br />
16.2<br />
Link<br />
"Browser is Busy" 13.7<br />
OS/390<br />
Not Using SAS/C<br />
ASGetErrorString 16.4, 16.5<br />
DLExceptionCode 16.4, 16.5<br />
DLExceptionFlag 16.4, 16.5<br />
DLExceptionMessage 16.5<br />
Using SAS/C 16.4<br />
Outer Error Catcher 16.2<br />
Examples<br />
Adding Outline Entries 14.4<br />
with a Named Destination 14.4<br />
Bitmapped Graphic via<br />
dlpdfimagecreatefrombmp 11.4<br />
Collapsing<br />
CMYK to Gray 12.17<br />
RGB to Gray 12.16<br />
Converting<br />
CMYK to RGB 12.18<br />
RGB to CMYK 12.18<br />
Creating<br />
Calgray Color Space 12.5<br />
Gray Color Space<br />
Assembler 12.4<br />
C coding 12.4<br />
Link Annotation 13.6<br />
Link To A Named Destination 13.7<br />
Named Destination 13.8<br />
Text Annotations 13.4<br />
Drawing a Rectangle <strong>and</strong> Ellipse in Path<br />
Operators 10.15<br />
Filling an Area with a Pattern 12.14<br />
Inserting<br />
EPSF Image with<br />
dlpdfimagecreatefromps<br />
11.8<br />
PDF Image<br />
via dlpdfimagecreatefromfile<br />
11.10<br />
via dlpdfimagecreatefrompdf<br />
11.9<br />
Line Drawing Using Fixed Structure 10.6<br />
Modifying a Goto Link into a GotoR Link<br />
13.10<br />
Multiple Containers per Page with<br />
Rotation 7.6<br />
Setting the Page Mode to Display<br />
Navigation Pane 14.6<br />
Transparent Graphics via Imagemasks<br />
11.13<br />
Exception H<strong>and</strong>lers, Required Use 3.2<br />
Exceptions<br />
Use in Error H<strong>and</strong>ling 16.2<br />
F<br />
Filename, Setting Output PDF<br />
Calls 3.3<br />
Files in Memory<br />
Activating within <strong>DLI</strong> Samples 17.2<br />
Activation 2.8<br />
MEMORY Comm<strong>and</strong> Line Argument,<br />
Use of 17.2, 17.3<br />
Use of dlpdfinit 17.2<br />
Use of eMemFileSys in <strong>DLI</strong> Samples 17.3<br />
Use of FileSystemType in <strong>DLI</strong> Samples<br />
17.3<br />
Files, Transient 2.15<br />
FileSystemType<br />
Use in Files in Memory in <strong>DLI</strong> Samples<br />
17.3<br />
fill (parameter)<br />
Use in Displaying Images 11.5<br />
Fill Color<br />
Use in PDEGraphicState 10.2<br />
fillColorSpec<br />
Use in Color Description 12.2<br />
Use in Line Drawing 10.17<br />
Fit Type<br />
Use in Bookmarks 14.3<br />
FitDescription<br />
Use in Annotations <strong>and</strong> Links 13.5<br />
FitType<br />
Use in Annotations <strong>and</strong> Links 13.5<br />
Use in Links 13.5
I.xii<br />
<strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
Values<br />
Fit 13.5<br />
FitB 13.5<br />
FitBH 13.5<br />
FitBV 13.5<br />
FitH 13.5<br />
FitR 13.5<br />
FitV 13.5<br />
XYZ 13.5<br />
Fixed Rectangle<br />
Use in Bookmarks 14.3<br />
Flate Compression<br />
Use in Displaying Images 11.7<br />
flatness<br />
Use in Line Drawing 10.18<br />
FOLIO 6.3, A.123<br />
Font Dump<br />
Via FontVerification (Sample <strong>DLI</strong><br />
Application) 17.13<br />
Font Searching Sequence 4.7<br />
FontFaux (Sample <strong>DLI</strong> Application) 17.11<br />
Fonts<br />
Accessing 4.15<br />
OS/390-specific 4.15<br />
Calls 3.3<br />
Code Page Support 4.13<br />
Composite Fonts<br />
CIDType0 4.3<br />
CIDType2 4.3<br />
Overview 4.3<br />
Creation Calls in <strong>DLI</strong><br />
Calls 4.7, 4.8, 4.11<br />
dlpdffontcreatewithmetrics<br />
Width Table 4.10<br />
Font Searching Sequence 4.7<br />
Matching Calls to System Fonts 4.9<br />
Overview 4.6<br />
Performance Considerations 4.13<br />
Repetitive Calling 4.6<br />
Default Encoding Selection 3.3<br />
differences between characters <strong>and</strong><br />
glyphs 4.2<br />
Embedding<br />
Document EmbedFonts flag 4.5<br />
Subsetting Limitations 4.5<br />
Font Dump via FontVerification (Sample<br />
<strong>DLI</strong> Application) 17.13<br />
Font Searching Sequence 4.7<br />
Overview 4.2<br />
PDFLDataRec<br />
Use in Setting Resource Directories<br />
2.3<br />
Predefined Font Encodings 4.11<br />
Encoding Font Types Table 4.12<br />
Resources, Identifying Non-St<strong>and</strong>ard<br />
Locations of 2.3<br />
Search Paths 2.3<br />
Simple Fonts 4.2<br />
St<strong>and</strong>ard Encoding<br />
Default Setting 3.3<br />
Structure of a <strong>DLI</strong> Font 4.4<br />
Terminology usage<br />
CIDType2 font 4.4<br />
TrueType font 4.4<br />
Unicode 4.13<br />
Use in Multibyte Text Work 5.3<br />
WinAnsiEncoding<br />
Default Setting 3.3<br />
FontVerification (Sample <strong>DLI</strong> Application)<br />
17.13<br />
Encoding Grid 17.13<br />
Slow Feedback from 17.14<br />
Table of Contents 17.13<br />
Form XObjects<br />
Use in Displaying Images 11.11<br />
Forms 9.2<br />
Calls 9.3<br />
dlpdfformcreate<br />
Use of Bounding Box 9.3<br />
Content Complexity 9.2<br />
Destruction 9.2<br />
Overview 9.2<br />
Structure 9.2<br />
Use in Referencing Predefined<br />
Structures 8.20<br />
Forms XObjects<br />
Association with Content Structures 8.2<br />
Use in Content Interface 8.2<br />
free<br />
Alternate Routines for 2.5<br />
PDFInit.h Interface to 2.5<br />
Free Software Foundation 1.4<br />
freeProc<br />
Use in Setting Memory Allocation<br />
Routines 2.5<br />
Functions added in <strong>DLI</strong> v3.0 1.15<br />
Functions removed from <strong>DLI</strong> v3.0 1.18<br />
Functions updated in <strong>DLI</strong> v3.0 1.18<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System
Index<br />
I.xiii<br />
G<br />
gcc Compilation Version 1.4<br />
genErrBadParm 4.8, 6.3<br />
Use in Annotations <strong>and</strong> Links 13.4<br />
GetGraphicFromList A.184<br />
Use in Displaying Images 11.11<br />
GetGraphicFromList, OS/390<br />
Use in Displaying Images 11.12<br />
GIF (Graphics Interchange Format)<br />
Encoding <strong>and</strong> Compression <strong>Reference</strong>s<br />
11.4<br />
Image Conversion from 11.2<br />
Use in Displaying Images 11.10<br />
Use in Graphics (Sample <strong>DLI</strong> Application)<br />
17.6<br />
Glyph IDs 4.3<br />
GoTo<br />
Use in Annotation Dictionary 13.9<br />
Graphics (Sample <strong>DLI</strong> Application) 17.6<br />
Graphics cache<br />
What’s New in <strong>DLI</strong> v3.0 1.16<br />
Graphics, One-Bit<br />
Use in Displaying Images 11.12<br />
grayScale<br />
Use in Color Description 12.2<br />
Use in ICC Based Color Profile 12.10<br />
H<br />
Hello<strong>DLI</strong> (Sample <strong>DLI</strong> Application) 17.4<br />
Comparison with helowrld.c 2.17<br />
HeloWrld (Sample Adobe PDF Library<br />
Application) 17.4<br />
Comparison with hellodli.c 2.17<br />
hot spot (parameter)<br />
Definition of 13.2<br />
Use in Annotations <strong>and</strong> Links 13.2,<br />
13.5<br />
Hyperlinks<br />
Use in Links 13.7<br />
I<br />
ICC (International Color Consortium) 12.10<br />
ICCBased<br />
Use in Color Spaces<br />
Advanced 12.12<br />
Use in ICC Based Color Profile 12.10<br />
ICU (International Components for Unicode)<br />
Obtaining Encoding names via<br />
dlpdftextshowencodingnames<br />
1.16, A.178<br />
Unicode font translation via ICU 4.3<br />
Use in Multibyte Text Work 5.2<br />
What’s New 1.13<br />
Image Import Improvents in <strong>DLI</strong> v3.0 1.14<br />
Imagemask<br />
ImageMask key 11.12<br />
Note on Use of Bitmaps 11.6<br />
Use in Displaying Images 11.12<br />
ImageName<br />
Use in Displaying Images 11.3<br />
Images, Displaying<br />
EPS Pass-Through Objects 11.7<br />
Example 11.8<br />
Graphic Image Forms<br />
Bitmaps 11.3<br />
Example 11.4<br />
Graphical Language 11.5<br />
Graphic Image Structures<br />
Destroying 11.3<br />
Formats Supported 11.2<br />
ImageName Use 11.3<br />
Multiple Document Use 11.2<br />
Image Creation Methods<br />
Assorted Formats<br />
dlpdfimagecreatefromfile<br />
11.10<br />
Example 11.10<br />
Supported Formats 11.10<br />
Bitmaps<br />
Compression <strong>and</strong> Filtering 11.7<br />
dlpdfimagecreatefrombmp<br />
11.6<br />
Values within Color Models<br />
11.6<br />
EPS<br />
dlpdfimagecreatefromps 11.7<br />
Example 11.8<br />
Form XObject<br />
dlpdfimageplaceascontent<br />
11.11<br />
GetGraphicFromList 11.12<br />
LoadGraphicList 11.11<br />
PDF<br />
dlpdfimagecreatefrompdf 11.8<br />
Example 11.9<br />
Transparent Graphics<br />
dlpdfcontentgstate 11.13
I.xiv<br />
<strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
Imagemasks 11.12<br />
Sample 11.13<br />
Included EPS Images Not Appearing in<br />
PDF Pages 11.2, 11.7<br />
Overview 11.2<br />
Indexed (atom)<br />
Use in Color Spaces<br />
Advanced 12.12<br />
Initializing <strong>and</strong> Terminating the Library<br />
Comparison of Applications with <strong>and</strong><br />
without <strong>DLI</strong> 2.17<br />
Files In Memory<br />
Activation 2.8<br />
Image Search using Files in Memory<br />
2.11<br />
Output to Memory, Writing PDF 2.15<br />
Calls 2.16, 2.17<br />
Transient Files 2.15<br />
Overview 2.2<br />
PDFLDataRec Initialization 2.2<br />
Memory Allocation Routines, Setting<br />
2.5<br />
Resource Allocation Routines,<br />
Setting 2.5<br />
Resource Directories, Setting 2.3<br />
Terminating 2.11<br />
Thread-Safe Issues<br />
Initialization of non-thread-safe<br />
Library releases 2.14<br />
Multi-Thread Initializations 2.13<br />
mutex (Mutual Exclusion algorithm)<br />
2.14<br />
Version Number, Obtaining 2.6<br />
With <strong>DLI</strong><br />
Calls 2.9, 2.11, 2.12<br />
Overview 2.8<br />
Specifying an Alternate File System<br />
2.10<br />
Typical Order of Calls 2.13<br />
Using a Graphics Cache 2.10<br />
Intended Audience 1.3<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
J<br />
JPEG/JPG (Joint Photographic Experts Group)<br />
Encoding <strong>and</strong> Compression <strong>Reference</strong>s<br />
11.4<br />
Use in Displaying Images 11.10<br />
Use in Graphics (Sample <strong>DLI</strong> Application)<br />
17.6<br />
K<br />
Keys, Public <strong>and</strong> Private 15.2<br />
kPDEEoFill<br />
Use in Content Interface Calls 8.6<br />
Use in Line Drawing 10.2, 10.3, 10.15,<br />
10.17<br />
Use in PDEGraphicState 10.2<br />
kPDEFill<br />
Use in Content Interface Calls 8.6<br />
Use in Line Drawing 10.2, 10.3, 10.15,<br />
10.17<br />
Use in PDEGraphicState 10.2<br />
kPDEStroke<br />
Use in Content Interface Calls 8.6<br />
Use in Line Drawing 10.2, 10.3, 10.15,<br />
10.17<br />
Use in PDEGraphicState 10.2<br />
kPDEStroke | kPDEEoFill<br />
Use in Line Drawing 10.15<br />
kPDEStroke | kPDEFill<br />
Use in Line Drawing 10.15<br />
kPDFLInitIgnoreDefaultDirectories<br />
Use in Default Search Path Suppression<br />
1.21, 2.3<br />
kPDFLVersion<br />
Use in Obtaining Version Number 2.6<br />
L<br />
Lab<br />
Use in Color Spaces<br />
Basic 12.9<br />
Use in ICC Based Color Profile 12.10<br />
Library Data Structure 2.2<br />
Line Drawing 10.1<br />
Directly-Drawn Methods 10.3<br />
Calls 10.4, 10.5, 10.6<br />
Common Parameters 10.3<br />
dlpdfcontentpath<br />
Example 10.6<br />
Graphic State 10.17<br />
Overview 10.2<br />
Path Drawing Methods 10.7<br />
Calls 10.7, 10.8, 10.9, 10.10,<br />
10.11, 10.12, 10.13,<br />
10.14, 10.15<br />
Common Parameters 10.7<br />
Example 10.15<br />
Transformation Matrix 10.15
Index<br />
I.xv<br />
Arguments 10.15<br />
dlpdfmatrixrotate 10.16<br />
Inversion Matrix 10.16<br />
Mirror-image matrix 10.16<br />
Rotation Matrix 10.16<br />
Scale/Rotation Caution 10.16<br />
Scaling 10.16<br />
Shearing 10.16<br />
Translations 10.16<br />
Unity Matrix 10.16<br />
Linearization<br />
Calls 3.4<br />
Use in Documents, Beginning <strong>and</strong><br />
Ending 3.4<br />
lineCap<br />
Use in Line Drawing 10.18<br />
lineJoin<br />
Use in Line Drawing 10.18<br />
lineWidth<br />
Use in Line Drawing 10.17<br />
Link Annotation<br />
Modifying 13.9<br />
Link Cos Object<br />
Modifying 13.9<br />
Links<br />
action (parameter) 13.2<br />
Calls 13.4, 13.6, 13.7, 13.8<br />
Components 13.2<br />
Cross-document 13.6<br />
Destination Page Number 13.5<br />
FitType 13.5<br />
hot spot (parameter)<br />
Definition of 13.2, 13.5<br />
Introduction 13.1<br />
List of Possible Actions 13.9<br />
Modifying 13.9<br />
Overview 13.2<br />
URI 13.7<br />
URL 13.7<br />
Zoom 13.5<br />
listLen<br />
Use in Setting Resource Directories 2.3<br />
LoadGraphicList A.185<br />
M<br />
Major Version Number 2.6<br />
malloc<br />
Alternate Routines for 2.5<br />
PDFInit.h Interface to 2.5<br />
Matrix operations<br />
Rotations 17.5<br />
Translation of Paths 17.5<br />
MDFile<br />
Use in Writing PDF Output to Memory<br />
2.16<br />
memAvailProc<br />
Use in Setting Memory Allocation<br />
Routines 2.5<br />
memFiles (Sample <strong>DLI</strong> Application) 17.16<br />
MEMORY<br />
Use in Files in Memory Activation 17.2,<br />
17.3<br />
Memory Allocation Routines, Setting 2.5<br />
allocProc 2.5<br />
freeProc 2.5<br />
memAvailProc 2.5<br />
reallocProc 2.5<br />
Minor Version Number 2.6<br />
Miter<br />
Use in Line Drawing 10.18<br />
miterLimit<br />
Use in Line Drawing 10.18<br />
Multibyte Text<br />
Comm<strong>and</strong>s 5.3, 5.5, 5.6, 5.7, 5.8,<br />
5.9, 5.10<br />
Creating DLPDFTEXT Areas 5.5<br />
Introduction 5.2<br />
Loading <strong>and</strong> Creating Fonts 5.3<br />
Performance Considerations 5.10<br />
Working With DLPDFTEXT Areas 5.7<br />
MultiDoc (Sample <strong>DLI</strong> Application) 17.16<br />
Required Arguments 17.16<br />
mutex (Mutual Exclusion algorithm) 2.14<br />
N<br />
name<br />
Use in Links<br />
instead of Destination 13.6<br />
name (parameter)<br />
Use in Links 13.8<br />
Name Tree A.51<br />
Adding Destination 13.8<br />
Use in Annotations <strong>and</strong> Links 13.6<br />
hot spot Definition 13.2<br />
Use in Links 13.6<br />
Named Destination<br />
Use in Annotations <strong>and</strong> Links 13.6<br />
Names
I.xvi<br />
<strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
Use in Annotations <strong>and</strong> Links 13.6<br />
vs. Destinations 13.6<br />
NestedPDF (Sample <strong>DLI</strong> Application) 17.17<br />
NotEmbedded (flag) 3.3, 4.5, A.47<br />
Notes<br />
"Browser is Busy" Error during Link 13.7<br />
Adobe CFF OpenType font files not<br />
properly subset 5.3<br />
ASN membership may be required for<br />
Adobe website access 1.10<br />
Base 14 Fonts<br />
Creation Allowed by dlpdffontcreate<br />
4.6<br />
Bitmapped Images under 500 Bytes<br />
Always Merged Inline 11.6<br />
BMP images with LZW skip markers may<br />
not embed properly 17.8<br />
Cache size limit is checked every time a<br />
document is destroyed 2.10,<br />
A.91, A.94<br />
Colorizing via Stroke <strong>and</strong> Fill 8.6, 10.2<br />
Default-filesystem settings may need<br />
updating for images in memory<br />
1.21, 2.11<br />
Digital Signature signed hash values<br />
must be exactly 256 hex digits<br />
15.5<br />
Disk resources used by default if Output<br />
to Memory is not set 2.10<br />
<strong>DLI</strong> v2.2 Unicode support now<br />
superceded by new Multibyte text<br />
methods 5.2<br />
dlpdfcontentarcto Discrepancies with<br />
PostScript Output 10.5<br />
DLPDFINSTANCE required for Unicode<br />
font creation 1.13<br />
dlpdfmemfiledeleteonclose required for<br />
memory file deletion 1.15<br />
dlpdfpathaddarcto Line Drawing Details<br />
10.10<br />
dlpdfpathaddclose, Adding Disjoint Path<br />
Segments After 10.14<br />
dlpdfttload does not re-parse previouslyloaded<br />
font file 5.4<br />
Document Sharing of COS Objects <strong>and</strong><br />
PDEColorSpaces 12.5<br />
Encryption Key Length, Setting in<br />
Multiple Documents 3.5<br />
Error H<strong>and</strong>ling should conform to<br />
Adobe guidelines 16.2<br />
File Sizes, Effect on, by<br />
Repeated Graphical Object<br />
<strong>Reference</strong>s 11.11<br />
Files in /Codesamples folder not<br />
buildable source as-is 1.5, 11.13<br />
Fill Operator Not Valid via<br />
dlpdfcontentline 10.4<br />
Fill Patterns are Never Destroyed 12.14<br />
Font Encoding, Limitations on<br />
Predefined 4.9<br />
Font not licensed for embedding will be<br />
created as <strong>Reference</strong>d instead 3.3,<br />
4.5<br />
Function Return Value is Undefined if<br />
Error Occurs 16.4<br />
Graphic Conversions,Some Unavailable<br />
on OS/390 <strong>and</strong> OS/400 11.3,<br />
11.10<br />
Graphic Key on OS/390 Must be ASCII<br />
String 11.12<br />
Images cached by filename 17.8<br />
Included EPS Images Not Appearing in<br />
PDF Pages 11.2, 17.6<br />
Library is not thread-safe 1.4<br />
No default font searching for<br />
dlpdfttload 2.3<br />
Only fonts using st<strong>and</strong>ard encodings<br />
may be fauxed 17.12<br />
Pass accurate length values for PKCS #7<br />
certificate output space reservation<br />
15.6, A.162<br />
Pattern Interaction with Color when<br />
Drawing Figures 10.17<br />
PDColorValue Permits Only 4 Channels<br />
12.11<br />
PDEPathGetData Requirement for Path<br />
Data Retrieval 10.6<br />
PDEPathGetData Return Value 8.7<br />
PDF <strong>Reference</strong> Manual errata file<br />
available for download 1.10<br />
Popup warning may occur for new PDF<br />
in old viewers 1.12, 2.7<br />
RSA encryption algorithm within<br />
SignDoc sample not recommended<br />
for Production code 17.19<br />
Sample applications are subject to<br />
change 17.2<br />
Slow Feedback from FontVerification<br />
(Sample <strong>DLI</strong> Application) 17.14<br />
Structure Variations may exist between<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System
Index<br />
I.xvii<br />
O<br />
PDF 1.5 <strong>and</strong> earlier 1.3<br />
Type is Filled, Not Stroked 12.2<br />
Type0 Fonts must be Subset if<br />
Embedded 4.8<br />
Unicode NULL string terminators not<br />
required or included in calculations<br />
A.37, A.38<br />
Upgrade applications to thread-safe<br />
capability as soon as possible 2.15<br />
WideText sample application uses fonts<br />
not distributed with <strong>DLI</strong> 17.21<br />
Outline Tree<br />
Adding New Entry 14.3<br />
Use in Bookmarks<br />
Building Multiple Trees 14.2<br />
Output File, Writing<br />
Calls 3.4<br />
Document Information 3.4<br />
Encryption 3.4<br />
Linearization 3.4<br />
Security Permissions 3.5<br />
P<br />
Page<br />
Use in Content Interface 8.2<br />
Page Interface Calls 6.2, 6.3<br />
Page Structure 6.2<br />
PageMode<br />
Use in Bookmarks 14.6<br />
Paint Operator<br />
Use in Content Interface Calls 8.5<br />
Use in Line Drawing 10.2<br />
Pass-Through Objects<br />
Use in Displaying EPS Images 11.7<br />
Passwords<br />
Setting in Encrypt (Sample <strong>DLI</strong><br />
Application) 17.9<br />
Paths (Sample <strong>DLI</strong> Application) 17.5<br />
Patterned Colors 12.2<br />
Patterns, creating background 17.17<br />
PCKS #7-format certificates 17.19<br />
PD_STD_ENCODING (flag) 17.12<br />
PDColorValue<br />
Use in Color Spaces<br />
Advanced 12.11<br />
PDDoc 3.2<br />
PDDocSetNewSecurityData<br />
Use in Documents, Beginning <strong>and</strong><br />
Ending 3.5<br />
PDEColorSpace<br />
Creating <strong>and</strong> Destroying 12.3<br />
Document Sharing 12.5<br />
Use in Color Description 12.2<br />
PDEColorSpaceCreate<br />
Creating <strong>and</strong> Destroying 12.5<br />
Use in Color Spaces<br />
Advanced 12.11, 12.12<br />
Basic 12.9<br />
Use in ICC Based Color Profile 12.10<br />
PDEColorSpaceCreateFromName<br />
Use in Color Spaces<br />
Advanced 12.11, 12.12<br />
Basic 12.9, 12.10<br />
PDEColorSpaceGetCosObj<br />
Use in Image Color Spaces 12.3<br />
PDEDash<br />
Use in Line Drawing 10.19<br />
PDEDeviceNColorData<br />
Use in Color Spaces<br />
Advanced 12.11<br />
PDEFontAttrs 4.5, 4.8, 17.11, 17.12<br />
charset field 4.9<br />
encoding field 4.9<br />
type field 4.9<br />
Use in Creation Calls in <strong>DLI</strong> 4.6<br />
wMode field 4.10<br />
PDEGraphicState 8.4, 8.5<br />
Color Definitions 10.2<br />
Use in Color Description 12.2<br />
Use in Content Interface 8.2<br />
Use in Displaying Images 11.13<br />
Use in Line Drawing 10.2, 10.14,<br />
10.17<br />
dash 10.18<br />
fillColorSpec 10.17<br />
flatness 10.18<br />
lineCap 10.18<br />
lineJoin 10.18<br />
lineWidth 10.17<br />
miterLimit 10.18<br />
effect on lineJoin 10.18<br />
strokeColorSpec 10.17<br />
PDEGrayCalFlt<br />
Use in Color Spaces<br />
Basic 12.9<br />
PDEICCBasedColorData
I.xviii <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
Use in ICC Based Color Profile 12.10<br />
PDEIndexedColorData<br />
Use in Color Spaces<br />
Advanced 12.12<br />
PDELabCalFlt<br />
Use in Color Spaces<br />
Basic 12.9<br />
PDEPath<br />
Use in Line Drawing 10.6<br />
PDEPathAddSegment<br />
Cited in PDF Rules for Path Construction<br />
10.6<br />
PDEPathGetData A.17<br />
Use in Content Interface Calls 8.7<br />
Use in Line Drawing 8.7, 10.6<br />
PDERGBCalFlt<br />
Use in Color Spaces<br />
Basic 12.9<br />
PDESeparationColorData<br />
Color Spaces<br />
Advanced 12.11<br />
PDETextState 8.4<br />
Use in Content Interface 8.2<br />
PDF<br />
Image Conversion from 11.2<br />
Level Declarations in Output 1.12, 2.6<br />
Declarations via <strong>DLI</strong> 1.12<br />
<strong>DLI</strong>-selected Declarations 2.7<br />
Overriding <strong>DLI</strong>-selected Declarations<br />
2.7<br />
Use in Displaying Images 11.8, 11.10,<br />
11.11<br />
Use in Graphical Language Forms 11.5<br />
Use in Graphics (Sample <strong>DLI</strong> Application)<br />
17.6<br />
PDF Library<br />
Use in Multithreaded Applications 1.11<br />
Version Control 1.12, 2.6<br />
PDF Page Tree Structures 6.2<br />
PDFInit.h<br />
Use in Setting Memory Allocation<br />
Routines 2.5<br />
Use in Setting Resource Allocation<br />
Routines 2.5<br />
PDFLDataRec<br />
Use in Default Search Path Suppression<br />
1.21<br />
Use in Initializing <strong>and</strong> Terminating the<br />
Library 2.2, 2.3<br />
Use in Setting Memory Allocation<br />
Routines 2.5<br />
Use in Terminating Library 2.12<br />
PDFLGetVersion<br />
Use in Obtaining Version Number 2.6<br />
PDFLInit<br />
Caution on Multiple Initializations of<br />
pre-v6.1 Library 2.9, A.91<br />
Prohibition on calling from <strong>DLI</strong> v3.0<br />
1.14, A.91<br />
Use in Default Search Path Suppression<br />
1.21<br />
Use in Initializing <strong>and</strong> Terminating via<br />
<strong>DLI</strong> 2.9<br />
Use in Multi-Thread Initializations 2.13<br />
PDFLTerm<br />
Prohibition on calling from <strong>DLI</strong> v3.0<br />
1.14, A.91<br />
Use in Multi-Thread Initializations 2.13<br />
pdfMajorVer 2.7<br />
pdfMinorVer 2.7, 2.8<br />
PDFNeeded (flag)<br />
Removal from dlpdfdoccreate 1.18,<br />
A.43<br />
PDPerms<br />
Use in Documents, Beginning <strong>and</strong><br />
Ending<br />
Encryption 3.5<br />
PDViewDestNull<br />
Use in Bookmarks 14.3<br />
Use in Links<br />
with Zoom 13.5<br />
Performance Considerations<br />
Font Creation Calls in <strong>DLI</strong> 4.13<br />
Plugins<br />
Self-Sign 17.19<br />
VeriSign Signature 17.19<br />
PNG (Portable Network Graphics)<br />
Encoding <strong>and</strong> Compression <strong>Reference</strong>s<br />
11.4<br />
Image Conversion from 11.2<br />
Use in Displaying Images 11.10<br />
Use in Graphics (Sample <strong>DLI</strong> Application)<br />
17.6<br />
Private keys 15.2<br />
psOutput (Sample <strong>DLI</strong> Application) 17.20<br />
Public keys 15.2<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
Q<br />
QuickDraw
Index<br />
I.xix<br />
R<br />
Use in Graphical Language Forms 11.5<br />
RAW (Unformatted Unannotated Bitmap)<br />
Use in Graphics (Sample <strong>DLI</strong> Application)<br />
17.6<br />
readme.txt 1.11<br />
realloc<br />
PDFInit.h Interface to 2.5<br />
reallocProc<br />
Use in Setting Memory Allocation<br />
Routines 2.5<br />
Rect (parameter)<br />
Use in Annotation Dictionary 13.9<br />
Rectangles<br />
Use in Links 13.5<br />
Release Notes 1.11<br />
Resource Allocation Routines, Setting 2.5<br />
Resource Directories, Setting<br />
Use in Initializing <strong>and</strong> Terminating the<br />
Library 2.3<br />
Resources<br />
Adobe<br />
AcroColor API <strong>Reference</strong> 1.10<br />
Adobe Acrobat Core API Overview<br />
1.10<br />
Adobe Acrobat Core API <strong>Reference</strong><br />
1.10<br />
Adobe PDF Library Overview 1.10<br />
Adobe PDF Library Supplement to<br />
the Acrobat Core API<br />
1.11<br />
Portable Document Format<br />
<strong>Reference</strong> Manual 1.10<br />
Errata file 1.10<br />
<strong>Datalogics</strong><br />
Adobe PDF Library <strong>and</strong> <strong>DLI</strong><br />
Installation <strong>Guide</strong> 1.9<br />
Adobe PDF Library Developer<br />
Overview 1.9<br />
<strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong><br />
<strong>Guide</strong> 1.9<br />
Java Interface User <strong>Guide</strong> 1.9<br />
RGB Color<br />
Collapsing to Gray 12.16<br />
Converting to CMYK 12.17<br />
Use in Annotations <strong>and</strong> Links 13.3<br />
Use in Color Description 12.2<br />
Use in ICC Based Color Profile 12.10<br />
Rotate (flag), in imported image files 1.14<br />
RSA encryption algorithm 17.19<br />
S<br />
Sample <strong>DLI</strong> Applications<br />
AcroForm 17.18<br />
Activating Files in Memory 17.2<br />
Annotations 17.15<br />
Encrypt 17.9<br />
FontFaux 17.11<br />
FontVerification 17.13<br />
Graphics 17.6<br />
Hello<strong>DLI</strong> 17.4<br />
memFiles 17.16<br />
MultiDoc 17.16<br />
NestedPDF 17.17<br />
Overview 17.2<br />
Paths 17.5<br />
psOutput 17.20<br />
SignDoc 17.19<br />
WideText 17.21<br />
Security Permissions<br />
Use in Documents, Beginning <strong>and</strong><br />
Ending<br />
Encryption 3.5<br />
Use in Encrypt (Sample <strong>DLI</strong> Application)<br />
17.10<br />
Self-Sign Plugin 17.19<br />
Separation<br />
Color Spaces<br />
Advanced 12.11<br />
Seven-Bit Safe<br />
Use in Displaying Images 11.7<br />
Signatures<br />
as images in Digital Signatures 15.3<br />
SignDoc (Sample <strong>DLI</strong> Application) 17.19<br />
St<strong>and</strong>ard Encoding<br />
Use in Documents, Beginning <strong>and</strong><br />
Ending 3.3<br />
StdSecurityDataRec<br />
Use in Documents, Beginning <strong>and</strong><br />
Ending 3.5<br />
sticky note<br />
Use in Annotations <strong>and</strong> Links 13.4<br />
Streaming PostScript<br />
Removal from <strong>DLI</strong> v3.0 1.14<br />
stroke (parameter)<br />
Use in Displaying Images 11.5<br />
Stroke Color 8.6
I.xx<br />
<strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />
Use in PDEGraphicState 10.2<br />
strokeColorSpec<br />
Use in Color Description 12.2<br />
Use in Line Drawing 10.17<br />
Sub-minor Version Number 2.6<br />
SubType (parameter)<br />
Use in Annotation Dictionary 13.9<br />
Use in Links 13.9<br />
Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />
T<br />
Table of Contents<br />
Generation via FontVerification (Sample<br />
<strong>DLI</strong> Application) 17.13<br />
Text Container<br />
Creation <strong>and</strong> Positioning 8.3<br />
Text Placement Calls 8.4<br />
Text Layering 8.2<br />
Text Width 8.4<br />
Thread Safety<br />
Caution on Multiple Initializations of<br />
pre-v6.1 Library 2.9<br />
Initialization of non-thread-safe Library<br />
releases 2.14<br />
Multi-Thread Initializations 2.13<br />
Thumbnails<br />
Calls 3.4<br />
Use in Documents, Beginning <strong>and</strong><br />
Ending 3.4<br />
TIFF (Tagged Image File Format)<br />
Encoding <strong>and</strong> Compression <strong>Reference</strong>s<br />
11.4<br />
Image Conversion from 11.2<br />
Use in Displaying Images 11.10<br />
Use in Graphics (Sample <strong>DLI</strong> Application)<br />
17.6<br />
TKAllocatorProcs<br />
Use in Setting Memory Allocation<br />
Routines 2.5<br />
TKResourceProcs<br />
Use in Setting Resource Allocation<br />
Routines 2.5<br />
Transformation Matrix<br />
Arguments 10.15<br />
Overview 10.15<br />
Translations<br />
Inversion 10.16<br />
Mirror-image 10.16<br />
Rotation 10.16<br />
Scale/Rotation Caution 10.16<br />
Scaling 10.16<br />
Shearing 10.16<br />
Translation 10.16<br />
Transforms<br />
Association with Content Elements 8.2<br />
Tree Name<br />
Use in Links 13.8<br />
TrueType font<br />
Terminology usage 4.4<br />
Type<br />
Filled vs. Stroked 12.2<br />
Type (parameter)<br />
Use in Annotation Dictionary 13.9<br />
Use in Links 13.9<br />
U<br />
Unicode<br />
as CIDType2 Fonts 4.3<br />
Text Support<br />
Font Type Recommendations 4.13<br />
NULL string terminators A.37, A.38<br />
Unix Compiler Run-Time Libraries 1.4<br />
URI<br />
Use in Links 13.7<br />
URL<br />
Use in Links 13.7<br />
UseOutlines<br />
Use in Bookmarks 14.6<br />
V<br />
VeriSign signature plugin 17.19<br />
Version Number, Obtaining 2.6<br />
W<br />
What’s New<br />
<strong>DLI</strong> v2.2.12 1.21<br />
Default Search Path Suppression<br />
1.21<br />
<strong>DLI</strong> v2.2.13 1.20<br />
Default Search Path Suppression<br />
Exp<strong>and</strong>ed to All Platforms<br />
1.20<br />
Image Search using Files in Memory<br />
1.20<br />
<strong>DLI</strong> v3.0 1.11<br />
Overview 1.11<br />
WideText (Sample <strong>DLI</strong> Application) 1.13,
<strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong><br />
17.21<br />
WinAnsiEncoding<br />
Use in Documents, Beginning <strong>and</strong> Ending 3.3<br />
WMF (Windows Metafile Format)<br />
Use in Graphical Language Forms 11.5<br />
Writing Pages<br />
Procedure for 1.2<br />
X<br />
x.509 certificate 17.19<br />
XYZ<br />
Use in Links<br />
with Zoom 13.5<br />
Z<br />
zoom<br />
Use in Bookmarks 14.3<br />
Use in Links 13.5