Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Error while invoking renderPDFForm with attachment

Avatar

Level 2

hi,

I'm using ES4 renderPDFForm service to render pdf along with attachment.

This service works if I dont have PDF attachment but doesn't work PDF with attachments.

I'm sending the PDF attachment like below.

     Map attachments = new Map();

     MapItem item = new MapItem();

     itme.setKey("attachment");

     byte[] pdfAttachment = new byte[10,20,30...]

     com.adobe.idp.Document doc = new com.adobe.idp.Document(pdfAttachment );

     item.setValue(doc);

     attachments .add(item);

service.renderPDFForm("CORR0040-MiscellaneousMS-8.xdp", inputData, renderSpec, spec, attachments);

Error I'm getting is:  javax.xml.ws.soap.SOAPFaultException: java.lang.ClassCastException: java.lang.String incompatible with com.adobe.idp.Document

Please help me how to resolve this...

0 Replies