Copy link to clipboard
Copied
Hi
I'd like to know if I can use JavaScript to detect if a PDF conforms to any ISO Standard (PDF/X, PDF/E, PDF/A mainly) and also to detect if it's a "scanned PDF" or not.
I know that I can use a Preflight profile to detect if a PDF not conforms to an ISO Standard, but I need to detect if a PDF conforms to an ISO Standard.
Thank you
No, JavaScript has no such option, beyond running a Preflight profile on the file.
You can check if it contains any "real" text, though. If not, it's likely (although not necessarily) a scanned document.
To do that you can run the following script:
var fileHasText = false;
for (var p=0; p<this.numPages; p++) {
var numWords = this.getPageNumWords(p);
if (numWords>0) {
fileHasText = true;
break;
}
}
if (fileHasText) app.alert("There is text in this file.",3);
else app.alert("There's NO te
...
Copy link to clipboard
Copied
No, JavaScript has no such option, beyond running a Preflight profile on the file.
You can check if it contains any "real" text, though. If not, it's likely (although not necessarily) a scanned document.
To do that you can run the following script:
var fileHasText = false;
for (var p=0; p<this.numPages; p++) {
var numWords = this.getPageNumWords(p);
if (numWords>0) {
fileHasText = true;
break;
}
}
if (fileHasText) app.alert("There is text in this file.",3);
else app.alert("There's NO text in this file.",3);