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

Detect Empty Pages

Contributor ,
Feb 12, 2016 Feb 12, 2016

Copy link to clipboard

Copied

Hi,

     I need to detect empty pages of pdf document.  if i use the concept of the below code its fail to me bcoz., document contains document name, date & time at bottom of the page.  How can i detect empty pages of pdf document using javascript or java? Can anyone help me...

for(var i=this.numPages-1;i>=0;i--)

{

    numWords = this.getPageNumWords(i);

   if(numWords == 0)

    {

          app.alert("Empty Pages");

    }

}

Thanks in advance,

Sudha K

TOPICS
Acrobat SDK and JavaScript

Views

2.4K

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
LEGEND ,
Feb 12, 2016 Feb 12, 2016

Copy link to clipboard

Copied

You can't do it with JavaScript, and whether you can do it with Java depends on which library you're using. It also depends on exactly what you mean by the term "empty". A page can contain text, graphics, or images, all of which may not be visible or appear to be visible. It's not a simple problem.

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 ,
Feb 12, 2016 Feb 12, 2016

Copy link to clipboard

Copied

Hi George,

     Thank you...

     In javascript, we can check that using preflight.  Can we call that preflight using java or anyother language??

     Could you guide me how to proceed with java?? I have attached sample blank pages for your reference.

     Screen shot 2016-02-13 at 6.52.01 AM.png

- Sudha K

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 ,
Feb 13, 2016 Feb 13, 2016

Copy link to clipboard

Copied

You can run Preflight Profiles using JavaScript's preflight method of the Document object.

This is not really the place to discuss how to achieve it with Java. Try either the forum/mailing list for the specific library you're using or the Acrobat SDK forum.

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 ,
Feb 17, 2016 Feb 17, 2016

Copy link to clipboard

Copied

Ok thank you... I will check in javascript...

Can I call the acrobat script using java?? 

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
LEGEND ,
Feb 17, 2016 Feb 17, 2016

Copy link to clipboard

Copied

‌Are you trying to do this on a server?

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 ,
Feb 17, 2016 Feb 17, 2016

Copy link to clipboard

Copied

Can I call the acrobat script using java??

AFAIK, No.

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 ,
Mar 04, 2016 Mar 04, 2016

Copy link to clipboard

Copied

Hi,

     Not in server... I want to get the pdf page numbers for multiple pdfs and want to write it as report for both OS( Mac and PC).

    We can do this using applescript and javascript but it will run only in mac.  But I want to run on both OS.  So thought of to use java for both OS...

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 ,
Mar 04, 2016 Mar 04, 2016

Copy link to clipboard

Copied

Do you just want the number of pages in each file? It can be easily done with JS, using this command:

this.numPages

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
LEGEND ,
Mar 04, 2016 Mar 04, 2016

Copy link to clipboard

Copied

In Windows you can use the linkage between Visual Basic and Acrobat JavaScript ("JSObject") as described in the Acrobat SDK. This is the method for external scripting.

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 ,
Mar 09, 2016 Mar 09, 2016

Copy link to clipboard

Copied

Hi,

     Sorry for the late reply....

  

     I can get pdf page numbers using javascript.  Also can generate report with the help of applescript.  But I want it for both OS...

     I want to get the all page numbers of file and also empty page's page number of PDF File and need to write report csv for both OS (Window & Mac OSX).  Is it possible? Using scripting or script with java or any other scripting?

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
LEGEND ,
Mar 09, 2016 Mar 09, 2016

Copy link to clipboard

Copied

‌Page numbers on the page are just text. You can get text and text location, uding this to guess page numbers. There is no access to other page contents. Si you can detect pages without text but not blank pages.

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 ,
Mar 09, 2016 Mar 09, 2016

Copy link to clipboard

Copied

ok... can i write csv file using acrobat scripting???

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
LEGEND ,
Mar 10, 2016 Mar 10, 2016

Copy link to clipboard

Copied

I don't know. See what the docs say. I know nothing about XFA JavaScript except that it is different.

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
LEGEND ,
Mar 10, 2016 Mar 10, 2016

Copy link to clipboard

Copied

‌Sorry I mixed up my reply, forget XFA. But check what export options are documented.

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
LEGEND ,
Mar 10, 2016 Mar 10, 2016

Copy link to clipboard

Copied

‌ah wait - you don't want to export csv you want to write a file. No. But not a problem, write it from your VB environment.

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 ,
Mar 10, 2016 Mar 10, 2016

Copy link to clipboard

Copied

If I use VB, it will work for only Windonws is it right???  But I want to run the tool for both OS...  Can I use this for both OS???

I saw this link ... Can we use this for javascript??

http://stackoverflow.com/questions/11978407/java-scriptenginemanager-no-longer-works-with-mountain-l...

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 ,
Mar 10, 2016 Mar 10, 2016

Copy link to clipboard

Copied

With Acrobat Javascript you can create a Report document and save 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 ,
Mar 10, 2016 Mar 10, 2016

Copy link to clipboard

Copied

Can u tell me how to to that using acrobat scripting??

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
LEGEND ,
Mar 10, 2016 Mar 10, 2016

Copy link to clipboard

Copied

H‌ave you got the Acrobat JavaScript API document?

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 ,
Mar 10, 2016 Mar 10, 2016

Copy link to clipboard

Copied

yes I'm having...

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 ,
Mar 11, 2016 Mar 11, 2016

Copy link to clipboard

Copied

In the Javascript Reference look for the Report object.

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 ,
Mar 14, 2016 Mar 14, 2016

Copy link to clipboard

Copied

I have referred the reference and also I have tested the code given in tat pdf.  Its creating PDF file.  Report will create only PDF File?? Can we create CSV 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
Community Expert ,
Mar 14, 2016 Mar 14, 2016

Copy link to clipboard

Copied

You can save the Report as 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 ,
Mar 15, 2016 Mar 15, 2016

Copy link to clipboard

Copied

Can you tell me how to do??

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