Avatar of Crystal Rouse
Crystal RouseFlag for United States of America

asked on 

Tool suggestion to import/export PDF Files

In need suggestions on a tool or a way to import PDF Files into our database thru the UI.  I need to be able to show this data in a View and report on it, export to PDF or Excel.
The problem we have is the creator of the PDF Form does not have the form fields named in any consistent way for me to map them to our database fields.  

Any suggestions welcome!
Document ManagementPDFC#

Avatar of undefined
Last Comment
Chinmay Patel
Avatar of Chinmay Patel
Chinmay Patel
Flag of India image

Hi Crystal,

If form fields in PDF are random then only way out is to create a mapping, for example, the form field names for First Name are:
firstname
fname
first name
fn
and assuming your database field name is firstname

then you could have a mapping table as shown below:
Source Field Target Field
firstname firstname
fname firstname
first name firstname
fname firstname

After that using itextsharp you can read pdf fields

var pdfReader = new PdfReader("yourpdffilename");

// loop through your sourcefieldnames
//Pseudo code 
foreach(var sourcefieldname in pdfReader.AcroFields.Fields
if(pdfReader.AcroFields.Fields.contains(sourcefieldname))
{
targetFieldName =pdfReader.AcroFields.Fields.GetField(sourcefieldname) 
}

Open in new window


I wrote this code without IDE so you might want to tweak datatypes and some string conversation, but I hope you are getting the idea.

You can make it as dynamics as you want and then finally present the mapping to the user to verify it.

Regards,
Chinmay.
Avatar of Crystal Rouse
Crystal Rouse
Flag of United States of America image

ASKER

Thank you for your comment.  We now use iTextSharp.  My problem is for this particular form, we can't control the field names and they will change when their is a new version.

Not only do I need to create a PDF once the data is in the database, I also need to know if there is a tool to import PDF's?
Avatar of Chinmay Patel
Chinmay Patel
Flag of India image

You mean a tool that can read PDF Form fields? and then import them in the database?
Avatar of Crystal Rouse
Crystal Rouse
Flag of United States of America image

ASKER

Yes, exactly!  I have looked at SyncFusion for an easy way to create PDF's.  But have not found a good way to import the PDF and read the form fields.
ASKER CERTIFIED SOLUTION
Avatar of Chinmay Patel
Chinmay Patel
Flag of India image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of Crystal Rouse
Crystal Rouse
Flag of United States of America image

ASKER

Thanks!  I appreciate the response.  I don't think there is such a tool either.
Avatar of Chinmay Patel
Chinmay Patel
Flag of India image

Wew.. I totally forgot about this question... Thank you :)
C#
C#

C# is an object-oriented programming language created in conjunction with Microsoft’s .NET framework. Compilation is usually done into the Microsoft Intermediate Language (MSIL), which is then JIT-compiled to native code (and cached) during execution in the Common Language Runtime (CLR).

98K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo