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

PDF document details for batch process

Contributor ,
Jul 21, 2017 Jul 21, 2017

Copy link to clipboard

Copied

Hi,

     I want to get the PDF document details like document name, page ranges as a report.  I can get the name and page ranges using batch sequences for batch process but I don't know how to write it as csv or xl report.

     When I searching in forum and google, I read it we can do it using menu item calling.  But if we use Menu item we should code for  folder selection, file opening and closing.  How can we process that?

How can I get the report for pdf files for batch process?

Batch Sequences Code:

if(global.dataLine == "undefined")

   {

        global.dataLine = "";  

    }

    var docName = this.documentFileName;

    var startPgNo = this.getPageLabel(0);

    var lastPgNo = this.getPageLabel(this.numPages-1);

    var docPgRange = startPgNo + "-"+ lastPgNo

    app.alert("docPgRange" +docPgRange)

    global.dataLine = global.dataLine + docName + "," + docPgRange + "\n";

    app.alert("dataLine" +global.dataLine);

- Sudha K

TOPICS
Acrobat SDK and JavaScript

Views

552

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 ,
Jul 21, 2017 Jul 21, 2017

Copy link to clipboard

Copied

The easiest way would be to output it to the JS Console and then copy it

from there to a text file.

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
Contributor ,
Jul 21, 2017 Jul 21, 2017

Copy link to clipboard

Copied

Hi,

     I need to do it in automation..

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 ,
Jul 21, 2017 Jul 21, 2017

Copy link to clipboard

Copied

Well, it can't be fully automated. Acrobat will require user interaction to run the Action, as well as export the text file at the end of it.
If you want a fully automated solution it will require using a stand-alone application.

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
Contributor ,
Jul 21, 2017 Jul 21, 2017

Copy link to clipboard

Copied

Hi,

     When I searching, found the below link.

actions or batch sequence - global.FileCnt is undefined

     In this, they said that need to call two separate actions that need to run one after the other. How to call one sequence file inside another sequence to set FileCnt?

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 ,
Jul 21, 2017 Jul 21, 2017

Copy link to clipboard

Copied

You need to run the Action, collect the data to a global variable, and then use a separate script (executed from a menu button, for example), to generate the output file using the data in this global variable.

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
Contributor ,
Jul 21, 2017 Jul 21, 2017

Copy link to clipboard

Copied

1 . Run Action - is it sequence or action is different?

2. Collect the data to a global variable     - In the below code, dataLine gives the global data.

if(global.dataLine == "undefined")

   {

        global.dataLine = "";  

    }

    var docName = this.documentFileName;

    var startPgNo = this.getPageLabel(0);

    var lastPgNo = this.getPageLabel(this.numPages-1);

    var docPgRange = startPgNo + "-"+ lastPgNo

    app.alert("docPgRange" +docPgRange)

    global.dataLine = global.dataLine + docName + "," + docPgRange + "\n";

    app.alert("dataLine" +global.dataLine);

3. separate script (executed from a menu button, for example) - What process should do using menu to do this?

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 ,
Jul 21, 2017 Jul 21, 2017

Copy link to clipboard

Copied

1. Batch Sequence is the former name of Actions.

2. Yes, something like that...

3. This would be a folder-level script that will create a new file, create a data object, output the global variable to it and then export it.

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
Contributor ,
Jul 21, 2017 Jul 21, 2017

Copy link to clipboard

Copied

LATEST

Hi,

     Ok... Can you please tell me how can I call actions from folder level script.

     1. Should initialize global variable in folder level script (Menu item)

     2.  Need to call action.

     3. Write a report from folder level script.

     How can I call action from folder level script to get the global variable value?

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