B4J Tutorial [XLUtils] Generate PDF reports


XLUtils v1.13 adds support for converting workbooks to PDF. This is a Windows only feature and it relies on Excel being installed on the computer.

Exporting to PDF is a matter of calling:
    Wait For (xl.PowerShellConvertToPdf(WorkbookFile, OutputPDF, SheetIndex, True)) Complete (Success As Boolean)
You can also set the print area with Sheet.PrintArea and the print scaling with Sheet.SetFitToPage.

The attached example is based on the template + chart example: https://www.b4x.com/android/forum/threads/xlutils-templates-and-charts.130373/#content
It creates a workbook and then converts it to a PDF document.


  • Project.zip
    20.6 KB · Views: 678
Last edited: