360Works PDF Plugin/Documentation

From 360Works Product Documentation Wiki
(Difference between revisions)
Jump to: navigation, search
m (Auto-upload documentation)
 
Line 1: Line 1:
 
=360Works PDF Plugin User Guide=
 
=360Works PDF Plugin User Guide=
 
Plugin for filling out form data in a PDF.
 
Plugin for filling out form data in a PDF.
 +
https://static.360works.com/plugins/PDF_Plugin/documentation.html#PDFMerge
 
<h3>Usage Summary / Quick Start</h3>
 
<h3>Usage Summary / Quick Start</h3>
 
Use PDFLoad to load a file.  This also returns a list of all fields, or "ERROR" if an error occurs.
 
Use PDFLoad to load a file.  This also returns a list of all fields, or "ERROR" if an error occurs.

Latest revision as of 20:59, 8 July 2019

Contents

[edit] 360Works PDF Plugin User Guide

Plugin for filling out form data in a PDF. https://static.360works.com/plugins/PDF_Plugin/documentation.html#PDFMerge

Usage Summary / Quick Start

Use PDFLoad to load a file. This also returns a list of all fields, or "ERROR" if an error occurs.

Use PDFLastError to check for any errors during loading of the PDF File


Use PDFGetFieldValue ( fieldName ) to query for existing field values


Use PDFSetFieldValue ( fieldName ; fieldValue ) to set values


Finally, use PDFSave ( path ) to save the PDF to the hard drive, applying any new PDF form values. Path is optional. This returns the path to the newly saved PDF.


[edit] 360Works Plugin Setup Guides

See Plugins_101 for Error reporting, installation, registration, and more.

