on 05-22-2008 1:20 PM
Hi
i am designing a adobe form which will be send in mail when a button is clicked, i found that the attachment name to be "unknown.pdf". how can i change this ???
i found out a method called getAcrobatApplicationName() in XML and when i changed application name in that its not getting reflected. So is there any other way to change the file name on "Button Click" event?
Thanks
Gopal
Hi Gopal,
See if it helps:
In NW2004s we use the following. getPdf() returns a byte[], the filename is "document-<username>.pdf" and source is the attribute of an IFrame UI element.
code
private void initPdf() {
IWDResource resource =
WDResourceFactory.createResource(
getPdf(),
"document-"
+ WDClientUser.getLoggedInClientUser().getSAPUser().getUniqueName(),
WDWebResourceType.PDF);
String source =
resource.getUrl(WDFileDownloadBehaviour.OPEN_INPLACE.ordinal());
wdContext.currentContextElement().setSource(source);
}
[/code]
On NW2004 we use a FileDownload UI element (with target=_self) and we call initFileBinaryType method in the wdDoInit method. Of course you still need to set the binary PdfData context attribute with the actual content of the PDF file.
code
private void initFileBinaryType() {
IWDModifiableBinaryType pdf =
initFileBinaryType(IPrivateTestAppView.IContextElement.PDF_DATA);
pdf.setFileName("document-"
+ WDClientUser.getLoggedInClientUser().getSAPUser().getUniqueName());
pdf.setMimeType(WDWebResourceType.PDF);
}
private IWDModifiableBinaryType initFileBinaryType(String attribute) {
return (IWDModifiableBinaryType) wdContext
.getNodeInfo()
.getAttribute(attribute)
.getModifiableSimpleType();
}
[/code]
Regards,
Arafat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.