on 03-25-2008 8:02 PM
Hi all,
I am trying to use your suggestion inthis thread but I got a "java.net.MalformedURLException: no protocol:" This is my code.
String url = "";
try {
WDPDFDocumentProtectPermission[] permissions =
{
WDPDFDocumentProtectPermission.PRINT_NOT_ALLOWED,
WDPDFDocumentProtectPermission.CHANGES_NOT_ALLOWED };
IWDPDFDocumentCreationContext pdfContext =
WDPDFDocumentFactory
.getDocumentHandler()
.getDocumentCreationContext();
pdfContext.setProtection(null, null, permissions);
pdfContext.setData(doc_content);
String templateUrl =
WDURLGenerator.getResourcePath(
wdComponentAPI.getDeployableObjectPart(),
"template.xdp");
InputStream template = new FileInputStream(templateUrl);
ByteArrayOutputStream templateSourceOutputStream =
new ByteArrayOutputStream();
IOUtil.write(template, templateSourceOutputStream);
pdfContext.setTemplate(templateSourceOutputStream);
IWDPDFDocument pdf = pdfContext.execute();
WDWebResourceType webResType = WDWebResourceType.PDF;
IWDWebResource webResource =
WDWebResource.getWebResource(pdf.getPDF(), webResType);
url = webResource.getURL();
} catch (...all the catch....
return url;
The doc_content is a byte[] that I got in a RFC from a SmartForm. Any idea that what could be wrong.
Regards,
Orlando Covault
Hi Orlando,
Can u send the complete stack trace?
regards
Sumit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sumit,
I already past this issue following the steps mention on the help
http://help.sap.com/saphelp_nw70/helpdata/en/4f/a00d41921bf023e10000000a155106/content.htm
But now I got two problems:
1.- If I use the byte[] (doc_content) that I got from the RFC (originally was a smartform turn into byte[]) I got a 8
com.adobe.ProcessingException: XMLFM Exception - PDF render operation exception, reason code: 0: InvalidXDPException: Unsupported file format
Exception Stack Trace:
com.adobe.ProcessingException: XMLFM Exception - PDF render operation exception, reason code: 0: InvalidXDPException: Unsupported file format
2.- If I dont use the byte[] (doc_content) and I only use a simple xdp with a simple label I got a
com.adobe.ProcessingException: Could not retrieve a password for credential: ReaderRights Exception Stack Trace: com.adobe.ProcessingException: Could not retrieve a password for credential: ReaderRights at com.adobe.ads.operation.UsageRights.execute(Unknown Source) I am a non interactive form and I dont think that I need the credential, so far I wrote a Note to the marketplace I am waiting for an answer.
Could you give me some guideline about any of my issues? We can open a new thread if necessary.
Regards,
Orlando Covault
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.