Pdflib api reference


Nested option lists and list values



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

Nested option lists and list values.
Some options accept the type option list or list of 
option lists. Options of type option list contain one or more subordinate options. Options 
of type list of option lists contain one or more nested option lists. When dealing with 
nested option lists it is important to specify the proper number of enclosing braces. 
Several examples are listed below.
The value of the option metadata is an option list which itself contains a single op-
tion filename:
metadata={filename=info.xmp}
The value of the option fill is a list of option lists containing a single option list:
fill={{ area=table fillcolor={rgb 1 0 0} }}
The value of the option fill is a list of option lists containing two option lists:
fill={{ area=rowodd fillcolor={rgb 0 1 0} } { area=roweven fillcolor={rgb 1 0 0} }}
List containing one option list with a value that includes spaces:
attachments={{filename={foo bar.xml} }}


1.1 Option Lists
9
List containing three strings:
itemnamelist = { {Isaac Newton} {James Clark Maxwell} {Albert Einstein} }
List containing two keywords:
position={left bottom}
List containing different types (float and keyword):
position={10 bottom}
List containing one rectangle:
boxes={{10 20 30 40}}
List containing two polylines with percentages:
polygons = {{10 20 40 60 90 120}} {12 87 34 98 34% 67% 34% 7%}}
Common traps and pitfalls.
This paragraph lists some common errors regarding op-
tion list syntax.
Braces are not separators; the following is wrong:
key1 {value1}key2 {value2}
WRONG!
This will trigger the error message Unknown option 'value2'. Similarly, the following are 
wrong since the separators are missing:
key{value}
WRONG!
key={{value1}{value2}}
WRONG!
Braces must be balanced; the following is wrong (see below for unquoted string syntax):
key={open brace {}
WRONG!
This will trigger the error message Braces aren't balanced in option list 'key={open brace {}'. 
A single brace as part of a string must be preceded by an additional backslash character:
key={closing brace \} and open brace \{}
CORRECT!
A backslash at the end of a string value must be preceded by another backslash if it is 
followed by a closing brace character:
key={\value\}
WRONG!
key={\value\\}
CORRECT!

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