Saving as PDF using XSL-FO

If you want to save to PDF using XSL-FO, you must set one or more properties before saving.

In the DataWindow painter

In the DataWindow painter, you set PDF export properties on the Data Export page in the Properties view.

StepsTo save PDF output using XSL-FO in the DataWindow painter:

  1. Select the Data Export tab in the Properties view for the DataWindow object.

  2. Select PDF from the Format to Configure drop-down list and select XSLFOP! from the Method drop-down list.

  3. (Optional) If you want simultaneously to send the output directly to a printer using the Java printing option of the Apache FOP processor, select the Print Using XSLFOP check box.

    The sample is titled Properties - Data Window and shows the Data Export tab. PDF is shown selected in the Format to Configure drop down list and XSLF O P ! is shown selected from ithe Method drop down list. A check box for Distill Custom Post Script is cleared, and a check box for Print Using XSLF O P ! is checked.
  4. Save the DataWindow object, then select File>Save Rows As, select PDF as the Save As Type, specify a file name, and click Save.

    PowerBuilder saves the data in the DataWindow object to the file you specified. If you selected the Print Using XSLFOP check box, it also sends the PDF file to the default printer for your system.

In a script

In a script, set the Export.PDF.Method property to XSLFOP! before saving the DataWindow object as PDF using the SaveAs method with the SaveAsType PDF!. To send the PDF file directly to the default printer, set the Export.PDF.XSLFOP.Print property to 1 or Yes before saving:

int li_ret
dw_1.Modify("DataWindow.Export.PDF.Method = XSLFOP! ")
dw_1.Modify("DataWindow.Export.PDF.xslfop.print='1'")
li_ret = dw_1.SaveAs("printed.pdf", PDF!, true)