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
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.
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.
- Sudha K
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.
Copy link to clipboard
Copied
Ok thank you... I will check in javascript...
Can I call the acrobat script using java??
Copy link to clipboard
Copied
Are you trying to do this on a server?
Copy link to clipboard
Copied
Can I call the acrobat script using java??
AFAIK, No.
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...
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
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.
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?
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.
Copy link to clipboard
Copied
ok... can i write csv file using acrobat scripting???
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.
Copy link to clipboard
Copied
Sorry I mixed up my reply, forget XFA. But check what export options are documented.
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.
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??
Copy link to clipboard
Copied
With Acrobat Javascript you can create a Report document and save it.
Copy link to clipboard
Copied
Can u tell me how to to that using acrobat scripting??
Copy link to clipboard
Copied
Have you got the Acrobat JavaScript API document?
Copy link to clipboard
Copied
yes I'm having...
Copy link to clipboard
Copied
In the Javascript Reference look for the Report object.
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??
Copy link to clipboard
Copied
You can save the Report as a text file.
Copy link to clipboard
Copied
Can you tell me how to do??