Fill up form in Word/Pdf - c#

What I want to accomplish is a fill up form or a registration form for a hotel in word or pdf file. It's like after filling up name text box and clicking next another text box will appear.
And also it needs to have a preview before printing. If possible, showing the preview simultaneously.
I really want to know where to start or if there is any, sample would be great.

The way I would approach this problem is using Web form data and after confirmation from the user i would generate the report straight away. I dont think manipulating Word document or PDF document is the best approach :
Check User Input using your web form
Generate the Word or PDF document on your reporting server[Connect to it using WCF for instance]
Give the link of the generated document to the user. It would be up to the user to print it or only view it in their browser.

Related

iTextSharp create PDF from another and add form data

I use ITextSharp to create a PDF with form data based on another PDF.
The problem is the file generated is not editable (the form on it).
If I use ITextSharp in append mode, I get the form editable but most of the form data is not preserved. I want the user to see the resulted PDF with the PDF Form data preserved.
I understand there is NOTHING I can do. The only way for the user to edit the resulted PDF is to use a paid Acrobat version on it. This is because I CHANGE the PDF file by entering form data and setting fonts on it.
Is there something I can do?
Paul
Your question isn't very clear, but here are some answers to similar questions that have been asked before:
End users can't edit a form locally unless the form is "reader-enabled". Making a form reader-enabled is only possible when you use Adobe software: "Adding Enable for commenting Adobe Reader" using Acrobat
You need to fill out reader-enabled forms in append mode if you don't want to break the reader-enabling: Pdf with Acroform editing using iText
This doesn't mean you can't ask people to fill out a PDF form to gather data. See
Edit pdf embedded in the browser and save the pdf directly to server
You can capture that data, and fill out the form without flattening if you want to serve this form (including the data) to the end user: How to fill out a pdf file programmatically?
I'm pretty sure one of these question is a duplicate of what you're asking, but since your question isn't clear, it's hard to mark your question as an exact duplicate of one of them.
Short answer: No
Pdf file are likely to be secure (read only) and this is why everyone is using it. Most of the time, we convert a file into a pdf so maybe if you can get the 'file' and not the pdf will be a good move there.
From my experience in the past, I can confirm with you that iTextSharp may not convert all your data properly and this can make your generated file unusable. If not, you might have some weird line or some changes in the document behavior (ex. fields are not editable anymore).
If you really want to work with pdf file as input and do your stuff with it, you will need to understand the inner structure of it:
[PDF file format]
http://resources.infosecinstitute.com/pdf-file-format-basic-structure/
This can be a hell of a ride. You might need to re-consider the use of a pdf as input. If you can't change that, you might need to use some sort of adobe pluging to do so. Alot of third party pdf library is doing that.
Good luck

Editing parts of document in WPF to print

I am making WPF application in C#.
I want to make users to fill up some fields in program and after clicking Save it will save document (XPS or PDF) from template with filled fields.
I started learning Net and C# about 2 weeks ago and don't know what is the best way in this application to make a filled document from template and user input.
You can use Report Viewer Control for that. It will allow you to create a template in .rdlc format and then fill in parameters during run-time.
Check out official page here

Read PDF and Extract page ASP.Net

We ask the our users to print of a multi page form, fill it in, scan it and upload it to our site.
I need to be able to programmaticly find one specific page from the uploaded pdf based on a pattern that I can add (such as a Cross or a barcode) and then split the pdf to pick up that one page.
A pdf text reader won't work because, the pdf is scanned in.
Any suggestions on how to go about it would be helpful.

Automate editable PDF

I am working on an application that has a requirement for me to create a document, populated with data captured in my WPF application, for attaching to an email and sending to insurance company.
My client has been performing this by sending an editable PDF document to clients then proof reading upon receipt of completed form and manually attaching to email.
I initially thought of creating a word document laid out same format as existing and automating word using find/replace on placeholders such as etc...
However it would be great if I could populate the existing PDF docs wouldn't it.... Anyone know if possible?
Thanks.
You can use PDFsharp/MigraDoc to edit pdf-files. Parsing the existing document and inserting text/images is simple enough, but I don't know if there is any support for actual placeholders.
EDIT: Found this approach, using iTextSharp and form fields: Using itextsharp (or any c# pdf library), how to open a PDF, replace some text, and save it again?

Interactive API with PDF document

I am working on a feasibility for having an application that can capture text from PDF. The simple use-case can be briefed as:
User selects text on PDF document (using Acrobat reader / or other PDF reader)
The selection completed event should be available to the .NET application that is observing.
Upon selection, the user can select, state some further properties (like category/level) and the same information is tagged along with the selected text inside the PDF file itself.
The selected text should be retained with highlighted color. The color will be different depending upon other parameters (like category/level) selected in the .NET application.
A separate application should be able to parse and gather these data from the PDF file.
Similar application is already working with MS Word files.
Edit:
The basic requirement is that there should be some way to notify the .NET application when user selects some text in the PDF document. The other requirement is that there should be a way to add a tag to the selected document.
Can somebody suggest some API/resource for such implementations?
Take a look on Amyuni PDF Creator .Net:
The SelectedObjectChange event should be enough for detecting new text being selected.
The DoCommandTool method combined with acCommandToolHighlight command tool can be used to activate the text highlight tool.
On your resulting file, you can enumerate all object in a page, and identify the highlighted text by using the object type acObjectTypeHighlight
You can get free support during your evaluation time.
Usual disclaimer applies

Categories