Planet PDF Forum Archive

Planet PDF ForumWowsers! This is page is old, head to the LIVE Planet PDF Forum. It features more than 10 conferences, covering everything from beginner to in-depth developer and pre-press discussions. If you wish to continue... one & two archive covers 1999-2011 (160,000 pages).


New Forum | Previous | Next | (P-PDF) Developers


Topic: Striping data from PDF Form using Visual Basic
Conf: (P-PDF) Developers, Msg: 79837
From: breslinj
Date: 1/18/2003 06:23 AM

I have 10,000 PDF forms that have been filled in with various data fields. Now I have to strip all of the data off of the forms and put the data into SQL (or Access or ...)

I wrote a simple program (based on example from various Web resources) that works on one PDF but not on others.

I have 2 questions:
1) What is the preferred method of accomplishing my task
2) What traits/characteristics of a PDF do I look for to tell if my program will or will not work with a particular PDF ( I am assuming that not all PDFs are created equal)

My sample code is:
Private Sub Command3_Click()

Dim sTest As String, sTemp As String

Dim gApp As Acrobat.CAcroApp
Dim gPDDoc As Acrobat.CAcroPDDoc
Dim jso As Object

Set gApp = CreateObject("AcroExch.App")
Set gPDDoc = CreateObject("AcroExch.PDDoc")


If gPDDoc.Open("C:\test2.pdf") Then
Set jso = gPDDoc.GetJSObject
sTest = jso.getfield("BAC").Value

txtData.Text = sTest

Else
txtErrors.Text = txtErrors.Text & sTemp & vbCrLf
txtErrors.Refresh
End If


End Sub

When the code works, sTest has the proper data. When it fails, it fails on the following line:
sTest = jso.getfield("BAC").Value
and it says 'Object Required', which I interpret to mean that the gPDDoc.GetJSObject failed to return a valid object.


Any help would be greatly appreciated.


PDF In-Depth Free Product Trials Ubiquitous PDF

Debenu Aerialist

The ultimate plug-in for Adobe Acrobat. Advanced splitting, merging, stamping, bookmarking, and link...

Download free demo

Debenu PDF Tools Pro

It's simple to use and will let you preview and edit PDF files, it's a Windows application that makes...

Download free demo

Back to the past, 15 years ago! Open Publish 2002

Looking back to 2002, it's amazing how much of the prediction became a reality. Take a read and see what you think!

September 14, 2017
Platinum Sponsor





Search Planet PDF
more searching options...
Planet PDF Newsletter
Most Popular Articles
Featured Product

Debenu PDF Aerialist

The ultimate plug-in for Adobe Acrobat. Advanced splitting, merging, stamping, bookmarking, and link control. Take Acrobat to the next level.

Features

Adding a PDF Stamp Comment

OK, so you want to stamp your document. Maybe you need to give reviewers some advice about the document's status or sensitivity. This tip from author Ted Padova demonstrates how to add stamps with the Stamp Tool along with related comments.