Related Topics
PDF Class
This object represents a PDF document object.
Methods


Creates a reviewable PDF for a specified document. This is an overloaded method with the following possible declarations:
public static bool CreatePDFForDocument(bp BP, Document Document)
public static bool CreatePDFForDocument(bp BP, Document Document,
bool OnlyIfNeeded)
Parameters
BP: The BP Logix Object.
pDocument: The Document object to convert to PDF.
OnlyIfNeeded: Booloean flag to instruct the system to only create the conversion if needed, i.e., If there is already a web viewable object and you only want to convert documents without an existing PDF object.
Returns
Boolean: Returns false if the operation fails.
Example
var oDocument = Document.GetDocumentbyDID(bp, "DID");
CreatePDFForDocument(bp, oDocument);


Creates a PDF file from a specified document.
Parameters
BP: The BP Logix Object.
WordPath: String file path where the Word document is stored.
PDFPath: String file path where the new PDF will be stored.
Returns
Boolean: Returns false if the operation fails.
Example
CreatePDFFromDocument(bp, "C://File/Path/DocumentName.docx", "C://File/Path/DocumentName.pdf");


Creates a PDF file from a specified document.
Parameters
BP: The BP Logix Object.
Document: The Document object to convert to PDF.
PDFPath: String file path where the new PDF will be stored.
Returns
Boolean: Returns false if the operation fails.
Example
var oDocument = Document.GetDocumentbyDID(bp, "DID");
CreatePDFFromDocument(bp, oDocument, "C://File/Path/DocumentName.pdf");


Creates a PDF file from a specified Form.
Parameters
BP: The BP Logix Object.
FORMINSTID: The string ID of the Form instance.
PDFPath: String file path where the new PDF will be stored.
Returns
Boolean: Returns false if the operation fails.
Example
CreatePDFFromForm(bp, "FORMINSTID",
"C://File/Path/DocumentName.pdf");


Creates a PDF file from a specified image file. Valid Image formats include GIF, JPG, and PNG.
Parameters
BP: The BP Logix Object.
ImagePath: The string file path to the location of the image to convert.
PDFPath: String file path where the new PDF will be stored.
Returns
Boolean: Returns false if the operation fails.
Example
CreatePDFFromImage(bp, "C://File/Path/ImageName.png",
"C://File/Path/DocumentName.pdf");


Creates a PDF file from a Routing Slip for a specified process.
Parameters
BP: The BP Logix Object.
PROCINSTID: The string ID of the Process instance.
PDFPath: String file path where the new PDF will be stored.
Returns
Boolean: Returns false if the operation fails.
Example
CreatePDFFromRoutingSlip(bp, "FORMINSTID",
"C://File/Path/DocumentName.pdf");


Creates a PDF file from a given text string.
Parameters
BP: The BP Logix Object.
Text: The string to convert.
PDFPath: String file path where the new PDF will be stored.
Returns
Boolean: Returns false if the operation fails.
Example
// Create the string to convert
StringBuilder sb = new StringBuilder();
sb.Append("This is the string. ");
sb.Append("This string will be converted to PDF.");
// Convert the string to PDF
CreatePDFFromString(bp, sb.ToString(),
"C://File/Path/DocumentName.pdf");


Creates a PDF file from a specified text file.
Parameters
BP: The BP Logix Object.
TextPath: The string file path to the location of the text file to convert.
PDFPath: String file path where the new PDF will be stored.
Returns
Boolean: Returns false if the operation fails.
Example
CreatePDFFromTextFile(bp, "C://File/Path/textfile.txt",
"C://File/Path/DocumentName.pdf");


Creates a PDF file from a web page displayed at a specified URL.
Parameters
BP: The BP Logix Object.
TextPath: The string file path to the location of the text file to convert.
URL: String containing the fully qualified URL of a web page/document.
Returns
Boolean: Returns false if the operation fails.
Example
CreatePDFFromURL(bp, "http://www.domain.com/folder/page.htm",
"C://File/Path/DocumentName.pdf");


Retrieves all of the form fields from a PDF document.
Parameters
BP: The BP Logix Object.
PDFPath: The string file path to the location of the PDF file.
(out) pFormFieldNames: List object that will contain the returned PDF form fields.
Returns
Boolean: Returns false if the operation fails.
List: The List object containing all of the form fields in the PDF document.
Example
//The list to store the controls
List<string> myControls = new List<string>();
//Get the form fields to fill the list
GetFormFields(bp, "C://File/Path/DocumentName.pdf", myControls);


Merges multiple PDF files into a single PDF file. This is an overloaded method with the following possible declarations:
public static bool MergePDFs(bp BP, IEnumerable<string> InputPDFPaths,
string OutputPDFPath)
public static bool MergePDFs(bp BP, IEnumerable<string> InputPDFPaths,
string OutputPDFPath, bool DeleteInputs)
Parameters
BP: The BP Logix Object.
InputPDFPaths: The IEnumerable object, such as a List, that contains the file paths of the PDF files to merge.
OutputPDFPath: The file path for the location of the merged PDF.
DeleteInputs: Booloean flag to instruct the system to delete the original PDF files after they have been merged.
Returns
Boolean: Returns false if the operation fails.
Example
// The list to store the PDF locations
List<string> MyFiles = new List<string>();
MyFiles.Add("C://File/Path/Document1Name.pdf");
MyFiles.Add("C://File/Path/Document2Name.pdf");
// Merge the PDFs
MergePDFs(bp, MyFiles, "C://File/Path/MergedDocumentName.pdf");


Sets all of the form fields in a specified PDF document.
Parameters
BP: The BP Logix Object.
PDFPath: The string file path to the location of the PDF file.
FieldNameValues: Dictionary object that will contain field Name/Value pairs to fill out a PDF Form.
TemplatePDFPath: String file path of the Template PDF containing the form fields.
OutputPDFPath: String file path of the PDF output file containing the completed form after the values are entered.
Returns
Boolean: Returns false if the operation fails.
List: The List object containing all of the form fields in the PDF document.
Example
// The Dictionary to store the controls
Dictionary<string, string> myFields = new Dictionary<string, string>();
myFields.Add("Field1", "Value1");
myFields.Add("Field2", "Value2");
myFields.Add("Field3", "Value3");
// Create the filled PDF form from the template
SetFormFields(bp, myFields, "C://File/Path/Template.pdf",
"C://File/Path/Output.pdf");
Documentation Feedback and Questions
If you notice some way that this document can be improved, we're happy to hear your suggestions. Similarly, if you can't find an answer you're looking for, ask it via feedback. Simply click on the button below to provide us with your feedback or ask a question. Please remember, though, that not every issue can be addressed through documentation. So, if you have a specific technical issue with Process Director, please open a support ticket.