Why are not all words transferred to my Excel sheet?

New Here ,
Jan 11, 2018

Copy link to clipboard

Copied

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

Adobe Community Professional
Correct answer by Bernd Alheit | Adobe Community Professional

Use this:

    icount = jso.getPageNumWords(iPage)

TOPICS
Acrobat SDK and JavaScript

Views

211

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Why are not all words transferred to my Excel sheet?

New Here ,
Jan 11, 2018

Copy link to clipboard

Copied

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

Adobe Community Professional
Correct answer by Bernd Alheit | Adobe Community Professional

Use this:

    icount = jso.getPageNumWords(iPage)

TOPICS
Acrobat SDK and JavaScript

Views

212

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Jan 11, 2018 0
Adobe Employee ,
Jan 11, 2018

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jan 11, 2018 0
New Here ,
Jan 11, 2018

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jan 11, 2018 0
Adobe Community Professional ,
Jan 11, 2018

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jan 11, 2018 0
New Here ,
Jan 11, 2018

Copy link to clipboard

Copied

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?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jan 11, 2018 0
Adobe Community Professional ,
Jan 11, 2018

Copy link to clipboard

Copied

Use this:

    icount = jso.getPageNumWords(iPage)

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jan 11, 2018 0
New Here ,
Jan 11, 2018

Copy link to clipboard

Copied

Edit: Great! it works

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jan 11, 2018 0