Calling the Conversion Processor from a JavaScript Aplicación Arbortext PE
You can write a JavaScript application that can call the conversion processor (explained in Arbortext Publishing Engine Document Conversion). The Subprocesos de Arbortext PE use the Rhino package to allow JavaScript to access Java objects. Refer to the Calling the Conversion Processor From a Java Aplicación Arbortext PE for an explanation of the Java objects used to invoke the conversion processor. Each parameter entry must correspond to a valid conversion parameter (see Document Conversion Parameters for a list and descriptions).
The following is an example of JavaScript code that calls com.arbortext.e3.DocumentConverter.doConvert:
var inFile = "c:\absolute\path\to\input\file.xml";
var outFile = "c:\absolute\path\to\output\file.pdf";
var params = new java.util.HashMap();
params.put( "type", "pdf" );
params.put( "stylesheet" , "d:\absolute\path\to\stylessheet.style" );
try {
com.arbortext.e3.subprocess.DocumentConverter.doConvert(
inFile, outFile, params );
// Conversion succeeded
}
catch( e ) {
var reason = e.getReason();
var page = e.getPage();
// Log the failure and exit.
}
¿Fue esto útil?