HtmlStringToPDFFile Basic Use Example
In this example we are going to use multiple services to generate a PDF from webpart, send it as an attachment, and delete the generated PDF file.
This is where we can add the HTML to convert it into PDF. In this example we are using another service called “GetHTMLString” which takes a webpartID and converts it into HTML.
Add File Name
The input “PDFFile” is the absolute path and file name of the PDF file which we would to save. Notice that we are also including .pdf extension here.
In the output logs we have three nodes:
- FileConverted returns true or false indicating whether the file was converted to PDF or not.
- FileSize returns size of the file created in bytes.
- PDFFile returns the file path along with file name.