Navigation: DocScript Reference > DocScript Functions >

Adobe PDF Documents Functions

 

 

 

 

Function

Description

[PDF.ConvertFromPS](filename)

Converts PostScript to PDF and is primarily used with the Virtual Print

Driver as all documents are sent as a PostScript file.

 

Parameter(s)

filename - This would typically be the filename of the current document

[PDF.ConvertFromTIF](filename)

Converts TIF image files to PDF.

 

Parameter(s)

filename - Creates a PDF file with the same name as the filename passed in.

[PDF.ConvertFromTIF](filename, newfilename)

Converts TIF image files to PDF.

 

Parameter(s)

filename - Creates a PDF file with the newfilename passed in.

[PDF.ConvertToTIF](filename, multipage, compression)

Converts a PDF document to a TIFF image. Allows selection for a single or multi-page TIFF and compression.

 

Parameter(s)

filename - Typically this would be the filename of the current document {fdocname}.

multipage - Either true (single-page) or false multi-page.

compression - Details the compression method for the target TIF file:

o1 - No compression

o2 - CCITTRLE

o3 - CCITTFAX3

o4 - CCITTFAX4

o5 - LZW

o7 - JPEG

oPACKBITS- 32773

[PDF.ConvertToTIFEX](filename, outputfilename, username, password, xres, yres, bitcount, compression, quality, multipage, firstpage, lastpage)

Provides an advanced platform for PDF to TIFF conversion.

 

Parameter(s)

filename - Typically this would be the filename of the current document {fdocname}.

outputfilename - TIF output filename.

username - The username if the PDF is protected.

password - The password if the PDF is protected.

xres - Horizontal output resolution of the TIF in DPI.

yres - Vertical output resolution of the TIF in DPI.

bitcount - Color bit depth of TIF file. 0 is black and white.

compression - Compression type of TIF file:

o1 - No compression

o2 - CCITTRLE

o3 - CCITTFAX3

o4 - CCITTFAX4

o5 - LZW

o7 - JPEG

oPACKBITS- 32773

quality - Quality of compression 0-100. (100% is no compression)

grayscale - 1 for grayscale, 0 for color

multipage - 1 for multi-page TIF, 0 for single page

firstpage - Start page in PDF file to export to TIF. '1-' implies to export from the start of the document.

lastpage - Last page in PDF to export to.'-1' implies export to the end of the document.

[PDF.TextToPDF](text, filename)

Converts the text passed in to a file.

 

Parameter(s)

text - The text to be converted to PDF.

filename - The name of the resulting PDF file.

[PDF.TextFileToPDF](filename)

Converts the text file to PDF.

 

Parameter(s)

textfilename - Converts this text file to a PDF file of the same name.

[PDF.TextFileToPDF](filename, newfilename)

Converts the text file passed in with textfilename to a PDF file called newfilename.

 

Parameter(s)

textfilename - The name of the text file to be converted.

newfilename - The name of the resulting PDF file.

[PDF.Split](filename, output folder name)

This is used in conjunction with docpages. The pages are split into separate files into the output folder name with the original filename appended with _<page no> (e.g. _1, _2 _3…._n).

 

Parameter(s)

filename - Typically this would be the filename of the current document {fdocname}.

output folder name - A path for the target PDF file.

[PDF.Split](filename, output file name, pages)

This is used in conjunction with docpages. The pages variable allows a specific page range to be extracted from the original documents and split into page files.

 

Parameter(s)

filename - Typically this would be the filename of the current document {fdocname}.

output folder name - A path for the target PDF file.

pages - The range of pages to split.

o2- : Will extract page 2 on wards.

o-2 : Will extract everything up to page 2.

o1-10 : Will extract pages 1 to 10.

o2 : Extracts page 2.

[PDF.Split](filename)

This is used in conjunction with docpages. The pages are split into the same folder with the original filename appended with _<page no> (e.g. _1, _2 _3…._n).

 

Parameter(s)

filename - Typically this would be the filename of the current document {fdocname}.

[PDF.Combine](destination filename, filename1, filename2….filename n)

Combines PDF documents together. This function combines all the files specified to the file specified in filename.

 

Parameter(s)

filename - variable can also contain a page range within the PDF. In this instance the filename1 would become an array where the first position is the filename and the subsequent elements:

o2- : Will extract page 2 on wards

o-2 : Will extract everything up to page 2

o1-10 : Will extract pages 1 to 10

o2 : Extracts page 2

[PDF.NoOfPages](filename)

Returns the number of pages in the specified PDF filename.

 

Parameter(s)

filename - Typically this would be the filename of the current document {fdocname}

[PDF.GetText](filename, textmode, pages)

Retrieves the text from a PDF file.

 

Parameter(s)

filename - Typically this would be the filename of the current document {fdocname}.

