Top
Top
LibraryEASYProcess Reference Manual 5ProcessesServicesPDFWorkshopHtmlStringToPDFFile

HtmlStringToPDFFile Overview

The service “HtmlStringToPDFFile” is used to generate a PDF file using HTML. The main advantage of using this service is that we can use “GetHTMLString” service from WebPart Workshop to convert WebPart into HTML string, and then generate the webpart in PDF format. The PDF generated is saved to the file path specified in the "PDFFile" input. This input contains both the file path and file name

This service also offers useful features such as header line, footer line, header html , footer html, etc. We can also adjust the height, width and choose the orientation of the PDF file that we would like to generate.


HtmlStringToPDFFile Use Examples
Workshop:PDFWorkshop
Service:HtmlStringToPDFFile
Inputs
HtmlString"HtmlString" is the HTML that we would like to convert into PDF file.

PDFFile"PDFFile" is the absolute path and filename of the PDF file to be saved. Note: .pdf extension should be included after the filename.

TopMargin"TopMargin" is the top margin in pixels for the PDF file we are going to generate.

BottomMargin"BottomMargin" is the bottom margin in pixels for the PDF file we are going to generate.

LeftMargin"LeftMargin" is the left margin in pixels for the PDF file we are going to generate.

RightMargin"RightMargin" is the right margin in pixels for the PDF file we are going to generate.

PageWidth"PageWidth" is the width for the PDF file we are going to generate.

PageHeight"PageHeight" is the height for the PDF file we are going to generate.

ShowHeader"ShowHeader" takes Yes or No as input and determines whether to show header or not.

HeaderHtmlStringIf the input "ShowHeader" is set to Yes, we can pass HTML string through this input to render HTML as header.

HeaderTextIf the input "ShowHeader" is set to Yes, this text will be displayed on each page.

HeaderHeight"HeaderHeight" is the height of the header in pixels.

DrawHeaderLine"DrawHeaderLine" takes Yes/No value. If you decide to show header this will draw a dividing line between the header and the body of the file.

ShowFooter"ShowFooter" takes Yes/No value to determine if each page in the file should display footer information.

FooterHtmlStringIf the input "ShowFooter" is set to Yes, we can pass HTML string through this input to render HTML as footer.

FooterTextIf the input "ShowFooter" is set to Yes, this text will be displayed on each page.

FooterHeight"FooterHeight" is the height of the footer in pixels.

DrawFooterLine"DrawFooterLine" takes Yes/No value. If you decide to show header this will draw a dividing line between the footer and the body of the file.

ShowPageNumber"ShowPageNumber" takes Yes/No value to determine if page number should be displayed at the bottom of each page in the file.

CoverHtmlString

PageNumberText"PageNumberText" is the text defining page numbers.

PrependPDFFileArray

AppendPDFFileArray

EnableBookmark

BookmarkTags

BookmarkClassFilter

PageOrientation

SiteUrl

Outputs
FileConvertedThe output node "FileConverted" displays True/False to show if file was converted.
FileSize"FileSize" is the size in bytes of created file.
PDFFile"PDFFile" is the file name of the created PDF file.

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.

Add HtmlString

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.

Output

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.


Powered by EASYProcess (© 2019 K-Rise Systems, Inc).