on 06-22-2008 4:02 PM
Dear all,
i want to generated PDF which use SAP NetWeaver Developer Studio 7.1,i did like this:
import com.sap.tc.webdynpro.clientserver.adobe.pdfdocument.api.IWDPDFDocument;
import com.sap.tc.webdynpro.clientserver.adobe.pdfdocument.api.IWDPDFDocumentCreationContext;
import com.sap.tc.webdynpro.clientserver.adobe.pdfdocument.api.WDPDFDocumentFactory;
import com.sap.tc.webdynpro.basesrvc.util.IOUtil;
...
InputStream template = ... //your XDP file as an inputstream
String xmlData = ... //business data you want to merge your form template with
ByteArrayInputStream dataSourceInputStream = new ByteArrayInputStream(xmlData.getBytes());
ByteArrayOutputStream dataSourceOutputStream = new ByteArrayOutputStream();
ByteArrayOutputStream templateSourceOutputStream = new ByteArrayOutputStream();
// convert InputStream to OutputStream
IOUtil.write(template, templateSourceOutputStream);
IOUtil.write(dataSourceInputStream,dataSourceOutputStream);
IWDPDFDocumentCreationContext creationContext = WDPDFDocumentFactory.getDocumentHandler().getDocumentCreationContext();
creationContext.setTemplate(templateSourceOutputStream);
creationContext.setData(dataSourceOutputStream);
creationContext.setDynamic(true); //if you want to create dynamic interactive form
IWDPDFDocument pdfDoc = creationContext.execute();
// create the PDF and store it as ByteArrayInputStream
InputStream pdfInputStream = pdfDoc.getPDFAsStream();
but i can't find com.sap.tc.webdynpro.basesrvc.util.IOUtil in SAP NetWeaver Developer Studio 7.1, what can i do?
i need your help,Thank you !
Jiandong
Jiandong,
Add the required jar webdynprobasesvrc.jar file from follwoing path and check if the imports are added correctly.
C:\Program Files\SAP\IDE\CE\eclipse\plugins\com.sap.tc_.wd_.basesrvc_1.0.0.071030103936\lib
Chintan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.