How to troubleshoot Acrobat? Code worked last week but fails today.
This is infuriating. I had functional JavaScript code last Friday that doesn't work today on the same file. See "How to show/hide single layers in browser with JavaScript?" (https://community.adobe.com/t5/acrobat-sdk-discussions/how-to-show-hide-single-layers-in-browser-with-javascript/m-p/15103708#M93769).
The PDF file has no duplicates, yet this code that worked no longer shows the layer:
function find(ocgname){
var layers = this.getOCGs();
for(var i=0; i < layers.length; i++) {
if(layers[i].name == ocgname) return layers[i];
}
return null;
}
bld = find("F1")
layer = bld.name;
layer.state = true;
trueI also tried this single step code:
var layers = this.getOCGs();
var cnt = layers.length;
layer = layers[9].name;
layer.state = true;
undefined
undefined
F1
trueand that failed to show the layer. I have verified that there are no duplcate layers with:
setOCGOrder(getOCGs())Setting the state to true is supposed to show the layer. It did but now it doesn't!
1. A power event occurred this weekend that that caused a hard shut down and so everything, including Acrobat, shut down ungracefully. Could that have something to do with its state now?
2. What tools are provided that would help me troubleshoot my PDF to see why the code that worked last week will not work today?