textmode - The textmode defines how the pages are returned. The default is false which returns the text as a string. Setting the textmode to true returns the text in an array, an element for each page.

pages - The pages variable allows a specific page range to be referenced:

o2- : Will extract page 2 on wards.

o-2 : Will extract everything up to page 2.

o1-10 : Will extract pages 1 to 10.

o2 : Extracts page 2.

[PDF.SaveText](filename, textfilename, pages)

The performs a similar function to GetText, except all the text is saved to the specified textfilename. The textfilename and pages are optional. If not specified then the textfilename will be the original PDF filename with the extension replaced to .txt. The pages defaults to all pages.

 

Parameter(s)

filename - Typically this would be the filename of the current document {fdocname}.

pages - The pages variable allows a specific page range to be referenced:

o2- : Will extract page 2 on wards.

o-2 : Will extract everything up to page 2.

o1-10 : Will extract pages 1 to 10.

o2 : Extracts page 2.

[PDF.Repair](filename, destination filename)

This function repairs the structure of a PDF file.

 

Parameter(s)

filename - Typically this would be the filename of the current document {fdocname}.

destination filename - The destination filename of the repaired PDF file.

[PDF.Break](filename, arrayofpagestobreakon, includebreakpage)

Returns an array of pages that determine where the breaks are in the document.

 

Parameter(s)

filename - Typically this would be the filename of the current document {fdocname}.

arrayofpagestobreakon - An array that contain the page nos. to break the PDF file on.

includebreakpage - This indicates whether the break page will be kept. 1 indicates that the break page will be kept and 0 indicates the break page will be deleted.

[PDF.Remove](filename, pageparameter)

Removes the pages in the PDF specified in filename.

 

Parameter(s)

filename - Typically this would be the filename of the current document {fdocname}.

pageparameter - Can either be a single page or an array of pages. The function creates a new PDF with the pages removed and return the file name.

[PDF.Splice](filename, pageparameter)

Breaks up a PDF file specified in filename with the page range specified in pageparameter. Returns an array of new PDF filenames.

 

Parameter(s)

filename - Typically this would be the filename of the current document {fdocname}.

pageparameter - An array of pages.

o{pageparameter[0]} = 1

o{pageparameter[1]} = 4

o{pageparameter[2]} = 6

[PDF.Redact](pdf filename,regex)

This function performs a redaction on the PDF image for the text found in the supplied regex search expression. For example, if you set the regex search expression to be a credit card number format, the function will search and tag credit card numbers, calculate the position (x,y pixels) and then apply the redaction based on the coordinates returned. The PDF can be secured to the redaction and underlying text cannot be accessed.

 

Parameter(s)

pdf filename - Typically this would be the filename of the current document {fdocname}.

regex - A regex expression to search and identify the text to be redacted.

[PDF.AddText](pdf filename, text, position, color, renderpdf, fontsize, fontname, xoffset, yoffset)

This function adds a stamp to the PDF document.

 

Parameter(s)

pdf filename - Required. Typically this would be the filename of the current document {fdocname}.

text - Required. The text content of the stamp.

position - Required. Where to position the text:

Top Right = 1

Top Center = 2

Bottom Left = 3

Bottom Right = 4

Bottom Center = 5

Bottom Left Corner TO Top Left Corner (Center Aligned) = 6

Bottom Left Corner TO Top Left Corner (Top Aligned) = 7

Bottom Left Corner TO Top Left Corner (Bottom Aligned) = 8

Top Left Corner TO Bottom Left Corner (Center Aligned) = 9

Top Left Corner TO Bottom Left Corner (Top Aligned) = 10

Top Left Corner TO Bottom Left Corner (Bottom Aligned) = 11

Top Right Corner TO Bottom Right Corner (Center Aligned) = 12

Top Right Corner TO Bottom Right Corner (Top Aligned) = 13

Top Right Corner TO Bottom Right Corner (Bottom Aligned) = 14

Bottom Right Corner TO Top Right Corner (Center Aligned) = 15

Bottom Right Corner TO Top Right Corner (Top Aligned) = 16

Bottom Right Corner TO Top Right Corner (Bottom Aligned) = 17

Bottom Left Corner TO Top Right Corner = 18

Top Left Corner TO Bottom Right Corner = 19

color - Required. 0 is black otherwise white is used.

renderpdf - Optional. Default is false. If true will render to a TIFF file and then back to PDF to remove PDF attributes and produce a raw image.

fontsize - Optional. Default is 10.

fontname - Optional. Default is Times New Roman.

xoffset - Optional. Default is 0.1. Horizontal Inches offset from closest side.

yoffset - Optional. Default is 0.1. Vertical Inches off

 

 

 

 

Copyright © 2024 Portford Solutions Group, Inc.