For a quick way to check if there are any layers, or comments/markup, or form fields within a collection of PDF files, you can do a visual inspection of your file from within Acrobat.
To check for Layers (which are named Optional Content Groups in the PDF format) – open the Layers tab or look for a “layered cake” in the Document Status bar (see Figure 1).
Comments, form fields, multimedia objects, and links are all considered annotation types and are placed on top of the PDF – in the “annotation layer”, which is different than OCG layers described above. A quick way to determine if there are any annotations on a page is to select the “Select Object” tool. If there is any content on the annotation layer it will be highlighted. (See Figure 2)
Instead of opening each PDF by hand, you can create a small JavaScript to check for OCGs or Annotations and create a report which includes the name of the file and whether any content was found. This could be run as a batch process using the following JavaScript:
var rep = new Report(); rep.size = 1.2; rep.color = color.blue; rep.writeText ("Testing for Content"); rep.writeText("FileName : " + this.documentFileName); for (var i = 0; i < this.numPages; i++ ){ // loop thru all pages var a= this.getAnnots(); var c = this.getOCGs(); var b = this.getPageBox("Crop", i); var l = this.getLinks(i, b); rep.indent(20); rep.writeText("Number of Links on page " + (i+1) +" is " + l.length); if (a != null ){ rep.writeText("There are annotations on page " + (i+1)); if (c != null ){ rep.writeText("There are layers in this document.") } } } var docRep = rep.open("myreport.pdf");
Try Acrobat DC
Get started >
Learn how to
edit PDF.
Post, discuss and be part of the Acrobat community.
Join now >
0 comments
Comments for this tutorial are now closed.
Comments for this tutorial are now closed.