For attachments use this.removeDataObject("nameOfAttachment"). You can obtain the list of names by enumerating the dataObjects property, e.g.
var d = this.dataObjects;
for (var i = 0; i < d.length; i++)
console.println("Data Object[" + i + "]=" + d[i].name);
To access the XMP data use this.metadata, but you should never have reason to change the pdf:producer tag. It has to be there and it's important that it's accurate. To change the XMP tree you have to reconstruct the schema in XML and write it back to itself, the properties aren't directly addressable.
Thanks for your prompt help on this.
For attachement its working fine. But the meta data i m not clear how to remove the plugin name using "this.metadata".
The reason why we are removing is, while doing OCR the producer name got changed to Papercapture plugin. This will make trouble while printing.
Right now we are removing the papercapture plugin manually. So that i want to include the same in my script.
Not sure why this should cause problems when printing. The producer name is supposed to be the name of a piece of software which made the PDF. It is useful to keep this accurate, and pointless to remove it. It should never be changed to the name of a human or organisation.
Do you mean to say it is not possible?
I didn't say it wasn't possible. I said it should never be necessary. Because it isn't necessary, Adobe aren't likely to have made a specific API for doing it, but that isn't to say there can't be a way.
Let's look at it another way. What are the problems printing that you foresee?
Use this in the console, but as we've said altering these entries can have nasty implications. You certainly should never tag a file as being produced by Adobe software if it wasn't.
var MyProducer = "Generic PDF Application 1.0.0";
var myCreatorTool = "Generic PDF Printing Utility 1.0.0";
var meta = this.metadata;
var myXMPData = new XML(meta);
myxmp = new Namespace("");
myrdf = new Namespace("");
mypdf = new Namespace("");
myXMPData.myrdf::RDF.myrdf::Description.@mypdf::Producer = MyProducer;
myXMPData.myrdf::RDF.myrdf::Description.@myxmp::CreatorTool = MyCreatorTool;
var myNewXMPStr = myXMPData.toXMLString();
this.metadata = myNewXMPStr;
Thanks for your response. It is showing error like "An internal error occured".
Help me to proceed further.
Please ignore the above email. Its working fine.
Thank you so much