1

I have a website with the following structure: Tab Container - having 4 Tab panels Each tab panels is having 4 gridviews which are separated by line break.

Now when i am in a particular tab, I want to use an 'export to pdf' button , which should generate a pdf having 4 gridviews visible in this tabpanel. Same for all other tabpanels.

I have searched enough, found may articles telling about using itextsharp, wkhtmltopdf, pdf generators etc, however I dont seems to find fully implemented functionality anywhere.

Can anyone guide/suggest anything ?

Thomas
  • 5,603
  • 5
  • 32
  • 48
hitesh.gawhade
  • 337
  • 3
  • 6
  • 21
  • 1
    possible duplicate of [Convert HTML to PDF in .NET](http://stackoverflow.com/questions/564650/convert-html-to-pdf-in-net) – Brad Dec 03 '12 at 18:17
  • @yms : thnx for reminding, i have updated the status now. – hitesh.gawhade Dec 04 '12 at 06:19
  • 1
    If you need to generate on the fly pdf documents, check [this](http://www.dotnetfunda.com/articles/article977-pdf-generator-in-net--dynamically-generate-pdf-in-aspnet-.aspx) example. It worked out great for me. – BrOSs Dec 03 '12 at 18:34
  • Possible duplicate of [Convert HTML to PDF in .NET](http://stackoverflow.com/questions/564650/convert-html-to-pdf-in-net) – Thomas Jan 11 '17 at 11:56

4 Answers4

2

I always use wkhtmltopdf to convert a html page to pdf. (you will need server access to install it though)

It works very well, looks the same as the web site and saves text as actual text (in vectors).

Horen
  • 11,184
  • 11
  • 71
  • 113
2

I've used CutePDF's API and they seem to work pretty well.

http://www.cutepdf.com/Solutions/

tcables
  • 1,231
  • 5
  • 16
  • 36
1

You can do this in two ways, either handle it on your server or use a third party service.

If you want to convert a html page to a PDF on your server, you can use wkhtmltopdf (A simple shell utility to convert html to pdf using the webkit rendering engine, and qt.) I haven't used it with .NET however have seen many examples.

If you like to use a third-party service www.impdf.com could be used, It's a free service. You do not need to register even. I once have used it but not for a long time( I later switched to wkhtmltopdf get some performance gain).

It depends on your requirements which method you must use. In any case if using impdf is enough for you,

<a href="impdf.com?url=http://www.yourwebsite.com">Convert this page to a PDF</a>

A4 page: impdf.com?url=http://www.yourwebsite.com&--page-size=A4

Letter page: impdf.com?url=http://www.yourwebsite.com&--page-size=Letter

Milindu Sanoj Kumarage
  • 2,714
  • 2
  • 31
  • 54
1

Adobe ColdFusion has a tag called <CFPDF> built in.

http://help.adobe.com/en_US/ColdFusion/10.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7995.html

Furthermore it has web services which which can bridge the gap to ASP.Net

James A Mohler
  • 11,060
  • 15
  • 46
  • 72