Blog

New website launched!

Published Oct 08 2024

There is a lot of drama in the industry right now surrounding the Wordpress content management system. Since we launched api2pdf.com, we've been hosting our Wordpress website on WPEngine. See more about this drama here. To be honest, we have not given it all that much thought....

Continue reading

Background color on header / footer in Headless Chrome

Published Jul 26 2023

Intro If you are generating PDF files from URLs or HTML with Headless Chrome and are trying to have a background color in the header or footer template of the resulting PDF file, you might be running into issues. This is even the case when you are using puppeteer on top of hea...

Continue reading

[resolved] 403 Forbidden error message in logs

Published Jun 08 2022

If you are seeing a 403 Forbidden error code in your logs when trying to make API calls with the any-to-pdf, merge pdf, password, bookmarks, extract-pages endpoints, this article will point you in the right direction. When you make one of these API calls by passing in a URL to...

Continue reading

Extract pages out of a PDF with REST API

Published Mar 12 2022

Introduction We are proud to announce a new feature with for our PdfSharp endpoints: Extract Pages. With this endpoint, you will be able to specify (optionally), a start and end of a page range of your PDF file and API2PDF will extract a new PDF with just that page range only....

Continue reading

Generate PDF from Cloudflare Worker with Headless Chrome

Published Jan 09 2022

Intro At the time of this post, Cloudflare Workers does not support the idea of embedding Headless Chrome or wkhtmltopdf in its environment. Workers also does not the idea of running docker containers either. This may change in the future, but for now, if you built an applicat...

Continue reading

Set ViewPortOptions on Chrome > Screenshot API

Published Dec 22 2021

We are proud to announce an enhancement to our /chrome/image endpoints which are quickly gaining popularity. You can now declare a custom ViewPort option. Prior to this, you were locked into a 1920 x 1080 viewport, which is the equivalent of a wide screen monitor. However, the...

Continue reading

[Resolved] PdfSharp – invalid entry in XRef table

Published Oct 10 2021

Intro If you found us through Google, welcome! Api2Pdf is a REST API that helps developers generate and interact with PDF files. Among our most popular endpoints is merging or combining PDFs together. To support the merging of PDF files, behind the scenes, our API uses the MIT...

Continue reading

omitBackground added to Chrome to PDF

Published Oct 10 2021

PuppeteerSharp version 5.1.0 has added support for omitBackground flag. This is a boolean option that will, if set to true, make your PDFs have a transparent background. We don’t actually know why people would need this, but it was a feature request from one of our ...

Continue reading

PHP – Generate thumbnail image of PDF or Office file

Published Jul 14 2021

Intro If you are writing php code, you might be tasked with generating an image preview or thumbnail image of a PDF or Microsoft Office file like Word, Powerpoint, Excel, or even email files. If you ended up on this article you probably have been doing research for hours and g...

Continue reading

Nodejs / Javascript Tutorial – Convert PDF to HTML

Published Jul 14 2021

Intro For those who are nodejs developers, you might have a niche requirement to convert a PDF into HTML, or extract text content from a PDF for indexing purposes. Here at API2PDF, we have a PDF to HTML endpoint that does a best effort to extract the text from a PDF and output...

Continue reading

Convert HTML to Docx with Nodejs / Javascript

Published Jul 14 2021

Intro If you are writing nodejs / javascript code, you might be tasked with generating a Microsoft Word (Docx) file. After some research, you discover that this is not as trivial as you hoped it would be. You might have ended up on stackoverflow seeing old, outdated libraries ...

Continue reading

C# / .NET Tutorial – Convert PDF to HTML

Published Jul 14 2021

Intro For those who are c# / .net core developers, you might have a niche requirement to convert a PDF into HTML, or extract text content from a PDF for indexing purposes. Here at API2PDF, we have a PDF to HTML endpoint that does a best effort to extract the text from a PDF an...

Continue reading

Add Passwords to PDFs with Python

Published Jul 14 2021

