2 Replies Latest reply on Oct 13, 2009 6:06 AM by Galadriel109

    Render or Transform?

    Galadriel109

      First, let me say that I have been a developer for many years, but never used Java or worked with Adobe forms before my last project, so I am very much a nubie at all this.

       

      I am trying to do a project that will (using Java code):

      1)      Allow the user to select a form from several on a web page.

      2)      Display the form and allow the user to fill it out.

      3)      Click a button on the form, which will make the form non-interactive and allow the user to save the form as a PDF with the data in the fields.

       

      I was able to do this in Adobe 7.0, using the renderForm API. The web site would open a PDF form and the 'Submit' button on the form would submit the PDF to my servlet using an XDP as the parameter.

       

      This worked fine, but now we have upgraded to Adobe LiveCycle server 8.2 and while I can use the 7.0 compatibility layer and make my code work, I want to do this "right" and do it using the new API's. I checked out the quick starts and now I am confused as to whether I should use "formsClient.renderPDFForm" to render the form or use "outClient.transformPDF" to flatten the form.

       

      I have tried both and neither seems to give me exactly what I want. Either the form doesn't show up on the web page after I fill it out and click the button or it does show up, but is still interactive.

       

      Any ideas on how to do this in LiveCycle 8.2 would be greatly appreciated.

       

      TIA,

      Bob M.

        • 1. Re: Render or Transform?
          Hodmi Level 4

          Hi Bob;

           

          When Adobe updated the LiveCycle suite from 7 to 8 they "split" up the render form operation.  In the 7 days there was one operation to render interactive (PDFForm) and non-interactive (PDF) documents.

           

          In 8 Adobe took the non-interactive rendering and put it in its own operation called Output.  So now with 8 you use Forms.renderPDFForm to generate the interactive form and Output.generatePDFOutput to create the non-interactive form.

           

          Having said that, if you have an interactive form (created with the renderPDFForm operation) and rather than re-render it you just want to "flatten" it into a non-interactive form you can use Output.transformPDF with PDF as a transformation format.

          1 person found this helpful
          • 2. Re: Render or Transform?
            Galadriel109 Level 1

            Thanks, this is helpful (I think - I'm still playing with it), but I am still having a problem that is confusing me and it may be totally unrelated. Here is a snippet of my code:

             

                        String contextURL = request.getScheme() + "://"

                                                + request.getServerName() + ":" + request.getServerPort()

                                                + ((HttpServletRequest) request).getContextPath();

             

                        // Reference an interactive PDF document to transform

                        String sFormQuery = contextURL + "/forms/" + request.getParameter("name");

                        FileInputStream fileInputStream = new FileInputStream(sFormQuery);

                       

                        // inPDFDoc = The com.adobe.idp.Document object that contains the

                        // interactive PDF document.

                        Document inPDFDoc = new Document (fileInputStream);

             

                        // Transform the PDF document to a non-interactive PDF document

                        Document transformedDocument = outClient.transformPDF(

                                                                                    inPDFDoc,

                                                                                    TransformationFormat.PDF,

                                                                                    null,

                                                                                    null,

                                                                                    null);

             

            When I put in debug statements, it shows that:

            File Name = Test.xdp

            File URL = http://wtdotappl07:8080/odot_forms/forms/Test.xdp

             

            But I get a class java.io.FileNotFoundException error that says:

            http:\wtdotappl07:8080\odot_forms\forms\Test.xdp (The filename, directory name, or volume label syntax is incorrect)

             

            So, somehow the slashes are turned into backslashes, which prevents the file from being found by the servlet.

             

            Any ideas on what I could be doing wrong? I have a feeling that it is trying to turn a URL into a file path, but I don't know how to stop it.

             

            TIA,

            Bob