Microlink API:
Introducing Microlink PDF
January 8, 2020 ()
Six months ago we launched
Microlink screenshot
as part of our product iteration to offer browser capabilities ready to be used directly consuming our API.Today, we’re thrilled to announce Microlink PDF 🔥.
Microlink PDF is based on the same engineering principles as the rest of the functionality behind Microlink API: making it trivial to get something back from any URL.
Enabling the new pdf query parameter will add a
pdf
data field as part of the response payload:{ "pdf": { "size_pretty": "62.5 kB", "size": 62450, "type": "pdf", "url": "https://microlink.nyc3.digitaloceanspaces.com/wEjulsXuSQxZhZcm5BKmUoiyDcc_" } }
The PDF file created as output of the process is hosted on Microlink CDN and it can be combined with ttl to automatically refresh in the background, providing an updated PDF representation of the target URL.
Additionally, a set of new query parameters have been added for better PDF accommodation, such as scale, margin and media.
These query parameters are specially helpful when the target URL is not actually prepared to be properly exported as PDF.
Another thing worth mentioning is the ability to consume the PDF directly from HTML markup using embed mode:
<iframe frameborder='0' target='_parent' src='https://api.microlink.io/?url=https://basecamp.com/shapeup/0.3-chapter-01&pdf&embed=pdf.url' ></iframe>
Also as a
button
<a href="https://api.microlink.io/?url=https://basecamp.com/shapeup/0.3-chapter-01&pdf&embed=pdf.url"> <button>Download File</button> </a>
This way, the PDF file will be created on the fly, making it a backendless solution: just HTML.
Join the community
All of these improvements or features are community driven: We listen to your feedback and act accordingly.
Whether you are are building a product and you need fancy previews, you’re an indie hacker or simply you like frontend stuff, come chat with us 🙂.