Hi
I am using two scripts to add images to a pdf. One of them works fine but in the other whose code is the same I get the following error:
021-09-02 14:51:54,757 ERROR [extensions.webscripts.AbstractRuntime] [http-apr-8080-exec-4] Exception from executeScript: 08020357 Failed to execute script 'workspace://SpacesStore/e736071d-eda0-44e9-9985-f8bb7c5a1790': nodeRef is a mandatory parameter
org.alfresco.scripts.ScriptException: 08020357 Failed to execute script 'workspace://SpacesStore/e736071d-eda0-44e9-9985-f8bb7c5a1790': nodeRef is a mandatory parameter
Code is:
var userlogged = userhome.properties.name;
var query = "TYPE:\"cm:content\" AND @CM\\:name:"+ userlogged + ".png";
var nodes=search.luceneSearch(query);
var watermark_action = actions.create("pdf-watermark");
watermark_action.parameters.inplace = true;
watermark_action.parameters["watermark-type"] = "image";
watermark_action.parameters["watermark-image"] = eval(nodes[0]);
watermark_action.parameters["watermark-image"] = eval("rubrica_" + userlogged);
watermark_action.parameters["watermark-text"] = "Lorem Ipsum";
watermark_action.parameters["watermark-font"] = "Helvetica";
watermark_action.parameters["watermark-size"] = "12";
watermark_action.parameters.page = "all";
watermark_action.parameters["watermark-depth"] = "over";
watermark_action.parameters.position = "manual";
watermark_action.parameters["location-x"] = step;
watermark_action.parameters["location-y"] ="1";
watermark_action.execute(doc);
logger.system.out("***************************Incluida firma en : " + doc.name );
Ok, if I //watermark_action.execute(doc);
The script run ok and the name of the document is shown in log. Therefore doc is a valid node.
If I execute watermark_action.execute(doc);
the error of the beginning is shown in the log
Any idea?
Thanks in Advanced