New PDF Builder (beta feature)

The new PDF Builder allows you to easily manipulate PDF documents in the application through the following features:

  • Supports importing data from a DataWindow object, a DataWindowChild object or a DataStore object to a PDF document and merging PDF documents. See example 1.

  • Supports importing an existing PDF document and data from a DataWindow object, a DataWindowChild object or a DataStore object to a new PDF document and merging PDF documents. See example 2.

  • Supports setting the properties and security permissions for a PDF document. See example 3.

To support the above features, the following new objects/properties/functions have been added:

  • PDFObject and PDFModel -- The ancestor objects of the other PDF objects.

  • PDFDocument -- The PDFDocument object allows to import data from a DataWindow object, a DataWindowChild object or a DataStore object, or an existing PDF document to a new PDF document and save the document.

    The properties that have been added to the PDFDocument object are as follows:

    • Properties -- Gets or sets the properties of the PDF document.

    • Security -- Gets or sets the security property of the PDF document.

    The functions that have been added to the PDFDocument object are as follows:

    • ImportDataWindow -- Imports data from a DataWindow object, a DataWindowChild object or a DataStore object to a PDF document.

    • ImportPDF -- Imports an existing PDF document to a new PDF document.

    • Save -- Saves the contents of a PDF document.

  • PDFDocumentProperties -- The PDFDocumentProperties object allows to get or set properties of the PDF document.

    The properties that have been added to the PDFDocumentProperties object are as follows:

    • Application -- Gets or sets the creator of the PDF document.

    • Author -- Gets or sets the author of the PDF document.

    • Keywords -- Gets or sets the keywords of the PDF document.

    • Subject -- Gets or sets the subject of the PDF document.

    • Title -- Gets or sets the title of the PDF document.

  • PDFSecurity -- The PDFSecurity object allows to get or set the security permissions of the PDF document.

    The properties that have been added to the PDFSecurity object are as follows:

    • MasterPassword -- Gets or sets the master password of the PDF document.

    • UserPassword -- Gets or sets the user password of the PDF document.

    • AllowAnnotations -- Whether creating or changing annotations or form fields is allowed.

    • AllowAssemble -- Whether inserting, deleting or rotating pages and creating bookmarks and thumbnails are allowed.

    • AllowCopy -- Whether copying text or graphics is allowed.

    • AllowForms -- Whether filling the form field is allowed.

    • AllowHighResolutionPrint -- Whether high-resolution printing is allowed.

    • AllowModify -- Whether modifying the file is allowed.

    • AllowPlainMetadata -- Whether keeping document metadata unencrypted even for encrypted documents is allowed.

    • AllowPrint -- Whether printing the file is allowed.

Example 1

The following scripts import pages from two DataWindow objects dw_1 and dw_2, and save the contents to a PDF document called datawindow.pdf:

PDFDocument lpdf_doc
long ll_return,ll_return1

lpdf_doc = Create PDFDocument

ll_return = lpdf_doc.importdatawindow( dw_1)
ll_return = lpdf_doc.importdatawindow( dw_2)

ll_return1 = lpdf_doc.save( "D:\datawindow.pdf")

destroy lpdf_doc

Example 2

The following scripts import pages from DataWindow object dw_1 and PDF document standard_none.pdf, and save the contents to a new PDF document called importpdf.pdf:

PDFDocument lpdf_doc
long ll_return,ll_return1

lpdf_doc = Create PDFDocument

ll_return = lpdf_doc.importdatawindow( dw_1)
ll_return = lpdf_doc.importpdf( "D:\standard_none.pdf")
ll_return1 = lpdf_doc.save( "D:\importpdf.pdf")

destroy lpdf_doc

Example 3

The following scripts set properties and security permissions for a PDF document:

PDFDocument lpdf_doc
long ll_return,ll_return1

lpdf_doc = Create PDFDocument

lpdf_doc.properties.title = "Test Title"
lpdf_doc.properties.author = "Test Author"
lpdf_doc.properties.subject = "Test Subject"
lpdf_doc.properties.keywords = "Test keywords"
lpdf_doc.properties.Application = "Test Application"

lpdf_doc.security.AllowPrint = false
lpdf_doc.security.AllowModify = false
lpdf_doc.security.AllowCopy = false
lpdf_doc.security.AllowAnnotations = true
lpdf_doc.security.AllowForms = true
lpdf_doc.security.AllowAssemble = false
lpdf_doc.security.AllowHighResolutionPrint = True
lpdf_doc.security.AllowPlainMetadata = true

dw_1.Modify ("DataWindow.Export.PDF.Method = NativePDF! ")
dw_1.modify("DataWindow.Export.PDF.NativePDF.PDFStandard =1")
ll_return = lpdf_doc.importdatawindow( dw_1)

//refers to compatible PDF/A input levels for various PDF/A output levels
ll_return = lpdf_doc.importpdf( "D:\standard_1a.pdf")
ll_return1 = lpdf_doc.save( "D:\save_1A.pdf",PDFA_1A!)

destroy lpdf_doc