Skip to main content

Convert HTML to PDF

With this function you can convert your HTML templates to PDF documents.

Input parameters

SectionParametersUsageMandatory
Document PropertiesDocument TitleIt defines the title of the documentNo
AuthorIt defines the author of the documentNo
SubjectIt defines the subject of the documentNo
keywordsIt defines the keywords of the document.No
DPIChange the DPI explicitly, by default it will be set up to 96.No
GrayscaleWe can decide if we want to generate the PDF in gray scale or leave it as it is in the HTML content provided.No
EncodingSet the default text encoding. By default is it set up to UTF-8. For instance, you can use: UTF-8, ISO-8859-1, GB2312, Windows-1251, etc.No
Margin Top PageTo set the margin top value of the page. By default it is 10mm.No
Margin Left PageTo set the margin left value of the page. By default it is 10mm.No
Margin Right PageTo set the margin right value of the page. By default it is 10mm.No
Margin Bottom PageTo set the margin bottom value of the page. By default it is 10mm.No
Page ConfigurationPage OrientationWe can define the page orientation with a single character P | Portrait | Landscape | L: P=Portrait or L=Landscape This field will be required to be filled when creating the flow.Yes
Page FormatWe can set the page format as A4 / A5 / LETTER / width x height (100×200, etc). By default the format page selected is A4. This field will be required to be filled when creating the flow.Yes
Do you want to set a custom page size? *Set a custom paper size.No
Page ZoomThis is the zoom to use. By default will be applied zoom factor 1.No
Page OffsetSet the starting page number. By default this value is set to 0. What it means that it will start from the first page.No
Do you want to disable external links?If we select ‘Yes’ in this option we are making links included in the HTML content to be disabled. Otherwise, in the PDF generated links will continue be clickable.No
Do you want to set the viewport size? *Set viewport size if we have custom scrollbars or CSS attribute overflow to emulate window size.No
Headers & Footers ConfigurationHeader Text CenterCentered header text.No
Header Font NameSet header font name. By default it be used Arial.No
Header Font SizeSet header font size. By default the font size is 12 pixels.No
Header Align LeftLeft aligned header text.No
Header Align RightRight aligned header text.No
Header SpacingSpacing between header and content in mm. By default is not applied any spacing (value equal to 0).No
Do you want to display line below the header?It displays a line below the header.No
Footer Text CenterCentered footer text.No
Footer Font NameSet footer font name. By default it be used Arial.No
Footer Font SizeSet footer font size. By default the font size is 12 pixels.No
Footer Align LeftLeft aligned footer text.No
Footer Align RightRight aligned footer text.No
Footer SpacingIt is the spacing between the footer and the content in mm. By default is not applied any spacing (value equal to 0).No
Do you want to display line above the footer?It displays a line above the footer if we select ‘Yes’ value.No
Output ConfigurationPDF nameThis is the filename we want to give to it including the extension file. i.e: invoice.pdfNo
  • This parameter Do you want to set a custom page size? has to possible values, “Yes” and “No”. In case of selecting “Yes”, a new section will appear with two parameters:
SectionParametersUsageMandatory
Custom Page Size configurationPage WidthThis is the page width in mm/cm. For instance: 88mmNo
Page HeightThis is the page height in mm/cm. For instance: 56mmNo
  • This parameter Do you want to set the viewport size? has to possible values, “Yes” and “No”. In case of selecting “Yes”, a new section will appear with one parameter:
SectionParametersUsage
ViewViewport sizeSet viewport size if you have custom scrollbars or CSS attribute overflow to emulate window size. For instance: 1280×1024

Response parameters

ParameterContent
htmlThis is the HTML template provided in base64 encoding.
pdf_outputThis is the PDF generated based on the HTML template provided in base64 encoding.
encodingIf it was set a default text encoding.
file_nameThis is the PDF’s name generated.
errorsAn error message if exists.