Resources
In this guide, we will look at how to add CSS, JavaScript and images to enhance the appearance and functionality of your generated PDFs. These resources can either be written inline or linked in your html, we have no parameters for adding them in your requests.
Inline Resources
Inline resources are directly embedded within the html documents your PDF will be generated from. These include inline CSS, JavaScript and base-64-encoded images. Inline resources guarantee optimal rendering and generated PDFs accurately represent the content.
Linked Resources
Linked resources are referenced in HTML documents using URLs. They allow for better management and ease of sharing resources. However, the URLs have to load on time to prevent request timing out on the server.
Resource Timeout
When using linked resources (CSS, JavaScript or images), it is important that resources load within a reasonable time to prevent your request from timing out on the server. Your resources must load within 10s
to repent request timeout.
Manage resource effectively either by adding them inline or ensuring they load on time to enhance the accuracy and efficiency of generated PDFs. Also, check for accuracy of link urls and reliability of hosting servers for your resources.