on 09-04-2007 2:54 PM
Hi everyone,
I created an interactive form in my view.
I filled some data in data interactive form : for example an name.
I created a context attribute for that name.
I also created a submit button in that PDF that saves this file as pdf.
Here is the code for saving the file :
<code>
File file = new File("
server
BTS_FILES
CONVERSIONS
PORTAL
"
+ wdContext.currentDataSourceElement().getZehut()
+ ".pdf");
//write binary to file
FileOutputStream fos = new FileOutputStream(file);
fos.write(wdContext.currentContextElement().getPdfSource());
fos.close();
</code>
When the user runs the application again I want to load in that interactive form the data already inserted (the name).
Here is the code :
<code>
File file = new File("
server
BTS_FILES
CONVERSIONS
PORTAL
"
+ wdContext.currentDataSourceElement().getZehut()
+ ".pdf");
if (file.exists())
{
long length = file.length();
byte []binary = new byte[new Long(length).intValue()];
//read binary from file
FileInputStream fis = new FileInputStream(file);
fis.read(binary);
wdContext.currentContextElement().setPdfSource(binary);
fis.close();
}
</code>
PdfSource is an attribute created in the context as binary and it is bound to the attribute pdfSource of the interactive form.
The problem is that name is empty.
How is it possible ?
Thanks.
Regards.
Hi,
how was ur problem resolved, pls share........ I'm facing a similar issue
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.