Blog
New website launched!
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 readingBackground color on header / footer in Headless Chrome
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
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 readingExtract pages out of a PDF with REST API
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 readingGenerate PDF from Cloudflare Worker with Headless Chrome
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 readingSet ViewPortOptions on Chrome > Screenshot API
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
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 readingomitBackground added to Chrome to PDF
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 readingPHP – Generate thumbnail image of PDF or Office file
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 readingNodejs / Javascript Tutorial – Convert PDF to HTML
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 readingConvert HTML to Docx with Nodejs / Javascript
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 readingC# / .NET Tutorial – Convert PDF to HTML
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 readingAdd Passwords to PDFs with Python
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 readingAdd a Password to a PDF with .NET Core / C#
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 readingConvert HTML to Image with PHP
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 readingConvert HTML to Image with Node / Javascript
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 readingNode / Javascript – take a screenshot of a website
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 readingConvert HTML to Docx with PHP
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 readingAdd a Password to a PDF with Nodejs / Javascript
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 readingPHP Tutorial – Convert PDF to HTML
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 readingAdd bookmarks to PDF with Nodejs / Javascript
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 readingPHP – take a screenshot of a website
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 readingConvert HTML to Docx with Python
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 readingConvert HTML to Docx with C# / .NET Core
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 readingAdd Bookmarks to PDF with C# / .NET Core
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