Intro API2PDF is a REST API that provides utilities for manipulating PDFs and other files. You landed here because you just want a simple and reliable way to add passwords to PDF files as a python developer. Our API will take your .pdf file and return back to you a new .pdf fi...

Continue reading

Add a Password to a PDF with .NET Core / C#

Published Jul 14 2021

Intro API2PDF is a REST API that provides utilities for manipulating PDFs and other files. You landed here because you just want a simple and reliable way to add passwords to PDF files as a c# / .net core developer. Our API will take your .pdf file and return back to you a new...

Continue reading

Convert HTML to Image with PHP

Published Jul 14 2021

Intro You might need to convert HTML to an image or HTML to png format for various reasons. Perhaps you are generating a snapshot or image preview of an HTML template you designed as part of your application. Maybe you are crawling websites and would like an image preview of a...

Continue reading

Convert HTML to Image with Node / Javascript

Published Jul 14 2021

Intro You might need to convert HTML to an image or HTML to png format for various reasons. Perhaps you are generating a snapshot or image preview of an HTML template you designed as part of your application. Maybe you are crawling websites and would like an image preview of a...

Continue reading

Node / Javascript – take a screenshot of a website

Published Jul 14 2021

Intro You might need to convert a URL to an image, URL to PNG, or automatically take a screenshot of a website for various reasons. Maybe you are crawling websites and would like an image preview of all of them for a database. In either case, if you’re a nodejs developer...

Continue reading

Convert HTML to Docx with PHP

Published Jul 14 2021

Intro If you are writing nodejs / javascript code, you might be tasked with generating a Microsoft Word (Docx) file. After some research, you discover that this is not as trivial as you hoped it would be. You might have ended up on stackoverflow seeing old, outdated libraries ...

Continue reading

Add a Password to a PDF with Nodejs / Javascript

Published Jul 14 2021

Intro API2PDF is a REST API that provides utilities for manipulating PDFs and other files. You landed here because you just want a simple and reliable way to add passwords to PDF files as a nodejs developer. Our API will take your .pdf file and return back to you a new .pdf fi...

Continue reading

PHP Tutorial – Convert PDF to HTML

Published Jul 14 2021

Intro For those who are php developers, you might have a niche requirement to convert a PDF into HTML, or extract text content from a PDF for indexing purposes. Here at API2PDF, we have a PDF to HTML endpoint that does a best effort to extract the text from a PDF and output an...

Continue reading

Add bookmarks to PDF with Nodejs / Javascript

Published Jul 14 2021

Intro If you are working with PDFs as a nodejs developer, you know the pain associated with working with them. In this post we will cover how to conveniently add bookmarks to a PDF using our REST API in just a few lines of code. Our API will take your .pdf file and return back...

Continue reading

PHP – take a screenshot of a website

Published Jul 14 2021

Intro You might need to convert a URL to an image, URL to PNG, or automatically take a screenshot of a website for various reasons. Maybe you are crawling websites and would like an image preview of all of them for a database. In either case, if you’re a php developer an...

Continue reading

Convert HTML to Docx with Python

Published Jul 14 2021

Intro If you are writing python code, you might be tasked with generating a Microsoft Word (Docx) file. After some research, you discover that this is not as trivial as you hoped it would be. You might have ended up on stackoverflow seeing old, outdated libraries or confusing ...

Continue reading

Convert HTML to Docx with C# / .NET Core

Published Jul 14 2021

Intro If you are writing c# / .net core code, you might be tasked with generating a Microsoft Word (Docx) file. After some research, you discover that this is not as trivial as you hoped it would be. You might have ended up on stackoverflow seeing old, outdated libraries or co...

Continue reading

Add Bookmarks to PDF with C# / .NET Core

Published Jul 14 2021

Intro If you are working with PDFs as a C# / .NET Core developer, you know the pain associated with working with them. In this post we will cover how to conveniently add bookmarks to a PDF using our REST API in just a few lines of code. Our API will take your .pdf file and ret...

Continue reading