Get pageNum of a OCG
I am trying to identify what page number a certain layer is on. So I am getting all the OCGs then comparing for 2 specific layer names.
"No Color" and "651 Highways"
I am trying to identify what page number these reside on in the document and output it to the console.
Here is my code that I am running from the document level. It works with the exception of this.pageNum which obviously gives me the current page...not the page that the particular layers reside on.
var ocgArray = this.getOCGs();
for (var i = 0; i < ocgArray.length; i++) {
if (ocgArray.name == "No Color") {
console.println("Found " + ocgArray.name + "\nPage number: " + this.pageNum);
}
if (ocgArray.name == "651 (Highways)") {
console.println("Found " + ocgArray.name + "\nPage number: " + this.pageNum);
}
}
On a side note....I will be searching for a pretty long list of layer names.... would this be better to create an array of layer names to search against?
Any help would be much appreciated!
