ExecutePDF Method
Use the ExecutePDF method to get the PDF version of the generated forms, instead of returning an HTML. PDFs can be prefilled with client data in the same fashion as HTML forms (using AddFieldToForm, LoadXML, etc.). The output of the method is an object of class PrintedPDF, whose properties are described below, or null on error.
Property | Type | Description |
---|---|---|
DealerName | String | The dealer name of the generated form. If generating a bundle of forms, the first dealer is returned. |
FileName | String | The UNID of the form. |
FormShortName | String | The form name. If generating a bundle of forms, the first form name is returned. |
ID | String | It is an auto-incremental ID for printed forms. Since this method returns a bundle of forms in PDF version, the ID is always 1. |
Byte Array | The PDF itself. |
Notes
- On error, you can see the message in the Results property of the QuikFormsEngine instance (objQFE.Results)
- If the OutputPath property is set, the PDF will be written in disk, with the file name specified in OutputFileName property. A default value of "QuikForms.pdf" will be set if no value is present on said property. The extension '.pdf' is not needed in the property value.Â
- For a fast look at the output PDF, copy and paste the returned PDF string into this free online converter
Sample Code
SOAP
Sample Code
<?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Header> <AuthenticationHeader xmlns="https://websvcs.quikforms.com/quikformsenginews/"> <CustomerID>CUSTOMER ID</CustomerID> <UserName>USERNAME</UserName> <Password>PASSWORD</Password> </AuthenticationHeader> </soap:Header> <soap:Body> <ExecutePDF xmlns="https://websvcs.quikforms.com/quikformsenginews/"> <PDFSettings> <QuikFormID>1</QuikFormID> <PrintEditablePDF>true</PrintEditablePDF> <LoadXML></LoadXML> </PDFSettings> </ExecutePDF> </soap:Body> </soap:Envelope>
Note: In the above request, the only mandatory tag in PDFSettings is QuikFormID.
VB.NET
Sample Code
Dim objQFE As New QuikFormsEngine.QuikFormsEngine 'Enter the credentials for your Quik! account objQFE.QuikCustID = 999999 'Your master account CustomerID objQFE.QuikUsername = "USER" 'Your master account username objQFE.QuikPassword = "PASS" 'Your master account password 'Configure settings to run the Quik! Forms Engine objQFE.ErrorLogPath = "c:\TempOutput\" 'Set the location for the error log objQFE.OutputPath = "c:\TempOutput\" 'If OutputTempFiles is TRUE, this value is ignored objQFE.OutputFileName = "myForm" 'name of the pdf file if writing to disk. 'Add the FormIDs to be generated objQFE.AddFormID(38002) objQFE.AddFormID(25525) objQFE.AddFormID(25524) 'Add data to the form - For the sake of the example, just one entry is shown. Â objQFE.AddFieldToForm(New FormField("1own.FName", "John")) 'GeneratePDF Dim printedPdf As PrintedPDF = objQFE.ExecutePDF() If printedPdf Is Nothing Then 'Error Dim err = objQFE.Results.Message Else 'Get the PDF Dim PDFBytes As Byte() = printedPdf.PDF End If
C#
Sample Code
QuikFormsEngine.QuikFormsEngine objQFE = new QuikFormsEngine.QuikFormsEngine(); //Enter the credentials for your Quik! account objQFE.QuikCustID = 999999; //Your master account CustomerID objQFE.QuikUsername = "USER"; //Your master account username objQFE.QuikPassword = "PASS"; //Your master account password //Configure settings to run the Quik! Forms Engine objQFE.ErrorLogPath = "c:\\TempOutput\\"; //Set the location for the error log objQFE.OutputPath = "c:\\TempOutput\\"; //If OutputTempFiles is TRUE, this value is ignored objQFE.OutputFileName = "myForm"; //name of the pdf file if writing to disk //Add the FormIDs to be generated objQFE.AddFormID(38002); objQFE.AddFormID(25525); objQFE.AddFormID(25524); //Add data to the form - For the sake of the example, just one entry is shown. objQFE.AddFieldToForm(new FormField("1own.FName", "John")); //GeneratePDF PrintedPDF printedPdf = objQFE.ExecutePDF(); if (printedPdf == null) { //Error dynamic err = objQFE.Results.Message; } else { //Get the PDF byte[] PDFBytes = printedPdf.PDF; }
Related pages
For help regarding Quik! Forms and the Quik! API
Email: support@quikforms.com | Phone: (877) 456-QUIK