Skip to content

beezwax/bzmb-htmltopdf

Repository files navigation

bzmb-htmltopdf

A bzBond-server microbond to create PDF from HTML code using puppeteer.

Installation

On a FileMaker server with bzBond-server installed run the following command:

/var/www/bzbond-server/bin/install-microbond.sh bzmb-htmltopdf https://github.com/beezwax/bzmb-htmltopdf

See the bzBond-server documentation for more details on installation.

Usage

The bzmb-htmltopdf microbond provides one route

bzmb-htmltopdf-convert

In a server-side FileMaker script run bzBondRelay script with parameters in the following format:

{
  "mode": "PERFORM_JAVASCRIPT",

  "route": "bzmb-htmltopdf-convert",

  "customMethod": "POST",

  "customBody": {

    // Required. The html to convert
    "html": "string",

    // Opitonal. PDF options, see https://pptr.dev/api/puppeteer.pdfoptions
    "options": "object"
  }
}

The base64 encoded PDF can be accessed via Get ( ScriptResult ): JSONGetElement ( Get ( ScriptResult ); "response.result" )

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published