Example of using the label formatter by passing a file in Java
This Java application shows a method of execution of the Label Formatter. The sample label, "Sample", is used and will print to the logical printer “Laser”.
To make this application run correctly on your system, changes to the RT exec call in the main () method below may be necessary. Make sure that the directories in the exec call correspond to the directories of your particular installation of Enterprise Printing Platform.
import java.io.*; import java.util.*; public class fmt_proc { public static void main( String[] args ) { ProcessBuilder processBuilder = null; Process ubfmt = null; String workingDirectory = null; InputStream ubfmtSTDOUT = null, ubfmtSTDERR = null; OutputStream ubfmtSTDIN = null; int exitValue = -1; byte[] message = null; if( ( workingDirectory = System.getenv( "DSI" ) ) == null ) { workingDirectory = System.getProperty( "user.dir" ); } //System.out.println( "workingDirectory = " + workingDirectory ); processBuilder = new ProcessBuilder( workingDirectory + "/ubfmt", "/L=demo2.pcl","/P=Laser" ); processBuilder.directory( new File( workingDirectory ) ); System.out.print( processBuilder.directory() ); List
Loading...
There was a problem loading this topic