June-07-11

New web part: Kentico connector for ABCpdf

Finally, you have all the content in your content management system. All product specifications in several languages and maybe even some reviews from online users. And now you want to get the information in a printer friendly format. And not only with a print style sheet, but in form of a professionally looking PDF.

Creating PDF files on-the-fly is without doubt not an easy task. There are almost no plug-n-play solutions out there, which is mostly due to the fact that the kind of information you want to convert into a PDF format can vary widely: plain text, formatted text, hyperlinks, images etc. And suddenly you are faced with pages: where would you break a paragraph when it doesn't fit on a page?

Despite these challenges, we want to fill this feature gap and be able to add at least some basic CMS-to-PDF functionalities to our web projects. While our first web part is still in beta version, we decided to share it here to collect some feedback from other developers.

The ABCpdf component

To make the development cycle a bit shorter we choose to use a PDF library that already does most of the work: ABCpdf .NET 8.0 from webSuperGoo is an .NET API that we found was easy enough to use, so we could concentrate on the integration with Kentico rather than building another PDF library.

However, take note that ABCpdf is NOT FREE. It is a commercial product and it does not ship with Kentico. There is however, a link program, that may help you to get a free license.

We do not include the ABCpdf in our web part, you will need to download a trial version here, if you want to test it.

supergoo.jpg

Structure of the web part

The first release of this web part will enable you to render information into a PDF from a XML file. In the documentation you will find detailed instrcutions on how to create this XML file from custom document types.

The setup has three basic steps

  1. To start with, you will need to create a PDF document with form fields. Upload this PDF somewhere into your media library. All dynamically created PDF files will be stored into the same directory.
  2. Configure the page that will generate the XML file. This step allows you to format the information. A good example would be some date/time information (example: 4/25/2011 14:48:34), that you would like to display in a different and localized form (example: June 2011).
  3. Configure the page that will generate the PDF files.

Once you call the page on which the web part is placed,all PDF will be automatically created. Depending on the number of PDFs to be created this can take a while....

PDF generator

The PDF generator creates one PDF for each selected document of a given document type and populates the form fields of the base PDF.

How to use the web part?

There are basically two methods for using the web part:

  1. Place the web part on a public facing page. This option will have the draw-back that every time you render the page, the PDF files will be regenerated. This option may be most useful for either an intranet solution with little traffic or for constantly changing content.
  2. Place the web part onto a hidden page and access the page after you have made changes to your content. All PDF files will be recreated, stored into the same directory with the same name. The PDF files are stored into the media library, which allows you to create static links. This method will provide better performance.

Next development phase

Before releasing the web part on the Kentico Marketplace we will focus on several improvements:

  • Create PDF on demand (user click)
  • The next version will also include the possibility to connect our PDF Generator to a BizForm. At the moment we envision the rendering one PDF per entry in a BizForm. You could then dynamically generate printer friendly versions of all kinds of online requests.
  • Handle larger HTML formatted text. As mentioned before, the real challenge with dynamic data is that you don't always know what to expect. We will try to find a solution to render the content of longer HTML formatted text areas. The challenges we are facing are text snippets that will generate an additional page, as well as rendering CSS classes or even inline images.

Feedback welcome

Any feedback is welcome. We have certainly our own agenda, but if ever a good feature request fits our schedule it may make it into the web part. And who knows, in the end, it may even make it into the Kentico release.

Download

At the moment you can download the beta version of this web part including a basic example here:

Also, don't forget to download a trial version of ABCpdf at the webSuperGoo here:

 

 

Comments
ralph
Great Brian. Let me know how it went. I tried to make the documentation as clear as possible, but I am aware that the setup of this web part is not that easy...

For the full release I will try to find the time to create a sample site.
08/06/2011 9:47:25 PM

Brian McKeiver
Great idea for a web part. Downloading it now to try it out.
08/06/2011 9:35:38 PM

Leave comment Subscribe



Is six = eight ? (true/false)