Closed GoogleCodeExporter closed 9 years ago
To setup a rule, you'd have to create a script that would execute each action
that you required.
Original comment by ben.switzer@gmail.com
on 28 Apr 2011 at 5:47
hi, thanks for reply. may i know how to create the script? any example?
Original comment by bernard...@gmail.com
on 29 Apr 2011 at 12:11
Here's an example:
var signingAction = actions.create("pdf-signature");
signingAction.parameters["destination-folder"] =
userhome.childByNamePath("docs/Signed");
signingAction.parameters["visibility"] = "visible";
signingAction.parameters["private-key"] =
userhome.childByNamePath("keys/keystore.ks");
signingAction.parameters["key-type"] = "default";
signingAction.parameters["key-password"] = "mypass";
signingAction.parameters["reason"] = "Because I need to sign this";
signingAction.parameters["location"] = "My Location";
signingAction.parameters["width"] = "200";
signingAction.parameters["height"] = "100";
signingAction.parameters["position"] = "bottomleft";
signingAction.parameters["location-x"] = "5";
signingAction.parameters["location-y"] = "100";
signingAction.execute(document);
Some notes about the above:
1. using keystore created as described here:
http://www.unorganizedmachines.com/site/software-and-technology/34-software-deve
lopment/106-alfresco-pdf-toolkit-digital-signatures
2. use the same password for both the key and the store
HTH
Ben
Original comment by ben.switzer@gmail.com
on 11 May 2011 at 8:05
Sorry, forgot to point out this script is to sign documents. Shouldn't be too
difficult to change to watermark.
Original comment by ben.switzer@gmail.com
on 11 May 2011 at 8:07
Original comment by jottley
on 22 Nov 2011 at 6:02
Hi,
When I execute this using javascript console, it doesn't give any error, but
the watermark result is not there.
Can you show me which are the wrong parameter value?
var first_pdf =
search.findNode("workspace://SpacesStore/d02fdc61-37fe-44e3-ba8c-165af67881a8");
var second_pdf =
search.findNode("workspace://SpacesStore/15388185-1aeb-4bf3-825a-cb67ba0e5043");
var dest_folder = second_pdf.parent;
var WatermarkAction = actions.create("pdf-watermark");
WatermarkAction.parameters["destination-folder"] = dest_folder;
WatermarkAction.parameters["watermark-text"] = "Test111";
WatermarkAction.parameters["watermark-type"] = "text";
WatermarkAction.parameters["watermark-pages"] = "all";
WatermarkAction.parameters["watermark-depth"] = "under";
WatermarkAction.parameters["watermark-font"] = "Courier";
WatermarkAction.parameters["watermark-size"] = "34";
WatermarkAction.execute(first_pdf);
Original comment by t...@softbless.com
on 3 Sep 2012 at 10:21
If you have a problem with the actions, please open a new issue instead of
adding it to an existing ticket.
Original comment by nmcminn
on 16 Oct 2012 at 12:46
Original issue reported on code.google.com by
bernard...@gmail.com
on 19 Apr 2011 at 6:20