57
activePDF Toolkit Professional Edition
aptkl4a 30405
Copyright 2005, activePDF, Inc. All Rights Reserved.
Page 142 of 553
SetCustomDocInfo (.NET only)
Description
SetCustomDocInfo enables you to set the PDF custom document information fields when merging or
copying a PDF document. Common fields used with the SetCustomDocInfo method are
DocVersion
,
URL
,
LogonID
and
Cookie Value
.
NOTE:
This method is intended for use in a .NET environment. Refer to the CustomDocInfo property if
you are implementing activePDF Toolkit an environment other than .NET.
Return type
None
Syntax
object.
SetCustomDocInfo
(ItemName) = value
The SetCustomDocInfo method has these parts:
Part
Value Type
Description
Object
An expression of the Toolkit object.
Value
String
The data to populate the PDF custom document information fields.
Remarks
If you want to access one of the standard fields, use the corresponding Toolkit property such as Author
or Title.
Example C#
string myPath = System.Windows.Forms.Application.StartupPath; APToolkitNET.Toolkit
TK = new APToolkitNET.Toolkit();
// Open the output PDF
TK.OpenOutputFile(myPath + @"\output.pdf");
// Open the input file to get FieldInfo from
TK.OpenInputFile(myPath + @"\input.pdf");
// Set a CustomDocInfo value
TK.SetCustomDocInfo("This is my test field", "This is my test value");
// Copy the input to the output
TK.CopyForm(0, 0);
// Close the output file
TK.CloseOutputFile();
// Use GetPDFInfo to open the output.pdf as an input field
// and retrieve the standard and custom document info
TK.GetPDFInfo(myPath + @"\output.pdf");
// Pop up the contents of our new custom field
MessageBox.Show(TK.GetCustomDocInfo("This is my test field"));
// Close the input file
TK.CloseInputFile();