Skip to main content
Jan 11, 2018 12:35 PM UTC
Answered

Why are not all words transferred to my Excel sheet?

The code transfers all the values from the PDF file into my Excel sheet .... I thought so .... On page 2 and following, after two-thirds of the page the enumeration ends and it continues on the next page ... On page 1 but everything is transferred .... has anyone ever had the phenomenon? I need all the text from the PDF

Set jso = PDDoc.GetJSObject

i = 0

For iPage = 0 To PDDoc.GetNumPages - 1

    icount = jso.getPageNumWords(0)

        For iWord = 0 To icount - 1

            word = jso.getPageNthWord(iPage, iWord, True)

            If VarType(word) = vbString Then

              Tabelle5.Cells(i + 1, 1) = word

                i = i + 1

            End If

        Next iWord

Next iPage

  

Set PDDoc = Nothing

Set jso = Nothing

greetings tobi

This topic is closed to new replies. Start a new post to keep the conversation going.
Bernd Alheit
Bernd AlheitCorrect answer
Community Expert
Jan 11, 2018 3:17 PM UTC

Use this:

    icount = jso.getPageNumWords(iPage)

6 replies

Bernd Alheit
Community Expert
Community Expert
Jan 11, 2018 3:01 PM UTC

In your code you look only for the number of words on the first page.

Translate
Jan 11, 2018 3:13 PM UTC

Hallo Bernd,

aber er speichert fast alle Texte jeder Seite in Spalte A meines Hilfs-Sheets... Er fängt bei Seite 2 und folgende dann an, nur noch 2/3 zu übertragen und lässt den unteren Abschnitt komplett aus.

Was müsste ich denn anpassen?

Translate
Bernd Alheit
Community Expert
Bernd AlheitCommunity ExpertCorrect answer
Community Expert
Jan 11, 2018 3:17 PM UTC

Use this:

    icount = jso.getPageNumWords(iPage)

Translate
lrosenth
Adobe Employee
Adobe Employee
Jan 11, 2018 2:41 PM UTC

Why not just use saveAs() method to have Acrobat write out an Excel file for you?

Translate
Jan 11, 2018 3:10 PM UTC

That's just part of an extensive code.

I have a sheet with numbers in column A.

Now I open one after the other PDF files and search in these for the numbers from my sheet. For this purpose, the code transfers the text from the PDF files to an auxiliary sheet in column A, where it searches for the term and then goes up; search for more terms and transfer them to my sheet.

Then he deletes the contents in the auxiliary sheet and transmits the data from the next PDF file .... simply said ...

These are then for the first recording about 2900 PDF files and then so weekly about 50

If I export to Excel now, I can imagine that this takes more time and can not find a proper search for my terms instead. At any rate, I have no real idea

Translate