Read some data form a PDF document with VBA?

  • Thread starter Thread starter Erdinc_Encap_Karacam
  • Start date Start date
E

Erdinc_Encap_Karacam

Hi all,

I want to learn that how to read some data in a PDF document with VBA
coding?

Could you give a sample about it?

Thanks in advance...



Erdinc E. Karacam
 
Hi,

The one of the basic ideas behind the PDF file formats is to allow users to
print the data but not have actual access to the data. In other words
converting pdf files to and Excel file would defeat part of the purpose of
pdf files.

Microsoft provides an add-in the convert Office files (such as Excel 2007)
to PDF but not the other way around. And there is nothing in the Excel VBA
language to allow this.

Cheers,
Shane Devenshire
 
Hi,

I want to ammend a portion of my last comment:

"PDF, as the name Portable Document Format implies, was developed by Adobe
Systems as a means for digital file exchange. The main idea behind the file
format is to enable all computer users to be able to open, review, and print
the documents saved in it. This means that users who work on computers that
don't have the software with which the files were originally created can
still see the document as it was originally designed and laid out, including
all its fonts and graphics."

This is a more accurate explanation of the point behind the format.
Regarding conversion to Excel, my comments are unchanged.

Cheers,
Shane Devenshire
 
Hi,

The one of the basic ideas behind the PDF file formats is to allow users to
print the data but not have actual access to the data.  In other words
converting pdf files to and Excel file would defeat part of the purpose of
pdf files.  

Microsoft provides an add-in the convert Office files (such as Excel 2007)
to PDF but not the other way around.  And there is nothing in the ExcelVBA
language to allow this.

Cheers,
Shane Devenshire

Strange.
On any POSIX-compliant operating system with the usual GNU toolset, I
would just do
pdf2ps | ps2txt < filename.pdf
and be done with it.

So in theory, it might work like this:
a) install the GnuWin tools or CygWin, whatever works best for you.
(both toolsets are Software Libre)
b) make sure that pdf2ps and ps2txt (or ps2ascii) are installed
c) in Excel, shell out to run pdf2ps and ps2txt
d) take the output and do whatever you want with it in Excel

That is how I would do it. Ok, it's not 100% in the Excel VBA language
so some might consider that cheating.
But isn't that what programming is all about? Taking shortcuts to get
the data you want, as fast and as accurate as possible?

HTH, HAND.
Amedee
 
Back
Top