MS Reporting Services: Using PDFRasterizer.NET and PdfKit.NET#

You can use Reporting Services ReportExecutionService web service to render a report as a Pdf but what then? You have a bunch of bytes with not much way to use them. You could use them in a web site by redirecting them to the output stream and if the user has a Pdf reader they can use it.  You could also save the bytes to disk then use Process.Start(<filename>) and again if the user has a Pdf reader it will open the pdf.

The same is true when you want to use Pdf bytes in code; a sdk is needed to work with them.  Thus enters PDFRasterizer.NET and PdfKit.NET from Tall Components.  I personally try and stay away form anything with "acrobat" in the name.  Using the PDFRasterizer.NET provided a very straight forward way of printing pdf’s with very little code.  I first tried rendering images from reporting services but decided to standardize on using Pdf’s since at some point our project had to have pdf’s why not have everything be pdf’s.  The refactored code from printing images to printing pdf’s using PDFRasteriser.NET removed many lines of code and was much cleaner.

I used PdfKit.NET to merge pdf documents.  Using reporting services many different reports were rendered then PdfKit.NET was used to merged all these pdf’s together.  Merging pdf’s was a cake walk using the PdfKit.NET API and I was ready to move onto something else.  I’m a strong believer in not reinventing the wheel, take the ten minutes to research the problem and most likely you will find someone has ran into the same problem and how they solved it, this is the case with finding Tall Components.

My one complaint with PDFRasterizer and PdfKit is they both have “Document” classes but they are not the same and they do not implement a common interface.  So the only way to go from PdfKit “Document” to a Rasterizer “Document” is to write it out to a stream and read it in to the other “Document”.  I do wish you could go from one document to another but I do understand why Tall Components made this separation because they wanted two separate products but at the very least they could of named the classes something different.  

Monday, October 02, 2006 3:06:51 AM (GMT Standard Time, UTC+00:00) #    Comments [0]  | 

 

Name
E-mail
Home page

Comment (HTML not allowed)  

Enter the code shown (prevents robots):

Live Comment Preview
All content © 2009, John Luif