BBjAPI::getBBjPDFForm

Description

In BBj 6.00 and higher, this method automatically obtains a BBjPrinter object and returns a BBjForm object that allows printing a document to a PDF file.

Syntax

Return Value Method
BBjForm getBBjPDFForm(string filename)
BBjForm getBBjPDFForm(string filename, boolean useImage)
BBjForm getBBjPDFForm(string filename, PrintRequestAttributeSet attributes)
BBjForm getBBjPDFForm(string filename, PrintRequestAttributeSet attributes, boolean useImage)

Parameters

Parameter Description
attributes Specifies the set of PrintRequestAttribute attributes to observe; allows the setting of the media size.
filename Specifies name of the newly created PDF file.
useImage Specifies that PDF document will be rendered using images.

Return Value

Returns a BBjForm object that "prints" to a PDF file (access to a printer is not available).

Remarks

This print method flushes the information to a file and therefore does not physically print it.

The basis.pdf.fontpath property set under "PDF Font Directory" in the "Server - Environment" Tab of Enterprise Manager determines the font BBj uses to render a PDF. To ensure that your PDF files will render with the same fonts as your printouts, set this directory and add any font used in your code.

By default, PDF margins are set to 0.25 inches all around, or to the values defined by the MediaPrintableArea, if specified. If the USE_PDF_MARGINS !COMPAT setting is set to FALSE in BBj 11.01 or higher (unlike most !COMPAT values, it defaults toTRUE), the PDF margins are set to 0 all around.

Example

rem 'Get a PDF BBjForm.

rem 'Obtain the instance to the BBjAPI object
myAPI! = BBjAPI()

rem 'Obtain an instance of a BBjForm object printing to a PDF document.
let myPDFForm! = myAPI!.getBBjPDFForm("form.pdf")
release

See Also

BBjAPI

See the BBj Object Diagram for an illustration of the relationship between BBj Objects.