Both of these are explained in the Acrobat SDK JavaScript reference, which you should read carefully.

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.

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.

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?