0 Replies Latest reply on Mar 22, 2010 9:20 AM by johnnguyen@corelogic.com

    Always got null when calling either getStatusDoc() or getMetaDataDoc()

    johnnguyen@corelogic.com

      I ran the following example, the PDF is generated fine, but when I call either getStatusDoc() ot getMetaDataDoc(), it always return null, please help!!!

       

              try{
                  System.out.println("Beg generating PDF - " + new Date());
                 
                  //Set connection properties required to invoke LiveCycle ES2                               
                  Properties connectionProps = new Properties();
                  connectionProps.setProperty(ServiceClientFactoryProperties.DSC_DEFAULT_EJB_ENDPOINT, "jnp://localhost:1099");                                            connectionProps.setProperty(ServiceClientFactoryProperties.DSC_TRANSPORT_PROTOCOL,Service ClientFactoryProperties.DSC_EJB_PROTOCOL);         
                  connectionProps.setProperty(ServiceClientFactoryProperties.DSC_SERVER_TYPE, "JBoss");
                  connectionProps.setProperty(ServiceClientFactoryProperties.DSC_CREDENTIAL_USERNAME, "administrator");
                  connectionProps.setProperty(ServiceClientFactoryProperties.DSC_CREDENTIAL_PASSWORD, "password");
                             
                  //Create a ServiceClientFactory object
                  ServiceClientFactory myFactory = ServiceClientFactory.createInstance(connectionProps);
                         
                  //Create an OutputClient object
                  OutputClient outClient = new OutputClient(myFactory);
                                   
                  //Reference form data                         
                  FileInputStream fileInputStream = new FileInputStream("D:\\Output\\propertydetail.xml");   
                  Document inXMData = new Document (fileInputStream);
                         
                  //Set PDF run-time options   
                  PDFOutputOptionsSpec outputOptions = new PDFOutputOptionsSpec();
                  outputOptions.setFileURI("D:\\Output\\propertydetail.pdf");        // this PDF form is saved on the server

       

                  //Set rendering run-time options
                  RenderOptionsSpec pdfOptions = new RenderOptionsSpec();
                  pdfOptions.setLinearizedPDF(true);
                  pdfOptions.setDebugEnabled(true);
                  pdfOptions.setCacheEnabled(true);
                  pdfOptions.setAcrobatVersion(AcrobatVersion.Acrobat_9);
             
                  //Reference form data                         
                  FileInputStream fileInputStream2 = new FileInputStream("D:\\Output\\propertydetail.xdp");   
                    Document formDesign = new Document (fileInputStream2);

       

                    //Create a non-interactive PDF document           
                    OutputResult outputDocument = outClient.generatePDFOutput2(
                      TransformationFormat.PDF,
                      "D:\\Output",
                      formDesign,
                      outputOptions,
                      pdfOptions,
                      inXMData
                    );
                 
                    Document metaDataDoc = outputDocument.getMetaDataDoc();
                    Document statusDoc = outputDocument.getStatusDoc();
                   
                    //Save the non-interactive PDF form as a PDF file on the client computer
                  Document document = outputDocument.getGeneratedDoc();
                  File myFile = new File("D:\\Output\\Output.pdf");
                  document.copyToFile(myFile);
                 
                  System.out.println("End generating PDF - " + new Date());
              }
              catch (Exception ee)
              {
                  ee.printStackTrace();
              }