cancel
Showing results for 
Search instead for 
Did you mean: 

updating data in adobe form

Former Member
0 Kudos

Hi All,

In my java webdynpro application, i want to show an adobe form and allow the user to update the data. Then, i want to store the form in binary in a db table.

The layout of my form is not fixed as a different form can be uploaded each time. So, all i have is the binary of the interactive form.

I have added the interactive form uielement in my view. I have bound the 'pdfsource' property to a context attribute that contains the binary of the interactive form to be shown. Also, i have chosen 'usepdf' in the mode.

Now, after the user updates the form, if i read the context attribute bound to pdfsource, will i get the updated data in the form? Or should i do anything more to get the desired result?

Thanks and Regards,

Ram

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Ram,

In my Project we solved the same type of situation in following Procedure.

1.) First after the User enters data in to the Form u hav to read it from the PDF

by using this code .It converts the Data in to XML Format.

public String getData(String pdfSource) throws EJBException

{

ByteArrayOutputStream pdfSourceOutputStream = new ByteArrayOutputStream();

try

{

InputStream pdfSourceInputStream = new FileInputStream(new File(pdfSource));

IOUtil.write(pdfSourceInputStream, pdfSourceOutputStream);

pdfSourceInputStream.close();

}

catch (Exception e)

{

System.out.println(e.getMessage());

throw new EJBException(e.getMessage());

}

IWDPDFObject pdfObject = WDPDFObjectFactory.getPDFObject();

pdfObject.setPDF(pdfSourceOutputStream);

ByteArrayInputStream dataInputStream = (ByteArrayInputStream) pdfObject.getData();

if (dataInputStream == null)

{

return(null);

}

else

{

try

{

String output = formatData((InputStream) dataInputStream);

return(output);

}

catch (Exception e)

{

System.out.println(e.getMessage());

throw new EJBException(e.getMessage());

}

}

}

2.) Then u can get the data from tht XML code easily & store it in the Data Base where u need.

--> For more Details watch the " TutWD_PdfObject " Sample Application from this site .

I Think It helps u lot.

With Regards,

Roop Kumar.