cancel
Showing results for 
Search instead for 
Did you mean: 

Generate Adobe Interactiveform pdf using Web Dynpro Java API.

Former Member
0 Kudos

I created pdf form by using standard "InteractiveFormElement" and it is displaying correctly in browser.

Now there is a requirement to provide url link to the same pdf that is displayed with InteractiveFormElement. To generate pdf, I was doing something the below.

//Copied  XDP file from the srcconfigurationcomponents<package><file>.xdp 
//to srcmimiescomponents<package><file>.xdp 
try {
	templateUrl = WDURLGenerator.getWebResourceURL(
                               wdComponentAPI.getDeployableObjectPart(),
			       "CompView_InteractiveForm.xdp");
} catch (WDURLException e) {			
	}
IWDPDFDocumentCreationContext pdfContext = 
   WDPDFDocumentFactory.getDocumentHandler().getDocumentCreationContext();  
 
pdfContext.setData(
   WDInteractiveFormHelper.getContextDataAsStream(wdContext.nodeDataNode()));
 
pdfContext.setTemplate(templateUrl);		
IWDPDFDocument pdf = null;
try {
	pdf = pdfContext.execute();			 
} catch (WDPDFDocumentRenderException e) {
			wdComponentAPI.getMessageManager().reportException(
"pdfContext.execute() " + e.getLocalizedMessage(), false);
		}

IWDPDFDocument.execute() is raising exeception "Template used in PDF render

operation is invalid or cannot be found". template url is indeed correct. I checked by

assigning to that url to linkToUrl Element and opening the xdp file.

Please help me to identify the issue. Thank you.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Ajay,

Use getResourcePath instead of getWebResourceURL

templateUrl = WDURLGenerator.getResourcePath(

wdComponentAPI.getDeployableObjectPart(),

"CompView_InteractiveForm.xdp");

Thanks

Ram

Former Member
0 Kudos

Thanks for your reply.

Still it doesn't work - Error message is "File does not exist". Any other thoughts?

Answers (0)