8 Replies Latest reply on Sep 24, 2010 1:05 AM by sterym

    pageCount from generatePDFOutput and hostname in process

    sterym

      Hey,

       

      I'm working on a project where I have to add some custom logging to a livecycle ES process.

      The process is short-lived and uses an xml with data to generate a pdf (generatePDFOutput) and optionally e-mail, print or fax the pdf.

       

      I would like to know whether it's is possible to obtain the hostname of the livecycle server from the process (using execute script?), because we want to see which livecycle server is used the most (2 livecycle server behind a loadbalancer).

       

      And I would like to know how I can get the number of pages that the generated pdf contains. I already googled and found the method getPageCount() in the FormsResult, but I need to use the generatePDFOutput method, so I don't have a FormsResult.

      Is it still possible to get a pageCount?

       

       

      Regards

      Steven

        • 1. Re: pageCount from generatePDFOutput and hostname in process
          Jasmin Charbonneau Level 4

          You'll have to use the Assembler service to get the number of pages. The Assembler service can produce a DocumentInformation object that contains the page count of a PDF.

           

          Jasmin

          1 person found this helpful
          • 2. Re: pageCount from generatePDFOutput and hostname in process
            Jasmin Charbonneau Level 4

            I'm not sure how to get the server name.

             

            Jasmin

            • 3. Re: pageCount from generatePDFOutput and hostname in process
              sterym Level 1

              I found a way to access the hostname, I added a script object where I use the following:

               

              import java.lang.String;
              import java.net.InetAddress;
              
              InetAddress address = InetAddress.getLocalHost();
              String IP = new String (address.getHostAddress());
              

               

              And this works.

               


              I use the assembler service to get the documentInformation from my rendered document. At the moment I still get a nullpointer exception, but I'm getting closer. My DDX is:

               

              <?xml version="1.0" encoding="UTF-8"?>
              <DDX xmlns="http://ns.adobe.com/DDX/1.0/"> 
                  <PDF result="doc2">
                      <PDF source="doc2"/>
                  </PDF>
              
                  <DocumentInformation result="out-docinfo.xml" source="doc2" />       
              </DDX>
              
              • 4. Re: pageCount from generatePDFOutput and hostname in process
                sterym Level 1

                I found out what caused the exception, when I generate the pdf, I use generatePDFOutput and I didn't have the property "render at client" set to "Yes".

                When I changed it to "Yes", it worked.

                 

                Now everything seems ok, but my numPages is always 1. Can someone tell me why this isn't the real number of pages?

                 

                 

                Regards

                • 5. Re: pageCount from generatePDFOutput and hostname in process
                  Jasmin Charbonneau Level 4

                  It's because you set the PDF to render at client.

                   

                  When you set that option, the PDF is rendered at the client meaning that it'll create all the pages on the client. On the server you just have this one page PDF.

                   

                  You probably want to change that option back, and we'll focus on solving your other error.

                   

                  Jasmin

                  1 person found this helpful
                  • 6. Re: pageCount from generatePDFOutput and hostname in process
                    sterym Level 1

                    Ok, I reverted the "render at client" option and get my error:

                     

                    2010-09-16 14:21:28,443 INFO  [com.adobe.internal.ddxm.Executive] DDXM_N00000: Started processing result named doc2
                    2010-09-16 14:21:28,459 INFO  [com.adobe.internal.ddxm.Executive] DDXM_N00001: Successful assembly of result named doc2
                    2010-09-16 14:21:28,475 INFO  [com.adobe.internal.ddxm.Executive] DDXM_N00000: Started processing result named out-docinfo.xml
                    2010-09-16 14:21:28,506 ERROR [com.adobe.internal.ddxm.Executive] DDXM_S00001: Failed to assemble result named out-docinfo.xml
                    java.lang.NullPointerException
                        at com.adobe.internal.pdfm.forms.FormUtils.isAcroform(FormUtils.java:72)
                        at com.adobe.internal.pdfm.query.DocInfoServiceImpl.getFormType(DocInfoServiceImpl.java:376)
                        at com.adobe.internal.ddxm.task.query.GetDocInfo.execute(GetDocInfo.java:113)
                        at com.adobe.internal.ddxm.ddx.Node.postExecute(Node.java:384)
                        at com.adobe.internal.ddxm.Executive.execute(Executive.java:252)
                        at com.adobe.internal.ddxm.Executive.execute(Executive.java:192)
                        at com.adobe.livecycle.assembler.AssemblerServiceImpl.execute(AssemblerServiceImpl.java:408)
                        at com.adobe.livecycle.assembler.AssemblerServiceImpl.invokeDDX(AssemblerServiceImpl.java:290)
                        at sun.reflect.GeneratedMethodAccessor732.invoke(Unknown Source)
                        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                        at java.lang.reflect.Method.invoke(Method.java:585)
                        at com.adobe.idp.dsc.component.impl.DefaultPOJOInvokerImpl.invoke(DefaultPOJOInvokerImpl.java:181)
                        at com.adobe.idp.dsc.interceptor.impl.InvocationInterceptor.intercept(InvocationInterceptor.java:134)
                    
                    ....
                    

                     

                    It goes on like that, but doesn't tell me what caused the error.

                     

                     

                    Regards

                    • 7. Re: pageCount from generatePDFOutput and hostname in process
                      Jasmin Charbonneau Level 4

                      Can you send me you PDF at livecycle8@gmail.com?

                       

                      I'll have a look at it.

                       

                      Jasmin

                      • 8. Re: pageCount from generatePDFOutput and hostname in process
                        sterym Level 1

                        Jasmin,

                         

                        Could you tell me whether I did something wrong with the assembler component. Because I noticed that I get strange errors when I use the assembler service. Livecycle says it can't delete some temp files and keeps trying.

                         

                        Regards

                        Steven