Skip to Content
0
Sep 04, 2007 at 01:54 PM

Adobe problem

11 Views

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.