2 Replies Latest reply on Jan 13, 2014 4:31 AM by cathy hill

    Seam 2.3 inline PDF generation....

    Cory Dahlstrom Novice

      We are migrating our Seam app from Seam 2.1.1 GA to Seam 2.3 Final and are having an issue with PDF generation.

       

      We embed our PDFs inside our HTML documents and I'm having trouble doing so in Seam 2.3.  When I look at the UIDocument class of Seam 2.3, this behavior is controlled by the "sendRedirect" attribute of <p:document>.  In our case we set "sendRedirect" to "false". The code from UIDocument is below that uses this attribute ( in the encodeEnd() method ). 

       

      We use to put our documents in a <h:form> but that doesn't work as that is not an instance of "ValueHolder" and nothing gets displayed in that case.

       

      My question is, what am I suppose to put as the parent of the document in order to inline the PDF?

       

      Thanks much,

       

      Cory.

       

      if (sendRedirect)

            {

               DocumentStore store = DocumentStore.instance();

               String id = store.newId();

       

               String url = store.preferredUrlForContent(baseName, documentType.getExtension(), id);

               url = Manager.instance().encodeConversationId(url, viewId);

       

               store.saveData(id, documentData);

       

               removeITextObject();

       

               context.getExternalContext().redirect(url);

            }

            else

            {

               UIComponent parent = getParent();

       

               if (parent instanceof ValueHolder)

               {

                  ValueHolder holder = (ValueHolder) parent;

                  holder.setValue(documentData);

               }

            }