Expand my Community achievements bar.

Reading FormService servlet out from another servlet

Avatar

Level 4

Hi All,

I have two JBoss instances. On one JBoss I have FormServlet which call the Form

Service and return the pdf to caller JSP, Servlet, HTML (browser etc.)

On another JBoss I have a client servlet which calls (using HttpURLConnection) the FormServlet passes input parameters and reads the returned pdf

as InputStream which then I convert to PDF using (itext pdf library). But since itext regenrated the whole PDF again it does not keep the original PDF Version. How can I avoid iText library all together? (I need both Servlets since they also perform other business logic )

Does adobe FormService or any other LiveCycle ES / ES2 API are helpful here?

Thanks

YogLC

3 Replies

Avatar

Level 8

I'm not sure I completely understand what you are trying to do.  Since the FormServlet renders the PDF, and returns it to the calling servlet as an InputStream, why not just read it into a byte[] object and send it to the response object?  I'm not clear on why you are using iText to re-render the document.

Avatar

Level 4

Oh! yes Hodmi,

That was my first option that I already tried many times but the PDF file received get corrupted always wheather I store to file system or sent to browser, thats why I was looking into some other library and itext did worked without corrupting the file. ( corrupted file I can not open view with Reader)

I know and sure that the  FormService servlet does not corrupt the file  but it is the second servlet which corrupts pdf, and itext is used in 2nd servlet to avoid it. I want to avoid iText lib software if possible.

Thanks

YogLC

Avatar

Level 4

One more thing 2nd JBoss is running with JD K 1.4.x and FormService need JDK 1.5  or  JDK 6 thats why I am unable to

call FormService from 2nd servlet ( not interested in  webservice client)

Thanks

YogLC