How to print PDF files using java print API

Hi,
I was goign throw lot of discusion and reading lot of forums related to print pdf files using java api. but nothing seems to be working for me. Can any one tell me how to print pdf files using java api.
Thanks in advance

Mike,
Can't seem to get hold of the example described in your reply below. If you could let us have the URL to get then it would be great.
My GUI application creates a pdf document which I need to print. I want to achieve this using the standard Java class PrinterJob (no 3rd party APIs I'm afraid, commercial restraints etc ..). I had a stab at it using the following code. When executed I get the pretty printer dialog then when I click ok to print, nothing happens!
boolean showPrintDialog=true;
PrinterJob printJob = PrinterJob.getPrinterJob ();
printJob.setJobName ("Contract.pdf");
try {
if (showPrintDialog) {
if (printJob.printDialog()) {
printJob.print();
else
printJob.print ();
} catch (Exception PrintException) {
               PrintException.printStackTrace();
Thank you and a happy new year.
Cheers,
Chris

Similar Messages

  • Printing PDF files using java

    Is there a class or utility that already does this?
    Thx in advance.

    Do you want to create PDF files using Java? If so, there is a library available at http://www.lowagie.com/iText/docs.html Check out this site. There are many more similar PDFGEnerator tools that you can use..

  • How to read pdf files using java.io package classes

    Dear All,
    I have a certain requirement that i should read and write PDF files at runtime. With normal java file IO reading is not working. Can any one suggest me how to proceed probably with sample code block
    Thanks in advance.

    hi I also have the pbm. to read pdf file using JAVA
    can any body help meWhy is it so difficult to read the thread you posted in? They say: java.io is pointless, use iText. So why don't you?
    or also I want to read a binary encoded data into
    ascii,
    can anybody give me a hint how to do it.Depends on what you mean with "binary encoding". ASCII's binary encoding, too, basically.

  • How to print Pdf files using Adobe Reader

    How to print Pdf files using Adobe Reader

    Open the PDF file with File > Open... in Adobe Reader and print it with File > Print

  • Laserjet p2055dn is slow printing pdf files using mac

    My Mac is very slow printing pdf files on my hp laserjet p2055dn.  I have noticed fixes for this problem for people using Windows.  Is there a Mac solution?

    Do you want to create PDF files using Java? If so, there is a library available at http://www.lowagie.com/iText/docs.html Check out this site. There are many more similar PDFGEnerator tools that you can use..

  • Print PDF file using Acrobat SDK - Warning message

    Hello,
    We are trying to create automatic program in c# that will print all pdf files located in a specific folder, using Adobe Acrobat 9.0 SDK.
    Whenever the application tries to print file, we receive a warning message ("WARNING! A script has requested to print an Acrobat file. This could print an entire document. Do you want to proceed printing?").
    If we press yes, the file is printed, but next time we'll run the application, this message will appear again.
    Since this application supposed to run automatically (with no interaction with the end users), we want to prevent this warning message from appearing.
    How can we eliminate this warning message?
    Is there any other way to print PDF files using Adobe Acrobat from another application?
    Thanks,
    Lilach.

    joeln3:  I believe the original post refers to a client application, not a web page.  Why use JavaScript from within a client application?  I understood their use case to involve a client app referencing the PDF Library, loading various PDF files, and using one (or more) of the PDF Library's Print methods to invoke Acrobat's internal print routines.
    Dave

  • Cannot print pdf file using windows 7 64 bit and trial acrobat X

    cannot print pdf files using trial version of Acrobat X and windows 7 64 bit prints all other files no problem.
    I've done some searching but can't find anything that helps
    Thanks for any help
    Kim

    I fixed this problem. I had to turn off the browser virtualization feature in Zone Alarm Extreme Security. This wiped out all of the Firefox settings, but I had bookmarks, etc. backed up. (answered by original poster)

  • Unable to print PDF files using Acrobat 8.

    I had to uninstall and then reinstall Office for Mac 2011.  I don't know if it's related or not,  but since doing so I have been unable to print PDF files using Adobe Acrobat 8. After opening a PDF file and hitting print, Adobe Acrobat 8 crashes. Any suggestions?  I already uninstalled and reinstalled Adobe Acrobat 8, but it still won't print PDF files. O

    While you are having difficulty in printing a PDF file, you may try the  subsequent steps. If you are in a rush and would like to print a simple  document such as a letter, a form, or a calendar, you may print it as an  image. Next option is that you may need to update your printer driver   if the PDF does not print, the PDF prints as a blank page or with  unreadable text or if you get an error message when you print.  Sometimes, when you print a file that is on a thumb drive or a network,  the file gets damaged. Then you have to open the copy on your hard drive  and print again. At last, you can try printing the PDF using another  printer and check your printer connection too if the PDF does not get  printed. get more help to fix unable to printer PDF file hope this helps you.
    Good Luck!

  • How to save .pdf file using office word and excel

    Can someone help me how to save .pdf files using office word and excel?  I reinstalled my adobe 7.0 pro in my new pc and before I was able to do it but with my old pc.

    For anything after Office 2003, you have to print to the Adobe PDF printer. If you installed AA 7 on OS newer than XP, you may have to do a workaround to get it to work. With later versions of WORD you can always use the MS plugin for creating PDFs.

  • Orarrp can't print pdf file directly to printer

    oracle remote print utility (orarrp) can't print pdf file directly to printer.
    we expect orarrp utility can handle ".rrpa" file (i.e. pdf file generated on the application server) by directly print the file to the client's printer, i.e. invoke the acrobat reader on the client side, display the the printer selection dialogue, after confirmation print the pdf file, then the acrobat reader close automatically nicely.
    However we are disappointed as the acrobat reader startup and display the pdf file content but does not print and does not close.
    After testing the problem several times, there are some findings:-
    Finding (A):-
    (a) for the success of direct printing of pdf file, a physical path must be provided; we have tried 2 methods:
    1) using drag & drop to copy the pdf file directly to the browser
    2) open pdf file in the browser directly using browser menu-->File-->Open.
    (b) for the failure of direct printing, a virtual path is involved and we have also tried 2 methods:
    1) when web.show_document() is used
    2) enter the url to the URL bar of the browser,
    eg. http://appsvr.com:7777/report/test_printout/APPSVR1094707.rrpa (this is a virtual path/url)
    Finding (B):-
    (a)when the physical path is used, a temporary pdf file is generated in the same directory where the rrpa file exists in the application server,
    e.g. in application server: d:/printout/yyy.pdf is generated for d:/printout/xxx.rrpa when direct print occurs
    (b) however when the virtual path is used, there is no such temp "pdf" file generated and direct print failed.
    May be when virtual path is used, orarrp utility don't know where to generate the temp "pdf" so direct print doesn't occur.
    So, anyone has similar experience or further queries or has solutions, please join.
    Thanks for your attention.

    Hi,
    It is really late to give response this post. But still who ever refering to this post for the same issue this solution is useful for achieving same in background:
    Even same can be used in smartforms, for getting spool request in PDF format as well which will decrease the size of file when printing in SAP printer.
    ct_tline is PDF output:
    DATA: lv_pdfsource TYPE xstring.
    FIELD-SYMBOLS:<p> TYPE x. " <p> type any.
    LOOP AT ct_tline INTO cs_tline.
      ASSIGN cs_tline TO <p> CASTING TYPE x.
      CONCATENATE lv_pdfsource <p> INTO lv_pdfsource IN BYTE MODE.
    ENDLOOP.
    * ->Create spool request in PDF format
    CALL FUNCTION 'ADS_CREATE_PDF_SPOOLJOB'
      EXPORTING
        printer  = 'LOCL'            "Printer name supporting PDF device type
    *   DEST     =
        pages    = 1
        pdf_data = lv_pdfsource        "XSTRING internal table
    *   NAME     =
    *   SUFFIX1  =
    *   SUFFIX2  =
    *   COPIES   =
    *   PRIO     =
        IMMEDIATE_PRINT         = 'X'
    *   AUTO_DELETE             =
    *   TITLELINE               =
    *   RECEIVER =
    *   DIVISION =
    *   AUTHORITY               =
    *   LIFETIME = '0'
    * IMPORTING
    *   SPOOLID  =
    * EXCEPTIONS
    *   NO_DATA  = 1
    *   NOT_PDF  = 2
    *   WRONG_DEVTYPE           = 3
    *   OPERATION_FAILED        = 4
    *   CANNOT_WRITE_FILE       = 5
    *   DEVICE_MISSING          = 6
    *   NO_SUCH_DEVICE          = 7
    *   OTHERS   = 8
    IF sy-subrc <> 0.
    * Implement suitable error handling here
    ENDIF.

  • Why I cannot print pdf files on my printer after update to Adobe Reader 10.1.3??

    Recently I update to Adobe Reader 10.1.3 and now I cannot print pdf files on my printer (bizhub C5501), why? Is anyone out
    there know how to solve this issue?

    This may be helpful:
    http://helpx.adobe.com/acrobat/kb/troubleshoot-pdf-printing-acrobat-reader.html

  • Query on processing a PDF file using Java mapping

    Hi All,
    i am trying to process a XML and PDF file using Java mapping, it is successful in XML but unable to do for PDF.
    below is the code i am using... can any one guide me how to process PDF's..
    byte byte1 = 0;     
    java.io.ByteArrayOutputStream bos = (ByteArrayOutputStream)outputstream;
    while((byte1=(byte)inputstream.read())!=-1){
    bos.write(byte1);
    bos.close(); 
    Thank You,
    Madhav

    Hi Madhav,
    I think instead of going with JAVA mapping you can write a custom adapter module for it.
    Ref:  /people/sap.user72/blog/2005/07/31/xi-read-data-from-pdf-file-in-sender-adapter
    Also check : Re: PI 7.1 : Taking a input PDF file and mapping it to a hexBinary attribute
    /people/shabarish.vijayakumar/blog/2009/05/17/trouble-writing-out-a-pdf-in-xipi
    Thanks,
    Edited by: Hareenkumar on Dec 21, 2010 11:12 AM

  • Reading/writing PDF files using JAVA

    how to read/write a PDF file using java,
    while i read a pdf file using BUfferedReader class it gives a list of char. which is not readable.
    how to convert those files to readable format.?
    is there any special class for doin that.?
    plz explain..?

    is there any special class for doin that.?Yes, I'm sure Google knows a few libraries that ca do that.

  • Reading PDF file Using java.

    I tried to read the pdf file using FileInputStream. but it gives the Juncked charectars.
    How can i read(means content) the pdf file using Java.

    I just found the "Multivalent" library, it is free and will do exactly what you want: http://www.cs.berkeley.edu/~phelps/Multivalent/
    Check out the source of the tools/ExtractText.java file
    Ed

  • How to read pdf file using file adapter

    Hi..
        How to read pdf file using file adapter?
    regards
    Arun

    Hi
    This may help you
    /people/sap.user72/blog/2005/07/27/xi-generate-pdf-file-out-of-file-adapter
    /people/alessandro.guarneri/blog/2007/02/21/sap-xi-acting-as-a-huge-file-mover
    ---Ram

Maybe you are looking for

  • Message problem

    I am using Nokia C7-00... I dnt know what is the problem wih it...! It is not replying for one of my contact number...! It is saying message sending failed.. Check the number and try again...!!! At end of message it is also showing message centre def

  • Cross tab - change column name

    Hi, I would like to change on my dashboard the name of the column in cross tab based on design studio. I know that it is possible to do that on back-end side and provide desired names in query selection but I will need to to that on Design Studio lev

  • Video capture card to use with WebEx

    Hi all, could someone share a list of compatible video capture cards to use in a PC in a WebEx session? The  ideia is to use an external camera (instead of a web cam) to capture the  video and I would like to know if this input will be sent as video

  • Multicam Video Rate

    Hello, I'm putting together 2-camera multiclips from HDV footage, and for some reason the Camera A timecode begins to drag behind the Multiclip Timecode by .03 per second. It would obviously seem that the Multiclip TC was somehow set at 30 fps, and a

  • Serious semaphore timeout is

    When I try to load the firmware I keep getting this message_ERROR - Operating system reported error: The semaphore timeout period has expired I?ve tried everything... any idea? thanx