CKEditor Save to PDF Plugin

September 4th, 2018 / by api2pdf /

Intro

CKEditor4 is a battle tested and widely used WYSIWYG html editor. In this post we will discuss how to use our open source plugin for saving the document to PDF.

Example Code + Demo

Feel free to check out our github page for detailed step by step documentation.

HTML Code

The above HTML code loads CKEditor over the CDN, it also uses rawgit to quickly generate a CDN link we can use for our plugin javascript.

Important Points

1 – You’ll notice most of the code is loaded via CDN, however we have a saveToPdfHandler property that needs to be set in CKEditor.replace

2 – Pick your Handler of Choice, we have sample code for PHP and for ASP.NET, let’s use our ASP.NET classic handler (ASHX) for simplicity

3 – Simply swap out YOURAPIKEY with one you can grab from the api2pdf portal

4 – Putting all of this together you get a result that looks like the demo below:




Thanks for visiting our site. If you are eager to start generating PDFs right away with just a few lines of code, grab your API key and check out our docs!

Tags: , , , , , ,

Comments are closed.