Generate a PDF via an API

For an adaptive application, you can generate a PDF without a script. Set a connector as the PDF interface, then link the template through the application’s Print button. See Configure print to PDF. The API method below applies when you build the call yourself.

The following video demonstrates the process of calling an API from the App Designer, which generates a PDF.

Note: Using a JSON content type for the API call from the App Designer to the PDF API is advisable. Otherwise, there’s a risk of encountering a "500 error - too many parameters."

Ajax snippet for the post-operation
let PDFData; // Add here the object with your data.
             // The keys here can be the keys you have defined in
             // the PDF Designer > Settings > Interface

$.ajax({
    type: "POST",
    url: "/pdf/{name-of-pdf}"
    data: PDFData,
    success: function(data) {
        // add your success logic here
    },
    error: function(result,status) {
        // add your error logic here
    },

});