API Version 5

We have released a major new release on the HTML To PDF API. It is mostly backwards compatible.

New Features

  • privacy parameter: If you set privacy=true on your calls. This ensured that we will not store the resulting document or any immediate render for caching or future use. The captured document will be streamed directly to you and will be discarded.

    • Note that this parameter is not compatible with json=true as that requires us to save and host the resulting document.
  • cache_ttl parameter: The new API has caching disabled by default. We have removed the fresh parameter from the earlier versions. Not every call returns a fresh capture. If you wish to cache documents for repeated calls, please set cache_ttl to maximum number of seconds you wish to cache your resulting documents.

Improvements

The new API is faster and more reliable due to architectural changes. In order to minimize the call latency, we made several changes to our pipeline and you should see the results on your API calls.

Upgrade

In order to switch to the new version, you can simply change your API call url to https://restpack.io/api/html2pdf/v5/convert. If you do not need caching, there would be no more changes required.

Custom Filenames

We just added custom filenames support to the API. In order to save your files with a specified filename, you can now pass a filename=xx.png parameter. If you also set json=true, that will return a CDN path ending with your requested filename. Otherwise, we will add a content-disposition header to ensure that client browsers do download the file with the filename that you provide.

GDPR Compliance

We have updated our privacy policy to meet the new EU data protection regulation requirements. We have also created a legal agreement promising the protection of all personally identifiable information and sensitive information that we collect and store.

Privacy Policy

Data Processing Agreement

JPEG Rendering Optimizations

If you are requesting jpeg images you will now receive higher quality images without any noticable file size increase. This also reflects on capture performance so in order to decrease file sizes while maintaining quality, we suggest using jpeg instead on png.

Fixed Shutters Not Firing

We have a shutter feature that can be used to wait for an element to be visible. However it was not working as expected in rare situations, causing the entire capture job to fail.

This functionality has been fixed and you can reliably use shutter options in your API calls.

Delay Option Improvements

We have made several improvements to delay option and the order which we apply the delay.

Delay is now applied after all javascript / css injection jobs are completed and several jobs causing implicit delays (such as prescrolling page to render lazy assets) are merged together so their delays will not stack together.

Wait mode: dom

It is now possible to pass wait=dom parameter in order to wait for domready event before render. The default is wait=load which waits for window.onload event.

This way you can create faster captures and handle such sites where loading hangs or takes a lot of time.

Faster API Calls

We have deployed a new capturing architecture which improves our capturing performance 30% in average. These changes have been made available to all users without any modifications required on your side.

Stability Fixes

Based on our monitoring, we identified several browser crashes occuring during captures. These have been mostly visible in the latest weeks. All issues should be resolved as of now.

API Version 3

We have a new and exciting release of the Screenshot API with many improvements, a brand new rendering engine and new features.

In order to switch to the new version you will need to change your API url from v2 to v3, as in https://restpack.io/api/screenshot/v3/capture.

It is mostly backwards compatible so you should be able to switch without any issues.

Faster Rendering: The version 3 of screenshot API is around twice as fast compared to v2.

Better Engine: Our rendering engine now uses the latest Chromium releases, providing better standards compliance.

New Wait Modes: In previous versions the API would wait for the window load event before rendering the screenshot. Now you have an option to wait for network to become idle using wait=network parameter to ensure pages load completely even with a lot of async resources.

Shutter: If you need to control the precise moment of capture, you can use shutter=<css selector> parameter to wait for a DOM element before capture. Combined with js injection, you can control the render time as you wish.

Media Emulation: Now it’s possible to emulate print css media using emulate_media=print parameter if you wish to capture pages in printing mode.

Better Retina: While the previous version had a retina mode, it came with some caveats regarding to retina image loading, now retina=true parameter creates true retina images with device scale factor of 2.

More Metadata: Using the json=true parameter now returns details regarding to the page and server response, as well as the CDN url of the captured image as it always did.

Better Error Reporting: The new API is more transparent regarding to the errors caused by the remote server or on our end. You can work around errors more easily due to this granular error information.

Ability To Capture Error Pages: The previous API would only capture pages with status code of 200-299, now you can override this behavior using allow_failed=true parameter.

Show Previous Entries