Fill in PDF with fields [closed] - c#

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 9 years ago.
I have a few PDFs from various customers/vendors. My goal is that I am building a web app where a potential customer fills out a single form of data and then can generate all of the PDF's to print and sign.
The PDF's have fields in them that in adobe reader you can click and type in the data. However, this is sensitive financial data, and the PDF won't let you save to your desktop. There is actually a warning in adobe reader when you open the pdf and it prevents you from saving a completed form. I don't care about this feature. My users can save it if they want to take the risk if it becomes opened up when I generate the completed pdf myself.
The problem is that I need to generate these pdfs with my data injected into them without altering the style. I want to avoid manually building them, but I will if I have to. How can I generate the exact PDF format they gave me with the data filled in?

You could have a look at iTextSharp and the PdfStamper class - it allows you to load up an existing PDF, 'stamp' data into the fields and then flatten out the PDF which can be sent to the user:
http://sourceforge.net/projects/itextsharp/
Note that iTextSharp is paid for for commerical products - but there may well be other open sources librarires that can do this.

You may try Aspose.Pdf for .NET to achieve your goal. You can fill the form fields using this component. If you do not want to allow the users to edit this data once it is filled in the PDF, you may flatten the fields as well. This will not change the existing layout of your PDF. The API is very simple along with complete documentation and support.
Disclosure: I work as developer evangelist at Aspose.

Related

Need some information on Document Viewer in asp.net [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 10 years ago.
I m trying to prepare a document viewer in asp.net 4.0. My requirement for this viewer is that all users coming to my website will be able to view every document. uploaded by him on my web-server.
I want to know any third party free application/service/user-control i can use in my website and open all my documents (.doc, .docx, .xls, .xlsx, .ppt, .pptx, .pdf, .jpg, .gif, and other image formats.)
I found Adeptol Viewer, TX TextControl. but this are very costly, ranging $5000 and above. can i get any cheap control..
EDIT : Also i want to know, is it possible to create such custom control in .NET and use it for our future use. If possible please guide me how i can achieve this. It is fine I can use Client Scripting like jQuery. for this
Awaiting for the reply from any technical experts who is willing to help/ support my question.
There is open source document viewer named Okyanux File Manager supporting only the documents which browsers support such as .swf, .wmv, .jpg, .gif and other image formats. You can also add .pdf support with Ron Schuler's open source PDF Viewer. It converts pdf files to images for previewing. I think other file types are not easy. You can add word and excel support with Spire.XLS which costs 900$.
Found the best and free solution for document viewer for all types of documents including edit feature..
Google Docs viewer
Zoho viewer
I found Zoho more interesting than google as it provides fantastic features compared to google.. editing of any document (.ppt or .xls) is just like you are using Microsoft Office in your browser.
Fantastic functionality and perfect solution.

Converting from PDF to HTML [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.
Is there a .dll I can use which uses a PDF file as an input and HTML file as an output?
I want to convert from PDF to HTML. My colleague says that it's very difficult going step by step, getting text/font/image/margins/links etc. from PDF and then creating new HTML file with the same content. He says it's nearly impossible. So I was thinking - if there's some dll which I can use as a reference to do that?
Writing a program to do it is definitely not trivial. If you don't find any .NET Library to do this (I couldn't, at least not free), I would just download this and invoke it programmatically to get my html.
If you have the time to spare and/or PDFToHtml does not produce acceptable output for you, you could use iText to write the program yourself. It's a very mature free pdf library. I've used it in the past to manipulate PDFs (merge, create, etc).
UPDATE
As noted in the comment by Quandary, the PDFSharp library offers a more relaxed license (MIT) compared to the Commercial or AGPL license offered by iText. Keep this is mind when choosing your library. I have not used the PDFSharp library myself and I don't know how they compare in terms of functionality.
You can download this free tool: PDFToHTML
Then in your program just fork a new process and run the executable passing the PDF file. I just tested it now and it seems to work ok.
If you don't mind paying, Aspose offers a very good solution, this is what we use at my company.
http://www.aspose.com/categories/.net-components/aspose.pdf-for-.net/key-features.aspx

Converting Html to Word in .Net [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 10 years ago.
I need to create a word file from a HTML content (on a ASP.NET server application) but couldn't find a robust way of doing that. So decided to run a discussion here to see what are possible options of doing this.
Aspose has a .NET component for this but the price is so high so can not be a solution (due to budgeting issues).
We expect this conversion to preserve tables, images, hiding invisible elements, links, etc.
There is a similar discussion here but solutions provided are all around Office Interop which is not a recommended solution for server application.
Any idea? Basically how do components like Aspose work?
Has the hard work already been done? There seems to be a project on codeplex.
Blog post describing HTML to docx converter
Project on codeplex
I would suggest writing code using the OpenXml API, you can navigate the DOM and programmatically add elements to the word document. Its no simple task through since you are interpretting markup and attempting to convert it.
link for Open XML: http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=5124
It's probably worth checking out Microsoft's own XSLT Inference tool which can generate WordML from XML input.
If you are flexible with the source of the document itself being HTML/XHTML/XML this could easily get the job done.
http://msdn.microsoft.com/en-us/library/aa212886%28v=office.11%29.aspx
http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=3412
I've used it in the past to generate Word documents from within an ASP .NET app, which obtained its source XML data from SQL stored procedures.
The tool can be a bit temperamental, but with a little sanitisating of the XSLT that it generates it could just work.
If docx is appliable you can create a word document, save it as docx, reverse engineer the xml and create your own xml/docx. I did it with excel/xslx and it worked perfectly. To speed things up we created the XML as text and joined the strings (before our data - our data - after our data).
The RTF format is not a standard afaik but it is wide spread. Create an RTF document and return it as a word document. Word opens rtf without problem.
Create a HTML document and return it as a word document.
HTH

C# PDF Printing 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 10 years ago.
Are there any free libraries that would "print" to a PDF without actually having to install a PDF printer on the system. I want something that can be completely self contained in my application. The reason I say I want it to "print" is that I've tried and tried to find a solution for directly converting from HTML with CSS to PDF, but it does't seem very possible. So I want to use the System.Windows.Forms.WebBrowser control to render the page first and then output that rendering to PDF. I just don't want the user to be required to install a PDFPrinter.
PDFsharp
Does it have to be free? Last time I looked at ABCpdf it looked quite good, and claims to support css (here).
HTMLDOC should support css at some point, but last time I checked the css stuff was still in beta. And has been for "some time"; I've given up waiting... It isn't .NET, but you can use Process to invoke it.
http://www.html-to-pdf.net/ - This isn't free but its preety cheap and effective. I am using it now to convert HTML with CSS to PDF. Essentially we display the page to the user and then with a click of a button they can download a PDF of the page.
http://itextsharp.sourceforge.net/ is really excellent. You can see how to use it in the repository at stochfit.sourceforge.net
Another tool (not free): http://www.winnovative-software.com/

Digitally sign PDF files [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 9 years ago.
I have a digital certificate that identifies a user. I need to use it to Digitally sign pdf files.
Does anyone have an example that does not uses a third party component? I need to get this done but it would be nice to fully understand how things are done.
C# Examples please :)
The open source iTextSharp library will allow you to do this. Here's a post explaining how to digitally sign a pdf file. If you don't want to use a third party library then you can implement it yourself but it could be a tough task -> you can start by reading the pdf specification (8.6MB)
Proper PDF signing is a very sophisticated task. There exist a number of files that don't conform to the PDF specification (broken xrefs etc) and your code must handle all of them. Then various Acrobat versions treat certain things in signed fields differently. So if you need to do the task (rather than study how it works) you should rely on third-party solution, such as our PDFBlackbox components.
Digitally signing a PDF document without using a third-party component entails a great deal of work and is generally best avoided.
Components do all the hard work for you, so you don't have to. You should find there are some excellent free PDF components available that will suit your needs.
The following example written in C# shows how simple it is to digitally sign a PDF document using ABCpdf:
Doc theDoc = new Doc();
theDoc.Read(Server.MapPath("../Rez/Authorization.pdf"));
Signature theSig = (Signature)theDoc.Form["Signature"];
theSig.Location = "Washington";
theSig.Reason = "Schedule Agreed";
theSig.Sign(Server.MapPath("../Rez/JohnSmith.pfx"), "111111");
theDoc.Save(Server.MapPath("Signed.pdf"));
Source: ABCpdf documentation - Sign method
Lost my first answer. May want to give DocQ a try to link text They have their own cert and can do this for you for free/cheap to seal and encrypt PDFs. They also have an API you can use.

Categories