on 2007 Aug 10 9:35 PM
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.
Hi Ajay,
Let's understand why this problem: you are passing an HTTP url as the template source. This URL then woould be passed on to ADS (which i guess is a different server for you) which will try to access this template and that fails because of authentication issue (most likely) as ADS does not have access to your server.
Solution: There are two ways you can solve this issue:
1. Use pdfContext.setTemplate(byte[] template) method instead of URL. Read the binary on your own and pass the binary itself.
2. Configure a destination on ADS and pass the destination URL instead of HTTP url with the setTemplate method.
Kind Regards,
Krish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ajay,
Let's understand why this problem: you are passing an HTTP url as the template source. This URL then woould be passed on to ADS (which i guess is a different server for you) which will try to access this template and that fails because of authentication issue (most likely) as ADS does not have access to your server.
Solution: There are two ways you can solve this issue:
1. Use pdfContext.setTemplate(byte[] template) method instead of URL. Read the binary on your own and pass the binary itself.
2. Configure a destination on ADS and pass t
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ajay,
Did you find the solution for this issue.
I have the same requirement and facing similar issue.
is there any other way to do that?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
if you want to show the PDF file....
the xdp file should not be used, as far as i understand it.
the xdp file opens in adobe designer(where you design the form) not adobe reader.
use the generated pdf file in the first place.
Place the pdf file and then try.
regards,
-ag.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
62 | |
10 | |
10 | |
6 | |
6 | |
6 | |
5 | |
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.