• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Why are not all words transferred to my Excel sheet?

New Here ,
Jan 11, 2018 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

TOPICS
Acrobat SDK and JavaScript

Views

551

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
community guidelines

correct answers 1 Correct answer

Community Expert , Jan 11, 2018 Jan 11, 2018

Use this:

    icount = jso.getPageNumWords(iPage)

Votes

Translate

Translate
Adobe Employee ,
Jan 11, 2018 Jan 11, 2018

Copy link to clipboard

Copied

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

Votes

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
community guidelines
New Here ,
Jan 11, 2018 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

Votes

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
community guidelines
Community Expert ,
Jan 11, 2018 Jan 11, 2018

Copy link to clipboard

Copied

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

Votes

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
community guidelines
New Here ,
Jan 11, 2018 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?

Votes

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
community guidelines
Community Expert ,
Jan 11, 2018 Jan 11, 2018

Copy link to clipboard

Copied

Use this:

    icount = jso.getPageNumWords(iPage)

Votes

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
community guidelines
New Here ,
Jan 11, 2018 Jan 11, 2018

Copy link to clipboard

Copied

LATEST

Edit: Great! it works

Votes

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
community guidelines