How to read PDF file to the database with ASP.net

I have to implement the following solution:

Website user will upload pdf file . i need to read certain fields from file and input them to database.

I use MS SQL, and Asp.net .
Have no idea where to start...

Any help would help.

Thanks...
maximyshkaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

lengreenCommented:
Hi

Upload PDF........
no problems

read certain fields from file and input them to database......

You can't do it, but if you have Adobe Acrobat creator, you can export the pdf file as text OR images, where you can import to your DB.

cheers

Len
0
AerosSagaCommented:
<form runat="server" enctype="multipart/form-data" ID="Form2">
  <P>
    <input type="file" id="file1" runat="server" NAME="file1">
  </P>
  <P>
    <asp:Button id="btn1" runat="server" text="Upload" onclick="upload" />
  </P>
</form>

--------------------------------------------------------------------------------------

Imports System.Data
Imports System.Data.SqlClient

Public Sub Upload(ByVal sender As Object, ByVal e As System.EventArgs)
        Dim b(file1.PostedFile.InputStream.Length - 1) As Byte

        file1.PostedFile.InputStream.Read(b, 0, file1.PostedFile.InputStream.Length)

        Dim con As New SqlConnection(ConfigurationSettings.AppSettings("ConnectionStringSQL"))

        Dim sql As String = "INSERT INTO MY_TABLE(MyID, DATABLOB) VALUES(1,@BlobData) "
        Dim cmd As New SqlCommand(sql, con)

        Dim parmBlob As New SqlParameter("@BlobData", SqlDbType.VarBinary, _
                     b.Length, ParameterDirection.Input, False, 0, _
                     0, Nothing, DataRowVersion.Current, b)
                     
        cmd.Parameters.Add(parmBlob)

        con.Open()
        cmd.ExecuteNonQuery()
        con.Close()
End Sub

Aeros
0
AerosSagaCommented:
no way to do the second part of your question as earlier stated.
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

maximyshkaAuthor Commented:
thanx..
Is it possible to convert pdf file into xml. and theninsert data from xml file?
0
AerosSagaCommented:
It is possible, but it will be a lot of hard work to do it.  I haven't found any magic tool to do this for me yet.

https://www.techsource.ala.org/article.pl?sid=04/07/23/224216&mode=flat

This article talks about the process a bit.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
maximyshkaAuthor Commented:
But, were you able to accomplish it?
0
AerosSagaCommented:
I never attemted it.  Once I saw I was going to hand code such a solution I abandoned that idea.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.