WebIQ - Create PDF document with pdfmake

Community Moderator
Community Moderator

23 Jan 2023  Extend example project (Add watermark, use variables for PDF creation)
19 Jan 2023  Initial release


In WebIQ 2.13 there is no out of the box feature to create PDF files. However, since you can include JS libraries in WebIQ, you can use e.g. pdfmake JS library to create PDF content. Attached you find a:

  • WebIQ package with pdfmake library for easy usage in WebIQ
  • WebIQ example project for easy startup
  • WebIQ Designer version 2.13 or higher (WebIQ project is created with 2.13)
  • Basic knowledge of WebIQ Designer
  • JavaScript and JSON know how
  • Get familiar with the usage of pdfmake via documentation and videos
Features of pdfmake

pdfmake is a JS library, with a similar concept as HTML. Settings, content and styles are defined in a json object. The pdfmake interpretes the json object and creates a PDF from it. Feature list:

  • Under MIT license
  • Text (with line-wrapping)
  • Lists (numbered and bulleted)
  • Images
  • Vector graphics
  • Tables and columns
  • Page headers, footers(with page number/count) and automatick page breaks
  • Setting of PDF metadata (e.g. author, subject, ...)
  • Download, Print and Display PDF
Useful Links
Example project

The project includes 4 different PDF examples creating PDF with: Text, tables, lists, page setup and images.
For starting, do the following in WebIQ Designer:

  1. Import example project into WebIQ Designer
  2. Open the project for editing
  3. Open "Package Manager" to upload and install package-pdfmake-*.zip the project
  4. Start WebIQ project
  5. Select PDF output "Embedded"
  6. Press button "Basic" to display generated PDF with info to WebIQ project

Screen shoot of demo programScreen shoot of demo program

Update WebIQ package with a new version of pdfmake

See article: WebIQ - Communicate with ctrlX Rest API 

Must Read