[edit] Function Summary

  • PDFAddObject ( objectName { ; key1=value1 ; key2=value2 ; ... } ) —
  • PDFCreate ( { key1=value1 ; key2=value2 ; ... } ) — Create an empty PDF
  • PDFGetFieldValue ( field ) — Returns the value of a named field in the PDF form.
  • PDFLastError ( ) — Returns the last PDF-related error which occurred.
  • PDFLicenseInfo ( ) — Returns information about the license used.
  • PDFListFields ( sourcePDF ) — Returns a list of field names in the PDF.
  • PDFListValues ( sourcePDF ) — Returns a list of field values in the PDF.
  • PDFLoad ( pdfFile { key1=value1 ; key2=value2 ; ... } ) — Extracts all the form data from a PDF, returns a list of fields.
  • PDFPopulateForm ( sourcePDF ; keys ; values ) — Populates a PDF form with data.
  • PDFRegister ( licenseKey ; registeredTo ) — Registers the plugin.
  • PDFSave ( { path } ) — Creates a new PDF, using any form values set via the {@link #PDFSetFieldValue} function as data.
  • PDFSetErrorCapture ( errorCapture ) — Toggles error dialogs on or off.
  • PDFSetFieldValue ( field ; value ) — Set the value of a field in the PDF.
  • PDFSplice ( pdf ; pageNumbers { ; key1=value1 ; key2=value2 ; ...} ) — Extract some pages from a PDF document into a new PDF.
  • PDFVersion ( ) — Returns the version of the plugin which is installed.

[edit] Function Detail

[edit] PDFAddObject ( objectName { ; key1=value1 ; key2=value2 ; ... } )

Parameters:


[edit] PDFCreate ( { key1=value1 ; key2=value2 ; ... } )

Create an empty PDF

Parameters:

args
optional parameters

See also: PDFLoad
Returns: 1 on successful PDF creation, "ERROR" if there was an error

[edit] PDFGetFieldValue ( field )

Returns the value of a named field in the PDF form.

Parameters:

field
the name of a field in the form

See also: PDFSetFieldValue
Returns: the field value, or ERROR if there was no such field in the form.

[edit] PDFLastError ( )

Returns the last PDF-related error which occurred. This should be called any time that a plugin function returns "ERROR" to get a user-readable description of the error.

If there are data fields specified which don't match any field in the PDF, PDFLastError will return a list of fields which could not be set.

Returns: Error text, or "" if there was no error.

[edit] PDFLicenseInfo ( )

Returns information about the license used.

Returns: version and registered to info, or "ERROR" on failure.

[edit] PDFListFields ( sourcePDF )

Returns a list of field names in the PDF.

Parameters:

sourcePDF
the PDF

See also: PDFListFields
Returns: return-separated list of values in the PDF form, or "ERROR" if something goes wrong.

[edit] PDFListValues ( sourcePDF )

Returns a list of field values in the PDF.

Parameters:

sourcePDF
the PDF

See also: PDFListFields
Returns: return-separated list of values in the PDF form, or "ERROR" if something goes wrong.

[edit] PDFLoad ( pdfFile { key1=value1 ; key2=value2 ; ... } )

Extracts all the form data from a PDF, returns a list of fields.

Parameters:

pdfFile
PDF container or URL

See also: PDFCreate
Returns: return-separated list of all fields in the PDF

[edit] PDFPopulateForm ( sourcePDF ; keys ; values )

Populates a PDF form with data.

Error Handling

If there are data fields specified which don't match any field in the PDF, they will be logged as an error. Call PDFLastError to get a list of fields which could not be set.

If the source PDF cannot be read, or some other critical error occurs, "ERROR" is returned. Call PDFLastError for more info on this.

Parameters:

sourcePDF
the container/path/url where the PDF to fill out is located
keys
return-separated list of form field names to fill out
keys
return-separate list of form field values to enter into the form. There must be the same number of keys and values.

Returns: a newly created PDF with the data applied, or "ERROR" if the operation could not be completed.

[edit] PDFRegister ( licenseKey ; registeredTo )

Registers the plugin.

Parameters:

licenseKey
a valid license key
registeredTo
the company the plugin is registered to

Returns: 1 on success, or "ERROR" on failure.

[edit] PDFSave ( { path } )

Creates a new PDF, using any form values set via the PDFSetFieldValue function as data. If no path is specified, the PDF is written to a temporary file.

The default behavior of this function is to return a container

Parameters:

path
The full path of the file or directory where the new PDF is to be written.

Returns: a file path pointing to the location of the new PDF

[edit] PDFSetErrorCapture ( errorCapture )

Toggles error dialogs on or off. When something unexpected happens, the plug-in will pop up a dialog displaying the error message. This makes it easy to see what went wrong. However, in some cases, you (the developer) may prefer to show your own message to the user, or possibly not show a message at all. In that case, you can call PDFSetErrorCapture with a parameter of true. That will suppress the error dialog from appearing to the user.

Parameters:

errorCapture
set to true to suppress the default popups.


[edit] PDFSetFieldValue ( field ; value )

Set the value of a field in the PDF.

Parameters:

field
the name of a field in the PDF form
value
the value to assign to the field when the PDF is saved

See also: PDFSave
Returns: 1 if the field was successfully set, or ERROR if there was no such field in the form

[edit] PDFSplice ( pdf ; pageNumbers { ; key1=value1 ; key2=value2 ; ...} )

Extract some pages from a PDF document into a new PDF. Pass this function a source PDF and some page numbers to extract and use in the new PDF.

The pageNumbers parameter should be a comma-separated list of page numbers or page number ranges.

Optional Parameters

filename
The name given to the resulting PDF file
filepath
destination folder/path for the resulting file
ownerPassword
The password used to encrypt the PDF file

Set Variable [ $newPDF ; PDFSplice (
    myTable::myContainer ; // sourcePDF
    "1, 10, 20-30" ;  // pageNumbers
    "filename=SplicedResult.pdf" // optional filename parameter
) ]


Parameters:

sourcePDF
The original PDF
pageNumbers
The page numbers to take from the original PDF when assembling the new PDF.
args
optional parameters

Returns: newly created PDF which contains the specified pageNumbers from the sourcePDF.

[edit] PDFVersion ( )

Returns the version of the plugin which is installed.

Returns: version, or "ERROR" on failure.
Personal tools
Namespaces

Variants
Actions
Plug-in Products
Other Products
Navigation
Toolbox