java component to generate the report file in post script format
We have migrated the Application from Solaris to Linux,We would print the file from application by executing the below command.
Example: lp -d 10.220.230.80:MB000155 -c /usr/bin/prc_Test2.prc
From java end, we are exporting the print file in pcl format and while calling the print command, solaris convert the file from pcl to post script format before sending it to print server. now problem is linux did not convert the file. So Application unable to print the file successfully.
We would like to export the print file as post script format from application to get the print functionality works. Please let us know the possiblity in java end.
or is there any command in linux with above required property.
regards,
siva
Re: java component to generate the report file in post script format
I have no experience with any Java packages that make it "easy" to write PostScript files from Java applications. How "easy" it is would depend on what kind of files are being created by the application. Text files with different font faces and sizes? Some adornment (lines, etc.)? Graphics figures? Embedded graphics files? What?
I'm a little curious:
What kind of package (if any) was used to make it "easy" to write pcl files? What was its API? Knowing that might make it easier to find a functional replacement for creating PostScript or PDF files. If it was all raw, brute-force PCL-specific stuff embedded in the application, well, I can't think of any way to help.
However...
As a non-Java solution, similar to your previous method, you could try GhostPDL from here GhostScript GhostPDL Download page
I used it for a project that had a lot of PCL5 files and I needed something viewable and printable on my Centos Linux workstation. Using that program to convert pcl to pdf worked (most of the time). Did not have access to source to see how the original project actually created the pcl files. (It wasn't Java.)
Building the executable was a snap ("./configure" followed by "make") with GNU gcc version 4.1.2. Never had to touch any of the C source files.
There were a couple of flaky pcl files that, for some reason, created pdf files that could be viewed with Adobe acroread, but wouldn't print. (All of them that I had would print OK from kGhostView. Go figure.) Files had various graphics shapes and adornments as well as almost-chaotic fontamonium and color and stuff like that.
There are scripts supplied in the "tools" directory so that the conversion from pcl to pdf is easy to automate, and there is a Java-based viewer, Gview, under the tools/viewer directory for rendering a pcl file to the screen without having to convert. (You can print from Gview if you want to, rather than converting to pdf and viewing and/or printing the pdf file.)
Cheers!
Z
Re: java component to generate the report file in post script format
Hi,
Thanks for you comments,
We are using root-river.jar(Licensed jar) for create the .pcl file as PCL5 format.
Issue: After migrate the application from SOLARIS, WAS4 to Linux, WASCE server, Application is not print the file.
we are executing the lp command through application in Linux for printing the file. have raised this printing issue to support team for investigation, Also find the support team commands below,
Application exports its file in a PCL format for printing. This needs to be converted to PS before being sent to a printer. lp on Solaris converts the format transparently just before sending the file to the printer.
In Linux : lp -d 10.220.230.80:MB000155 -c prc7686.pcl
lp: unable to print file: server-error-service-unavailable
The easiest way should be, from an sys-admin point of view, that application export files directly in PostScript format. This way allows us to easily set up a system allowing to print exactly as the users were used to on Solaris.
As you said we have one more solution by using the GhostPDL(Non java). Please let me know(step to do) how to implement it our application.
Quote:
Originally Posted by
Zaphod_b
I have no experience with any Java packages that make it "easy" to write PostScript files from Java applications. How "easy" it is would depend on what kind of files are being created by the application. Text files with different font faces and sizes? Some adornment (lines, etc.)? Graphics figures? Embedded graphics files? What?
I'm a little curious:
What kind of package (if any) was used to make it "easy" to write pcl files? What was its API? Knowing that might make it easier to find a functional replacement for creating PostScript or PDF files. If it was all raw, brute-force PCL-specific stuff embedded in the application, well, I can't think of any way to help.
However...
As a non-Java solution, similar to your previous method, you could try GhostPDL from here
GhostScript GhostPDL Download page
I used it for a project that had a lot of PCL5 files and I needed something viewable and printable on my Centos Linux workstation. Using that program to convert pcl to pdf worked (most of the time). Did not have access to source to see how the original project actually created the pcl files. (It wasn't Java.)
Building the executable was a snap ("./configure" followed by "make") with GNU gcc version 4.1.2. Never had to touch any of the C source files.
There were a couple of flaky pcl files that, for some reason, created pdf files that could be viewed with Adobe acroread, but wouldn't print. (All of them that I had would print OK from kGhostView. Go figure.) Files had various graphics shapes and adornments as well as almost-chaotic fontamonium and color and stuff like that.
There are scripts supplied in the "tools" directory so that the conversion from pcl to pdf is easy to automate, and there is a Java-based viewer, Gview, under the tools/viewer directory for rendering a pcl file to the screen without having to convert. (You can print from Gview if you want to, rather than converting to pdf and viewing and/or printing the pdf file.)
Cheers!
Z
Re: java component to generate the report file in post script format
Quote:
Originally Posted by
siva.wins
...using the GhostPDL(Non java). Please let me know(step to do) how to implement it our application.
Assuming you have a .pcl file from somewhere:
Get things into a state that you can convert and print from a command line. Here's what I did with my Centos 5.8 Linux system with a "normal" CUPs network printer installation for my color LaserJet printer:
Download untar and build ghostpdl from the link that I gave you. For this report I used ghostpdl-9.06.tar.gz.
From the download directory, I executed
tar zxvf ghostpdl-9.06.tar.gz
cd ghostpdl-9.06
./configure 2>& 1 | tee configure.log
make 2>& 1 | tee make.log
sudo make install 2>& 1 | tee make_install.log
If there are problems with any of these steps, get your System Administrator to help. For example if you don't have sudo or if you don't have su privileges, you can install pcl6 somewhere other than the default /usr/local/bin by using command-line options for the configure script. Or you can get someone with su privileges to do the "make install" thing. Stuff like that.
Anyhow...
At this point I have a program named pcl6 in /usr/local/bin.
If you are still with me, and assuming that /usr/local/bin is on your $PATH, you can test converting on a command line like this:
In the ghostpdl-9.06/tools directory there are some pcl files that you can use for testing.
So...
From the ghostpdl-9.06 directory:
cd tools
pcl6 -sDEVICE=pswrite -oowl.ps owl.pcl
This creates owl.ps in that directory by converting owl.pcl in that directory
Print it the way you print any PostScript file on your system. For mine it's just
lp owl.ps
Taa-daa!
You could make a special script (named, perhaps, lppcl) that invokes pcl6 to do the conversion relatively painlessly and then prints the PostScript file. Or some such thing.
Now, from a Java program that creates a pcl file, you can add code that uses the exec() method of the Java Runtime class to use pcl6 to convert the generated .pcl file to .ps. (I would probably make a simple shell script similar to the pcl2pdf script in the tools directory and invoke that from the Java program.)
Whatever...
Bottom line: IWFMYMMV! (It Works For Me; Your Mileage May Vary!)
Cheers!
Z
Re: java component to generate the report file in post script format
Hi
Thanks a lot. Now we have resolved this issue with help of your input.