how to printing/create pdf files from an asp.net page? [duplicate] - c#

This question already has an answer here:
Closed 10 years ago.
Possible Duplicate:
export to pdf in asp.net 3.5
What is a tools can I use to print asp.net pages ?
Is there any good software to create pdf files for asp.net?
is there any free software that takes care of this?

I like Expert PDF (http://www.html-to-pdf.net/). It converts regular HTML and CSS to a PDF format and opens in the associated reader on your local machine. Much easier than some of the other generators out there such as iText Sharp which require a lot of time learning the API. Unfortunately its a paid app, so if your company isn't willing to chip in for the license you might want to look at one of the free libraries.

SQL Server Reporting Services (SSRS) offers some good PDF generating functionality, though depending on your exact needs it may be too much. The best way to find out is to take a look at this page and see what you think: http://www.microsoft.com/sqlserver/en/us/solutions-technologies/business-intelligence/reporting-services.aspx
If you don't want to use the Report Viewer control, there is a blog post I've seen that details how you can avoid creating one: http://geekswithblogs.net/bsherwin/archive/2007/04/29/112094.aspx (It's in VB but could easily be converted to C#).

iTextsharp is widely used and of-course it is free.
Just download the DLL

Related

asp.net C# generate pdf files [duplicate]

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
Generate PDF file in asp.net
Whats is a good and easy-to-use library (Third party software) in order to create a fillable pdf file? Im using asp.net C# and basically I want to generate a fillable pdf file that I send it to other users so they can fill it?
Aspose for PDF .NET is a good one.
http://www.aspose.com/categories/.net-components/aspose.pdf-for-.net/default.aspx
iTextSharp is good too.
http://itextpdf.com/
Can't think of a good open source offering that is full featured however.
iTextSharp is a popular open source library to create PDF documents. It supports creating forms in PDF documents and filling them programmatically.
TallPDF.NET also is very good and feature-rich.
http://www.tallcomponents.com/default.aspx?id=tallpdf3-features

How to generate a PDF? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 12 months ago.
Improve this question
For my Microsoft Surface application I'd like to generate a PDF including some images. How should I start to do that?
EDIT:
I don't want to convert a text or html document, but I want to create a pdf from scratch.
PDFsharp is nice, free, relatively easy to use and compatible with WPF
Two basic options:
use a PDF specific library, like iText in #Kent's answer
install a PDF printer and use any reporting/printing code.
Option 1) will be the most flexible and efficient way.
Option 2) is interesting when you already have code that prints what you want. It is a bit of a hassle to manage the output-file etc. It's very easy to support XPS as well.
Docotic.Pdf library may be used to create PDF files from scratch and many other purposes.
Please take a look at samples for various PDF tasks.
The library has no external dependencies and is written in C#. There are several different license types available.
Disclaimer: I work for Bit Miracle.
For me the easiest way is to use Reporting Services.
http://www.microsoft.com/sqlserver/2008/en/us/reporting.aspx
You should also have a look at Fop/PdfBox for PDF creation/editing.
you need to use one of PDF generation libraries for C#. I tried to use iText , IronPDF and PDFFlow. All of them create PDF documents from scratch.
But PDFFlow was better for my needs, because it has easy fluent syntax and more functionality (I needed repeating headers, automatic page creation, automatic page numeration and multi-page spread table). They also have examples of business documents here: Examples, I haven't seen that much from other PDF generating libraries. There are also how-to-build articles for each sample, that helped me much.
This is how to create simple PDF file:
var DocumentBuilder.New()
.AddSection()
.AddParagraphToSection("Hello world!")
.AddImage("image.png").SetWidth(250)
.ToSection()
.AddLine(300, Color.Red)
.ToDocument()
.Build("Result.PDF");
Hope, this will help you to start.

