DynaPDF Manual - Page 132

Previous Page 131   Index   Next Page 133

Function Reference
Page 132 of 839
Data types supported as value of a key are: array, dictionary, name, string, boolean true or false
(case sensitive), null, and number. A JSON string must be enclosed with double quotes. Example:
"This is a string".
In PDF, keys are always defined as name objects. The function converts a key (or name in JSON
nomenclatur) automatically to a name object. Values are never converted.
Example (C++):
The file test.json that is loaded in this example contains the contents below. This is basically a JSON
version of the PDF/VT example provided in the PDF/VT-2 reference (ISO 16612-2), plus a few
additional test key / value pairs.
Have a deeper look at "CIP4_TestArray1" and " CIP4_TestArray2". These key / value pairs contain
several syntax errors which a regular JSON parser would not accept.
{
"ACME_CustStatus": "Prospective"
"CIP4_Root" :
{
"CIP4_Summary" :
{
"CIP4_PageCount" : 6
"CIP4_Checked" true
}
"CIP4_Production" :
{
"CIP4_CopyCount" : 1
"CIP4_Part":
{
"CIP4_ProductType" : "Brochure"
}
}
"CIP4_Recipient" :
{
"CIP4_Contact" :
{
"CIP4_Address" :
{
"CIP4_City": "Phoenix"
"CIP4_CivicNumber": "96"
"CIP4_Country" :"USA"
"CIP4_PostalCode" :"81215"
"CIP4_Region" :"AZ"
"CIP4_StreetName" :"South Ave"
"CIP4_TestArray1" [1 2 3 4 true, false]
"CIP4_TestArray2"
{
"Array"[5 6 7 8 "Test1"/Test2]
}
}
"CIP4_Person" :
{
"CIP4_FirstName" : "Mary"
"CIP4_LastName" : "Smith"
}
}
"CIP4_UniqueID" : "ID_1"
}
}
}
 

Previous topic: How to create DPM?

Next topic: AddFieldToFormAction, AddFieldToHideAction