• Get API Key
  • Service Status
  • Log in
Convert HTML to PDF Logo
  • Home
  • How to Convert HTML to PDF Online
  • Pricing
  • FAQ
  • Testimonials
  • Blog
  • Contact
    • Optional PDF Parameters (See here for image thumbnail parameters)

    • MarginLeft
       Value of left margin - default is 0
    • MarginRight
       Value of right margin - default is 0
    • MarginTop
       Value of top margin - default is 0
    • MarginBottom
       Value of bottom margin - default is 0
    • UseGrayscale
       true to generate PDF in grayscale, false or leave blank for full colour
    • NoBackground
       true to not print background.
    • UseLandscape
       true to rotate page to landscape, false or leave blank for portrait
    • EnableForms
       true to turn html form fields into pdf form fields
    • LowQuality
       true to reduce the quality, which may lower your network usage if quality is still satisfactory
    • ImageQuality
       override the default image quality percentage (94) and use your own
    • DisableShrinking
       true to disable the intelligent shrinking process we use make the pixel/dpi ratio constant
    • DisableJavascript
       true to disable running JS on page, otherwise javascript runs
    • JavascriptDelay
       Milliseconds to wait for JS to finish executing before converting the page.  Useful for ajax calls.
    • UsePrintStylesheet
       true to use the print media stylesheet, false or leave blank to use normal stylesheet
    • FooterSpacing
       Spacing between the header and the content in mm - default is 0
    • HeaderSpacing
       Spacing between the footer and the content in mm - default is 0
    • PageSize
       Default size is A4 but you can use Letter, A0, A2, A3, A5, Legal, etc.
    • PageWidth
       Page width - if you use this, you must also use PageWidth
    • PageHeight
       Page height - if you use this, you must also use PageHeight
    • ViewPort
       e.g. 800x600 - Set if you have custom scrollbars or css attribute overflow to emulate window size
    • Dpi
       Explicitly set the DPI, which is 300 by default.  Also see Zoom settings
    • Zoom
       Default zoom is 1.00  You can use any floating point number, e.g. 0.5, 0.75, 1.10, 2.55, 3...
    • Urls
       Allow converting multiple URLs seperated by space to print multiple urls. This can be used instead of the value parameter.
    • OutputFormat
       Must be either "pdf", "jpg", "png", "bmp" or "svg" if not supplied the default is PDF
    • FileName
       Optionally the name you want the file to be called when downloading or $unique$ for guid
    • Username
       For URL conversions, creates a secure basic authentication connection to your server
    • Password
       For URL conversions, creates a secure basic authentication connection to your server
    • Cookie
       Supply in format: NAME|||VALUE|||NAME|||VALUE (that's 2 cookies).  Often used for authentication.
    • TableOfContents
       true to turn on table of contents. The table of contents is generated based on the H tags in the input documents.
  • Headers and footers, including automatic page numbering can be done by either passing in a url to HeaderUrl/HeaderHtml or FooterUrl/FooterHtml, or passing in a small snippet of plain text to HeaderLeft, HeaderRight, FooterLeft or FooterRight. Note that if you want to use a header or footer, you must also use a margin parameter like MarginTop or MarginBottom to ensure there is space for the header or footer. Your Html should also start with <!DOCTYPE html> and include the <html> and <body> tags

    • HeaderHtml
       To use an html header on each page - a string starting with <!DOCTYPE html>
    • FooterHtml
       To use an html footer on each page - a string starting with <!DOCTYPE html>
    • HeaderUrl
       To use an html header on each page - a url starting with http containing the html
    • FooterUrl
       To use an html footer on each page - a url starting with http containing the html
    • HeaderLeft
       Top left header text (can use replacement tags below)
    • HeaderRight
       Top right header text (can use replacement tags below)
    • FooterLeft
       Bottom left footer (can use replacement tags below)
    • FooterRight
       Bottom right footer (can use replacement tags below)
    • FooterFontName
       Footer font names - Arial by default
    • HeaderFontName 
       Header font names - Arial by default
    • FooterFontSize
       The font sizes - 12 by default.  Use the the plain value (do not use px or pt)
    • HeaderFontSize
       The font sizes - 12 by default.  Use the the plain value (do not use px or pt)

    • The replacement tags in the following table can be used to set the page numbering. For example, using FooterRight with a value of 'Page [page] of [toPage]', and remembering to also use a margin per above, e.g. MarginBottom with a value of 20

    • [page]
       Tag replaced with number of the pages currently being printed
    • [frompage]
       Tag replaced with the number of the first page to be printedr
    • [topage]
       Tag replaced with the number of the last page to be printed
    • [section]
       Tag replaced with the name of the current section
    • Batch/Asynchronous Process

    • For PDF conversion taking more than 30 seconds or input/output files more than 6 Mb, you need to use the batch/asynchronous parameters. Examples: C#, PHP

    • Batch
      true to send it through batch process. API will return a PdfToken that you could use for your next api call.
    • PdfToken
      Token to retrieve the pdf file that was passed in batch process. You will get a PdfLink as a return.
    • Webhook
      Instead of polling if the pdf file is already ready, you can send a webhook url where we could post once the file is ready.
    • PdfDownloadExpirySeconds
      Number of seconds before the PdfLink expires. Default and minimum is 300 seconds, max is 900 seconds.
    • Creating Page Breaks

    • Font Advice

    • /* In css */
      
                              @font-face {
                              font-family: 'Jolly Lodger';
                              src: url(fonts.googleapis.com/css?family=Jolly+Lodger);
      }
      
                              p {
                              font-family: 'Jolly Lodger';
      }
      
                              /* In html */
      
                              <link href="fonts.googleapis.com/css?family=Jolly+Lodger" rel="stylesheet" type="text/css">
                              <style type="text/css">
                              p {
                              font-family: 'Jolly Lodger';
          }
                              </style>
      
  • Let us know if you need extra parameters or other API features

  • About Us
  • Privacy Policy
  • Terms of Use
  • Pricing
  • FAQ
  • Contact Us

© 2025 HTML 2 PDF Rocket