Document

Functions to edit and get informations from documents e.g. PDF, word

pdf extract form(PDF File, [regex])

Function that returns values from fields in a pdf form if present.

Parameters
Name Required Type Description

PDF File

Yes

File

PDF file to extract form from

regex

No

Text

Regular expression that allows to filter out fields of the PDF form. Default regex is: (page|section|#subform|subform|overflowpage|master|frontpage).*

Returns

Any

Examples
document.pdf extract form(pdf) => "Returns contents inside the form, if any"

document.pdf extract form(pdf, regex) => "Returns the filtered contents inside the form, if any"

pdf extract pages(PDF File, From Page, To Page)

Function that returns a PDF with only the page range given in the parameters.

Parameters
Name Required Type Description

PDF File

Yes

File

PDF file to extract form from

From Page

Yes

Number

First page to extract

To Page

Yes

Number

Last page to extract

Returns

File

Examples
document.pdf extract pages(pdf, 1, 1) => "Returns only the first page of the pdf as a new file"

document.pdf extract pages(pdf, 3) => "Returns pages from the third one until the end of the document"

pdf extract text(PDF File, [From Page], [To Page])

Function that returns the plain text of the pdf file as an array of text, one entry for each page

Parameters
Name Required Type Description

PDF File

Yes

File

PDF file to extract form from

From Page

No

Number

First page to extract

To Page

No

Number

Last page to extract

Returns

Collection of Text

Examples
document.pdf extract text(pdf) => "[\"Hello\", \"World\"]"

document.pdf extract text(pdf, 1, 3) => "[\"Hello\", \"World\", \"Trisotech\"]"

document.pdf extract text(pdf, 2) => "[\"World\", \"Trisotech\"]"

document.pdf extract text(pdf, 2, 2) => "[\"World\"]"

pdf fill form(Contents, PDF File)

Function that fills the content of a PDF form

Parameters
Name Required Type Description

Contents

Yes

Any

A set of key-value pairs where each key corresponds to the name of a field in the PDF form, and each value is the information you want to insert into that field. This is written as a FEEL context (e.g., { "firstName": "John", "age": 35 })

PDF File

Yes

File

PDF file to fill

Returns

File

Examples
document.pdf fill form(contents, pdf to fill) => "Returns the provided PDF filled with the provided contents"

pdf merge(First PDF File, Second PDF File)

Function that merge two pdf together.

Parameters
Name Required Type Description

First PDF File

Yes

File

First PDF File to merge

Second PDF File

Yes

File

Second PDF File to merge

Returns

File

Examples
document.pdf merge(pdf1, pdf2) => "Returns a resulting pdf with the pages from pdf2 appended to pdf1"

pdf meta info(PDF File)

Function that returns meta information from a PDF, such as number of pages, if it is digitally signed, protected and meta information.

Parameters
Name Required Type Description

PDF File

Yes

File

PDF file to extract information from

Returns

MetaInfo

Examples
document.pdf meta info(pdf) => "Returns a map of available information"

word extract text(Word File, [From Page], [To Page])

Function that returns the plain text of the word file as an array of text, one entry for each page. Please note that document has to be paginated to make from and to parameters effective.

Parameters
Name Required Type Description

Word File

Yes

File

Word file to extract form from

From Page

No

Number

First page to extract

To Page

No

Number

Last page to extract

Returns

Collection of Text

Examples
document.word extract text(word) => "[\"Hello\", \"World\"]"

document.word extract text(word, 1, 3) => "[\"Hello\", \"World\", \"Trisotech\"]"

document.word extract text(word, 2) => "[\"World\", \"Trisotech\"]"

document.word extract text(word, 2, 2) => "[\"World\"]"

Data Types

MetaInfo

Meta information about PDF file

Properties

Name Type Description

author

Text

Author (expressed as String)

can extract content

Boolean

Document’s content can be extracted (expressed as Boolean)

can fill in form

Boolean

Document’s form can be filled in (expressed as Boolean)

can modify

Boolean

Document can be modified (expressed as Boolean)

creation date

Text

Creation date (expressed as Date and time)

creator

Text

Creator (expressed as String)

is encrypted

Boolean

Document is encrypted (expressed as Boolean)

is signed

Boolean

Document is signed (expressed as Boolean)

modification date

Text

Title (expressed as Date and time)

pages count

Number

Number of pages (expressed as a Number)

producer

Text

Producer (expressed as String, e.g. Microsoft: Print To PDF)

title

Text

Title (expressed as String)