📔Best practices

The best practices to render a good & fast PDF.

Beautify your HTML before triggering the API

This would decrease your request time down, so eventually you could get the PDF file faster. Our servers will render faster with the optimized content as well.

Put CSS Styles in your HTML Content

To avoid any error occurring, you should your CSS Styles in the HTML Content, ideally:

html
    head
        style <== here
    body

Make sure your included files are accessible & fast to access

You can include remote URLs in your HTML Content, including images, fonts, etc.

Make sure to use CDN storage with a Good connection, otherwise, your PDF will be slow to render.

Popular CDN for fonts:

  • Google Fonts

  • CDNFonts

Popular CDN Storage for assets:

  • AWS S3

  • Google Cloud Storage

  • BunnyCDN (cheap & affordable)

  • Akamai (enterprise)

  • etc

Define your page's size

It is recommended to always send us your page's size (width & height) so that it can be printable on various papers.

Popular paper sizes:

  • Letter - 8.5 x 11 (default of RenderPDF.io)

  • Legal - 8.5 x 14

  • Tabloid - 11 x 17

  • Ledger - 17 x 11

  • A0 - 33.1 x 46.8

  • A1 - 23.4 x 33.1

  • A2 - 16.54 x 23.4

  • A3 - 11.7 x 16.54

  • A4 - 8.27 x 11.7

  • A5 - 5.83 x 8.27

  • A6 - 4.13 x 5.83

Last updated