Pdflib api reference


Contents 1 Programming Concepts



Yüklə 0,69 Mb.
Pdf görüntüsü
səhifə2/6
tarix30.03.2023
ölçüsü0,69 Mb.
#91620
1   2   3   4   5   6
demo

Contents
1 Programming Concepts
7
1.1 Option Lists 7
1.1.1
Syntax 7
1.1.2
Simple Data Types 10
1.1.3
Fontsize and Action Data Types 12
1.1.4
Color Data Type 13
1.1.5
Geometric Data Types 15
1.2 Function Scopes 17
1.3 Logging 18
2 General Functions
21
2.1 Exception Handling 21
2.2 Unicode Conversion 23
2.3 Global Options 25
2.4 Creating and Deleting PDFlib Objects 32
2.5 PDFlib Virtual File System (PVF) 34
2.6 PDF Object Creation API (POCA) 37
3 Document and Page Functions
41
3.1 Document Functions 41
3.2 Fetching PDF Documents from Memory 51
3.3 Page Functions 52
3.4 Layers 57
4 Font and Text Functions
63
4.1 Font Handling 63
4.2 Text Filter and Appearance Options 75
4.3 Simple Text Output 79
4.4 User-defined (Type 3) Fonts 83
4.5 User-defined 8-Bit Encodings 86
5 Text and Table Formatting
87
5.1 Single-Line Text with Textlines 87
5.2 Multi-Line Text with Textflows 93
5.3 Table Formatting 110
6 Object Fitting and Matchboxes
121
6.1 Object Fitting 121


4
Contents
6.2 Matchboxes 129
7 Graphics Functions
133
7.1 Graphics Appearance Options 133
7.2 Graphics State 136
7.3 Coordinate System Transformations 140
7.4 Path Construction 143
7.5 Painting and Clipping 147
7.6 Path Objects 149
8 Color Functions
155
8.1 Setting Color 155
8.2 ICC Profiles 158
8.3 Patterns and Shadings 160
9 Image, SVG Graphics and Template Functions
165
9.1 Images 165
9.2 SVG Graphics 173
9.3 Templates 179
9.4 Common XObject Options 181
10 PDF Import (PDI) and pCOS Functions
187
10.1 Document Functions 187
10.2 Page Functions 191

10.3 Other PDI Processing 197
10.4 pCOS Functions 199

11 Block Filling Functions (PPS)
203
11.1 Rectangle Options for Block Filling Functions 203
11.2 Textline and Textflow Blocks 204
11.3 Image Blocks 206
11.4 PDF Blocks 207
11.5 Graphics Blocks 208
12 Interactive Features
209
12.1 Bookmarks 209
12.2 Annotations 211
12.3 Form Fields 219
12.4 Actions 226
12.5 Named Destinations 231


Contents
5
12.6 PDF Packages and Portfolios 233
12.7 Geospatial Features 238
13 Multimedia Features
241
13.1 3D Artwork 241
13.2 Asset and Rich Media Features (Flash) 247
14 Document Interchange
255
14.1 Document Information Fields 255
14.2 XMP Metadata 257
14.3 Tagged PDF 258
14.4 Marked Content 264
14.5 Document Part Hierarchy 266
A List of all API Functions
269
B List of all Options and Keywords
271
C Revision History
287
Index
289



1.1 Option Lists
7
1 Programming Concepts
1.1 Option Lists
Option lists are a powerful yet easy method for controlling API function calls. Instead of 
requiring a multitude of function parameters, many API methods support option lists, 
or optlists for short. These are strings which can contain an arbitrary number of options. 
Option lists support various data types and composite data like lists. In most language 
bindings optlists can easily be constructed by concatenating the required keywords and 
values.
Bindings C language binding: you may want to use the sprintf( ) function for constructing optlists.
.NET language binding: C# programmers should keep in mind that the AppendFormat( ) 
StringBuilder method uses the { and } braces to represent format items which will be re-
placed by the string representation of arguments. On the other hand, the Append( ) 
method does not impose any special meaning on the brace characters. Since the option 
list syntax makes use of the brace characters, care must be taken in selecting the 
AppendFormat( ) or Append( ) method appropriately.
1.1.1 Syntax
Formal option list syntax definition.
Option lists must be constructed according to fol-
lowing rules:
>
All elements (keys and values) in an option list must be separated by one or more of 
the following separator characters: space, tab, carriage return, newline, equal sign ’=’.
>
An outermost pair of enclosing braces is not part of the element. The sequence { } 
designates an empty element.
>
Separators within the outermost pair of braces no longer split elements, but are part 
of the element. Therefore, an element which contains separators must be enclosed 
with braces.
>
If an element contains brace characters these must be protected with a preceding 
backslash character.
>
If an element contains a sequence of one or more backslash characters in front of a 
brace, each backslash in the sequence must be protected with another backslash 
character.
>
Option lists must not contain binary zero values.
An option may have a list value according to its documentation in this PDFlib Refer-
ence. List values contain one or more elements (which may themselves be lists). They 
are separated according to the rules above, with the only difference that the equal sign 
is no longer treated as a separator.
Note Option names (i.e. the key) never contain hyphen characters. Keep this in mind since the tables 
with option descriptions may sometimes contain long option names which are hyphenated. 
The hyphen must be omitted when supplying the option in an option list.
Simple option lists.
In many cases option lists will contain one or more key/value 
pairs. Keys and values, as well as multiple key/value pairs must be separated by one or 


8
Chapter 1: Programming Concepts
more whitespace characters (space, tab, carriage return, newline). Alternatively, keys 
can be separated from values by an equal sign ’=’:
key=value
key = value
key value
key1 = value1
key2 = value2
To increase readability we recommend to use equal signs between key and value and 
whitespace between adjacent key/value pairs.
Since option lists will be evaluated from left to right an option can be supplied mul-
tiply within the same list. In this case the last occurrence will overwrite earlier ones. In 
the following example the first option assignment will be overridden by the second, 
and key will have the value value2 after processing the option list:
key=value1 key=value2
List values.
Lists contain one or more separated values, which may be simple values or 
list values in turn. Lists are bracketed with and bracesand the values in the list must 
be separated by whitespace characters. Examples:
dasharray={11 22 33}
(list containing three numbers)
position={ center bottom } 
(list containing two keywords)
A list may also contain nested lists. In this case the lists must also be separated from 
each other by whitespace. While a separator must be inserted between adjacent and { 
characters, it can be omitted between braces of the same kind:
polylinelist={{10 20 30 40} {50 60 70 80}}
(list containing two lists)
If the list contains exactly one list the braces for the nested list must not be omitted:
polylinelist={{10 20 30 40}}
(list containing one nested list)

Yüklə 0,69 Mb.

Dostları ilə paylaş:
1   2   3   4   5   6




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©azkurs.org 2024
rəhbərliyinə müraciət

gir | qeydiyyatdan keç
    Ana səhifə


yükləyin