Skip navigation
Currently Being Moderated

generatePDFOutput is not invoked

Apr 15, 2009 5:07 AM

import com.adobe.livecycle.output.client.*;
import java.util.*;
import java.io.File;
import java.io.FileInputStream;
import com.adobe.idp.Document;
import com.adobe.idp.dsc.clientsdk.ServiceClientFactory;


public class CreatePDFDocument {

public static void main(String[] args) {
 
  try{
  //Set LiveCycle ES service connection properties       
  Properties ConnectionProps = new Properties();
  ConnectionProps.setProperty("DSC_DEFAULT_EJB_ENDPOINT", "jnp://localhost:1099");
  ConnectionProps.setProperty("DSC_TRANSPORT_PROTOCOL","EJB");         
  ConnectionProps.setProperty("DSC_SERVER_TYPE", "JBoss");
  ConnectionProps.setProperty("DSC_CREDENTIAL_USERNAME", "administrator");
  ConnectionProps.setProperty("DSC_CREDENTIAL_PASSWORD", "password");
    
  //Create a ServiceClientFactory object
  ServiceClientFactory myFactory = ServiceClientFactory.createInstance(ConnectionProps);
   
  //Create a SignatureServiceClient object
  OutputClient outClient = new OutputClient(myFactory);
       
  //Reference form data       
  FileInputStream fileInputStream = new FileInputStream("C:\\Adobe\\Loan_data.xml");
  Document inXMData = new Document (fileInputStream);
   
  //Set PDF run-time options
  PDFOutputOptionsSpec outputOptions = new PDFOutputOptionsSpec();
  outputOptions.setFileURI("C:\\Adobe\\Loan.pdf");
  
  //Set rendering run-time options
  RenderOptionsSpec pdfOptions = new RenderOptionsSpec();
  pdfOptions.setLinearizedPDF(true);
   
  //Create a PDF document  
  OutputResult outputDocument = outClient.generatePDFOutput(
   TransformationFormat.PDF,
   "Loan.xdp",
   "C:\\Adobe",
   outputOptions,
   pdfOptions,
   inXMData
  );
   
  //Retrieve the results of the operation
  Document metaData = outputDocument.getStatusDoc();
  File myFile = new File("C:\\Adobe\\Output.xml");
  metaData.copyToFile(myFile);
  }
  catch (Exception ee)
  {
   ee.printStackTrace();
  }
 
}
}



While Trying to run this sample i am getting the following message "Unable to create / open file C:\Adobe\Loan.pdf" in Output.xml file
outClient.generatePDFOutput is not called...
Please suggest me i am new Adobe Lifecycle.
 
Replies
  • Currently Being Moderated
    May 28, 2009 9:19 AM   in reply to Rajeshem

    May be a Loan.pdf exists and is open!

     

     

    Also, try using the SOAP endpoint. The EJB endpoint is usually problematic. See if it helps.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points