LiveCycle Forms7: importXMP() throws a PDFOperationFailure if the data contains accented characters

Issue

 If you are using the importXMP() method from the FormServer 7 API to import XMP metadata to a PDF you may receive a PDFOperationFailure exception in the log similar to the following:

[11.07.06 13:55:50:837 CEST] 16fd9246 SystemErr R omniORB: WARNING --method 'importXMP' 
on: root/req-66<16777216> raised the exception: IDL:com/adobe/document/pdf/PDFOperationFailure:1.0
[11.07.06 13:55:50:838 CEST] 31281245 SystemErr R
org.omg.CORBA.TRANSACTION_ROLLEDBACK: vmcid: 0x0 minor code: 0 completed: Maybe
[11.07.06 13:55:50:838 CEST] 31281245 SystemErr R 
atcom.ibm.ws.Transaction.JTS.TxClientInterceptor.receive_reply(TxClientInterceptor.java:213)
[11.07.06 13:55:50:838 CEST] 31281245 SystemErr R

Reason

This exception is caused by accented characters in the XMP metadata.  Removing the accented characters will allow the importXMP() to complete successfully, so there is obviously a problem with the encoding.

Solution

 You may be using the following code to generate the data:

lvFileW.write(sb.toString().getBytes());

To resolve the issue you must set the encoding to UTF-8 if there are accented characters:

lvFileW.write(sb.toString().getBytes("UTF-8"));

__________________________________
reference: (1-27943601)

VN:F [1.9.22_1171]
Was this helpful? Please rate the content.
Rating: 0.0/10 (0 votes cast)

Comments are closed.