Can anyone help me in how to print document using java program.
The file path and name will be given as input.
Program should read the content and print in the specified format.
The file can be of any format.
Thanks a lot Paul..
Using that documentation, I am able to print text files, jpeg,gif files..But unable to print PDF..Its printing in unreadable format..
Can you please suggest how to print PDF file correctly using DocPrintJob API...
The last time I looked at the Java Print Service, it depended on your printer being able to print a PDF directly (not using Acrobat or other software). That topic also includes several options if your printer does not support PDF>
I have a question..like how can a printer print a PDF file without any Adobe software or anything?
If I open PDF file and print it from there,its printing correctly..
But ..when i try to print using JPS API, it is printing junk data in severeal pages.
Or you have any other suggestion to print PDF file from java code other than JPS
com.sun.pdfview.PDFParseException: Expected 'xref' at start of table
at com.sun.pdfview.PDFFile.readTrailer(PDFFile.java:974)
at com.sun.pdfview.PDFFile.parseFile(PDFFile.java:1175)
at com.sun.pdfview.PDFFile.<init>(PDFFile.java:126)
at com.sun.pdfview.PDFFile.<init>(PDFFile.java:102)
at view.Pdf2Image.main(Pdf2Image.java:31)
When searched in Google, it says that PDFRenderer works fine Java in 1.4 but not latest versions.
I have java 1.5
Can you suggest any way(Java code) to convert PDF files to image files?
Latha Sree wrote:When searched in Google, it says that PDFRenderer works fine Java in 1.4 but not latest versions. I have java 1.5
I think you misunderstood something. PDFRenderer doesn't work with Java 1.4 at all - it requires Java 5 (at least that's what its home page says). The "1.4" refers to the version of the PDF specification it supports.
Can you post the URL to an example PDF file that exhibits the problem?