Dynamic PDF generation from template [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I've a requirement to be able to generate PDF's within our (ASP.net) application. We need to meet the following requirements:
The text will be largely dynamic and must be added programatically.
Ideally we'd like to base these generated documents off PDF templates provided by our designers.
Some of the sections/pages may or may not be visible depending on certain conditions - ideally we'd like the content to 'flow' upwards to fill the space when something is removed.
Some of the pages may need to repeat, depending on certain conditions.
Some of the PDF templates will be out of our control (we're populating application forms supplied by third parties), so being able to read in a blank PDF and populate it would be good.
I've looked at iTextSharp and it seems to do most of these things (i.e. I can take a PDF, edit it to include form fields where we need to fill data and then use iTextSharp to read that in as a template and populate the data), however, I'm not sure how then to go about potentially hiding whole sections and/or repeating pages.
What I'm looking for here is a little advice from anybody who's been in a similar situation.
Small update here, we went with iTextSharp - it's a powerful tool, but does take a bit of learning, however it's quick, light, and does precisely what we want it to do.
However...
I would point out that the latest version is no longer really free (as in beer) - the license does not permit commercial usage. As a result, we now have a licensed version, but it's not shockingly cheap (and they don't publish a price list).
I would use iTextSharp. I create all kinds of PDF files based on different templates and iText has worked the best for me. It is a very powerful control and can manipulate pdf files in just about any way.
I'm not sure that iText can handle your third requirement. I know that it can create a pdf from a html file. Maybe use what Tomas posted and create the pdf with iText.
There are various commercial components to do this. Look at: PDFLib (http://www.pdflib.com/), Tall Components (http://www.tallcomponents.com/) etc
I have use products from Tall components and can recommend them.
Some others are a lot more expensive.
ITextSharp as you've mentioned is quite good and can be used to add/remove external pages, in this can you could hide full pages by ommiting them, or replacing them with placeholder pages. iText can use existing PDF files or create blank pages.
From my personal experience, I have just dropped in images and text onto existing pages and added pages generated by a reporting tool when tabular data is required.
HTH
Why need the template files in the pdf format? With the dynamic that you want it is a bad format for reporting template. Use a reporting software that also output as pdf. Your designers can create the templates very easy with a GUI. You will find many reporting solutions here on stackoverflow.
We've used http://www.dynamicpdf.com/, for projects like this and have been pleased with the outcome. They have a PDF WYSIWYG designer tool that you can use to build out the layout template of your PDF, along with the tool to merge the template with your data based on field to column mapping. This saves hours of hand coding each element of a given PDF. It supports page headers and footers and deals with the complexities of page breaks.
I would consider using creating HTML files from templates and turn them into PDF with Prince. Prince is very flexible and crating HTML files from templates is much easier then creating PDF files directly.

Converting PDF into workable text using C# [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
Is there a library that has a class to extract the text from a pdf file in c#.net? I've tried a few but documentation is terrible, so I haven't been able to get it off the ground. Also if it provides a class to extract images that would be a plus. Any suggestions? Thx in advance.
Also I need to be able to implement it into an existing application.
Have you tried PDFKit.NET? It has reasonable docs and some good examples. It is designed for a server environment, so it is a little expensive.
EDIT Here is an open source library on SourceForge called iTextSharp. It is free for open source projects. I haven't used it, but it looks promising. Here is a tutorial for it that has lots of code examples.
There are a couple of ways you can go here -- a lot of it will depend on whether you want to retain the formattting (i.e., paragraphs and other layout elements) of the original PDF.
If you're considering commercial solutions, we do offer two products that might meet your requirements. One is EasyPDF SDK which has single shot ExtractText() and ExtractText2() calls that pull text out of your PDFs as plain text.
Note that the output from these calls is pretty simplistic and you will lose a lot of the original layout elements. They're nice for simple text extraction but might not be great if your PDF contains tabular data.
If you're dealing with tables, a nicer alternative could be to pull it out as rich text instead. We a have a tool called EasyConverter SDK geared for business documents which does just that using a single function call.
With EasyConverter SDK, the layout of your original PDF will be retained.
Both support C# so feel free to check out the eval versions at www.pdfonline.com if you're interested. I do work for the vendor so do take this suggestion as kind of a mother loving her own child :-) I've been browsing stackoverflow.com for code snippets for a long time, but have only recently started posting, so if you have any questions with either API just let me know and I can help. Cheers!
Docotic.Pdf library can extract text and images from PDF files.
You can extract text from whole document of from some pages only. The library can extract plain text and also text chunks with coordinates.
You can extracted images from PDFs (as JPEG and TIFF files).
Here is a couple of samples for your task:
Extract text from PDFs
Extract images from a PDF
Disclaimer: I work for Bit Miracle, vendor of the library.
we've used snowbound software at work for image conversion. it apparently supports text extraction too. however, it's not free.

Best Server-side .NET PDF editing library [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
What's the best .NET PDF editing library available, and why?
It needs to be used on an IIS web-server.
Specifically, I need to edit a PDF which was generated by reporting services.
Factors I'm interested in:
Speed
Memory Consumption
Price
Quality of documentation
Library stability
Size of library
Whatever else you think is important
Have a look at iTextSharp. iTextSharp is a port of the iText , a free Java-Pdf library.
To quote iText:
You can use iText to:
Serve PDF to a browser
Generate dynamic documents from XML files or databases
Use PDF's many interactive features
Add bookmarks, page numbers, watermarks, etc.
Split, concatenate, and manipulate PDF pages
Automate filling out of PDF forms
Add digital signatures to a PDF file
And much more...
Syncfusion Essential PDF is the best. I have been using it for years. Also, Syncfusion provides a best support compared to other vendors.
I've researched quite a few tools that aren't offered specifically by Adobe, and the two that come to mind right away are Atalasoft's DotImage and LEADTools. They are both rather pricy, but provide server licensing and use the ultra-fast C++ GDI libraries.
There's a freeware .Net library called PDFSharp that uses .Net native GDI+, so it's slower and memory intensive. But then again, it's free.
webSupergoo have a super PDF library for .NET
Their ABCpdf product is designed for use with web servers. The documentation is clear and the installation is accompanied by an example website project.
If you visit their website you should see a link to the live demonstration:
http://www.websupergoo.com/abcpdf-1.htm
ABCpdf 7 is the current version. The performance and reliability is excellent. The standard version costs $329 USD, but sometimes an installation can be obtained for free. The download size is about 30 MB. Supports both 32 and 64-bit servers.
I've used http://www.tallcomponents.com/ mainly to fill in pdf forms and then flatten the pdf. Seems to work fine. I haven't had any issues.
I don't know if it's the best, but I use PDF-Writer.NET, for which I paid $89. I have used it in several production applications. I like it because it's easy to set up and use, and it doesn't require a lot of coding, which makes it easier for new developers to ramp up on it.
Before that I was hacking together PDFs using an open source library and the Acrobat interop DLLs. That was rough.
Not sure about the PDF part but Aspose has a library for PDF. I've used their word library for generating word documents. their documentation is very decent in my opinion.
http://www.aspose.com/categories/file-format-components/aspose.pdf-for-.net-and-java/default.aspx
Check out Aspose.Pdf for .NET. It has a nice API, is well documented and has a light footprint.

Categories