WordPress Plugin Code for Api2Pdf REST API
Api2Pdf.com is a REST API for instantly generating PDF documents from HTML, URLs, Microsoft Office Documents (Word, Excel, PPT), and images. The API also supports merge / concatenation of two or more PDFs. Api2Pdf is a wrapper for popular libraries such as wkhtmltopdf, Headless Chrome, and LibreOffice.
This plugin adds a Save to PDF functionality to WordPress. It will take the HTML contents of your page, convert it to PDF, and request the web browser to download it.
This section describes how to install the plugin and get it working.
- Upload the plugin files to the
/wp-content/plugins/savePageToPdfdirectory, or install the plugin through the WordPress plugins screen directly.
- Activate the plugin through the ‘Plugins’ screen in WordPress
- Use the Settings->PDF Settings to configure the plugin
- You will need a valid Api2Pdf.com API Key. You can create a key here: api2pdf.com
- How do I include a link or button to generate a PDF?
You can use the shortcode [savepagetopdf], this will generate a link that will generate a PDF of the current page. You can style this link by modifying the CSS class *savePageToPdf***
- What if I wish to include PDF Generation via my Theme, for example via a header widget?
You can set the onclick event of any HTML elevent, for example Make me a PDF
Contributors & Developers
“Save Page to PDF” is open source software. The following people have contributed to this plugin.Contributors
- Fix naming convention