BBjAPI::getBBjPDFForm

Description

In BBj 6.0 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

Return Value

Method

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 to TRUE), 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.



______________________________________________________________________________________

Copyright BASIS International Ltd. BBj®, Visual PRO/5®, PRO/5®, and BBx® are registered trademarks.