How to print PDF under Java control

Hi, all - thank you for reading this message.
I'm working with Java 1.4.2_12 and Tomcat but planning to migrate upward Real Soon Now. We are running on Windows Server 2003 (customer's choice).
My application, using iText, creates a PDF, which comprises a new coversheet plus some existing PDFs appended. The new PDF is needed for archival. This part works OK.
Now, still in my Java app, I would like to print the new PDF, to a printer chosen in my code. At present I have only PCL and basic PS (2?) capable laser printers, mostly HPs, available and these are all networked - not local - printers.
I have tried some things using PrintService and this cannot find any PDF printers from the server, though for comparison it did correctly find some PostScript capable devices. Attempts to actually print have resulted in garbage, with the printer obviously mangling the PDF over several trees-worth of paper, if not stopped.
Has anyone else managed to 'filter' a PDF (under program control) and send it to a regular, networked printer, such as I have described?
Can anyone confirm that a PS 3 capable printer would handle a PDF direct and if so what DocFlavor would be appropriate?
Sorry if this is a trivial issue but I have spent quite some time on it and would appreciate any input.
Thanks - Edwin
Message was edited by:
EdwinBolton

jPDFPrint by Qoppa Software. It's a 100% java library to print PDF documents.

Similar Messages

  • 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

  • How to print PDF file with hp-ux 11.31 on itanium

    We finished upgrade from 11.5.7 to 12.1.1.
    With 11.5.7 ( pa-risc hp-ux 11.23 ) we print our pdf file in using acroread to convert them in postscript and print them to printer.
    In our 12.1.1 environment ( itanium hp-ux 11.31 ) ; acroread is not available on itanium.
    Which tool can we use to be able to print PDF file on itanium ( itanium pdf to postscript tool ) free
    Thanks
    Marc

    Pl see MOS Doc 778970.1 (How to Print PDF/UTF8 in R12?)
    HTH
    Srini

  • How to print "Text" in JAVA(TM)....

    Does anyone know how to print "text" using Java?
    - Here's an example output...
    NOTE: # == 'empty spaces'
    --------------------------- <- Paper
    |###################|
    |####Welcome#########|
    |###################|
    |########to##########|
    |###########JAVA(TM)##|
    |###################|
    |#######Programming####|
    |###################|
    Please post a complete << SAMPLE CODE >> for printing the "text" (Welcome to JAVA(TM) Programming. Including the indentions. So it will not be like this...
    -------------------- <- Paper
    |Welcome |
    |to |
    |JAVA(TM) |
    |Programming |
    | |
    | |
    | |
    | |
    Thanks.

    Please read How To Ask Questions The Smart Way

  • How to print PDF files

    How to print PDF files????

    Please see FAQ: How to print a PDF file from Adobe Reader Touch.
    If you don't see the Print button in the toolbar, please update to the latest version of Adobe Reader Touch.
    FAQ: How to update Adobe Reader Touch to the latest version
    The latest version (1.2) also includes newly supported features such as Commenting (adding Sticky Notes, Highlight, Strikeout, and Underline), Save/Save As, and Go to Page.
    Here's the blog post by Dennis Griffin (Product Manager for Adobe Reader for Tablets and Smartphones).
    Adobe Reader Touch for Windows 8 adds Comments and More

  • How to print PDF documents on Unix(Solaris)

    Hi ,
    I wanted to know how to print PDF documents on Unix(Solaris)?
    Is there a document or white paper that i can refer to start printing PDF document.
    What kind of drivers/utilities will be required to achieve the objective?
    Kiran

    Have you tried FOXIT? I think there is a trialversion. I tried Adobereader 2.5 but there is still no option to print.
    ‡Thank you for hitting the Blue/Green Star button‡
    N8-00 RM 596 V:111.030.0609; E71-1(05) RM 346 V: 500.21.009

  • 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

  • How to print PDF file from java application?

    Hi,
    I have a java application that needs to print an PDF files. Could any one provide me links to tutorial/sample codes for doing this?

    http://onesearch.sun.com/search/onesearch/index.jsp?qt=print+pdf+files&subCat=&site=dev&qp=&chooseCat=javaall&col=developer-forums

  • How to  print pdf file by using java print API ? I am trying with this code

    import java.io.FileInputStream;
    import java.io.InputStream;
    import javax.print.Doc;
    import javax.print.DocFlavor;
    import javax.print.DocPrintJob;
    import javax.print.PrintException;
    import javax.print.PrintService;
    import javax.print.PrintServiceLookup;
    import javax.print.SimpleDoc;
    import javax.print.attribute.HashPrintRequestAttributeSet;
    import javax.print.attribute.PrintRequestAttributeSet;
    import javax.print.attribute.standard.Copies;
    import javax.print.attribute.standard.MediaSizeName;
    public class PDFPrint {
    static public void print(InputStream inputStream, PrintService printService) throws PrintException {
    Doc doc = new SimpleDoc(inputStream, DocFlavor.INPUT_STREAM.AUTOSENSE, null);
    PrintRequestAttributeSet attributes = new HashPrintRequestAttributeSet();
    attributes.add(MediaSizeName.ISO_A4);
    attributes.add(new Copies(1));
    print(doc, attributes, printService);
    }//print()
    static public void print(Doc doc, PrintRequestAttributeSet attributes, PrintService printService) throws PrintException {
    if (printService == null) {
    printService = PrintServiceLookup.lookupDefaultPrintService();
    System.out.println("The Printer Name is :"+printService.getName());
    DocPrintJob docPrintJob = printService.createPrintJob();
    System.out.println("Before Print Start()");
    docPrintJob.print(doc, attributes);
    }//print()
    public static void main(String args[])
    PrintService defaultPrintService = PrintServiceLookup.lookupDefaultPrintService();
    String file="c:/BackUp/file.pdf";
    FileInputStream fis=new FileInputStream(file);
    System.out.println("Before Print() called ..");
    print(fis,defaultPrintService);
    System.out.println("After Printing....");
    I am using this code to print pdf file. But when I try this one automatically the printer starting with print ascii codes with infinite loop.
    I am using jdk1.4,Acrobat 8.0, Windows environment.
    Can u help me in this regard'
    Thank u
    grani

    import java.io.FileInputStream;
    import java.io.InputStream;
    import javax.print.Doc;
    import javax.print.DocFlavor;
    import javax.print.DocPrintJob;
    import javax.print.PrintException;
    import javax.print.PrintService;
    import javax.print.PrintServiceLookup;
    import javax.print.SimpleDoc;
    import javax.print.attribute.HashPrintRequestAttributeSet;
    import javax.print.attribute.PrintRequestAttributeSet;
    import javax.print.attribute.standard.Copies;
    import javax.print.attribute.standard.MediaSizeName;
    public class PDFPrint {
    static public void print(InputStream inputStream, PrintService printService) throws PrintException {
    Doc doc = new SimpleDoc(inputStream, DocFlavor.INPUT_STREAM.AUTOSENSE, null);
    PrintRequestAttributeSet attributes = new HashPrintRequestAttributeSet();
    attributes.add(MediaSizeName.ISO_A4);
    attributes.add(new Copies(1));
    print(doc, attributes, printService);
    }//print()
    static public void print(Doc doc, PrintRequestAttributeSet attributes, PrintService printService) throws PrintException {
    if (printService == null) {
    printService = PrintServiceLookup.lookupDefaultPrintService();
    System.out.println("The Printer Name is :"+printService.getName());
    DocPrintJob docPrintJob = printService.createPrintJob();
    System.out.println("Before Print Start()");
    docPrintJob.print(doc, attributes);
    }//print()
    public static void main(String args[])
    PrintService defaultPrintService = PrintServiceLookup.lookupDefaultPrintService();
    String file="c:/BackUp/file.pdf";
    FileInputStream fis=new FileInputStream(file);
    System.out.println("Before Print() called ..");
    print(fis,defaultPrintService);
    System.out.println("After Printing....");
    I am using this code to print pdf file. But when I try this one automatically the printer starting with print ascii codes with infinite loop.
    I am using jdk1.4,Acrobat 8.0, Windows environment.
    Can u help me in this regard'
    Thank u
    grani

  • How to print PDF in Preview

    Hi
    This is probably glaringly obvious but I can't work out how to print pages 1-4 of a PDF onto 1 sheet of paper using Preview Print setup. i get 4 copies of the same page ..any suggestions?

    solved it myself.. under orientation ..preview - Layout- pages per sheet

  • How to print PDF file with PLD

    Hi Experts,
    We have three Annexure copy in PDF and wants to print with sales quotation PLD.
    Pls tell me how to print this.
    Regards,
    Datta Kharat

    Hi Jennifer,
    I dont want to print the PLD in PDF.
    I have Annexture copy in PDF which has to along print with PLD at the end of PLD print.
    I have stored this PDF in attachment folder on B1_SHR.
    and given the link option in UDF on Sales Quotation.
    Now I want If i click on PLD print first PLD should be print then automatcally the PDF has to print which has to attached with UDF.
    Regards,
    Datta kharat

  • How to print pdf files not using acrobat product?

    i just want to print pdf files,but not want to use the adobe acrobat or acrobat reader,just want to write a tools print pdf files directly.

    > no i just want to print it,not need to read it.can you help me?
    Well, the problem is to print it you need to be able to read it. Something needs to convert it into a format the printer can understand (most printers are PostScript or PCL).
    I'm not sure you entirely understand what a PDF file is. It's not a fancy text file. It's a binary format. Saying "I want to print a PDF without a PDF interpreter" is like saying "I want to run an EXE without Windows". You need software to interpret the format.
    You certainly can write your own software to interpret the PDF format, convert it to a print language and output that to a printer, but as Aandi said you will need to start by reading the PDF Reference so you know how the inside of a PDF file works, and it will most likely take several years of development even for a seasoned, expert programmer. It's just not as simple as "Printer, meet PDF. PDF, meet printer."

  • Funtion is returning jstring, how to print it in java code

    Plz let me know how to print a jstirng which is returning by a native function in java.
    When i use System.out.print(view());
    it gives me error.
    what i shoulr do with jsting so that i can use/print it in java.

    dscdscWhat do you mean by that?

  • How to print pdf on a legal sized paper

    I can't seem to print pdf files on legal sized paper properly. They always shrink it down. I have tried going to "paper handling" and clicking "scale to fit paper size" to US Legal.
    On Copies and Pages I have to click "Fit to Printable Area" otherwise the document gets cut because the printable area is only 8 x 11.
    I guess what I'm trying to say is how do I increase the printable area?

    Hi amanyeah,
    Is it Legal size to start with?
    If it is not, then you'll need to Save as..., like a tiff or jpeg & resize it to 8.5"*14" in say GraphicConverter...
    http://www.macupdate.com/info.php/id/263
    Did you go to Page Setup and switch the Paper size to Legal?

  • How to print PDF report by clicking a button

    Hi,
    I'm using oracle 10g developer suite. i've developed a form clicking a button calling a PDF report. But i do not want to show PDF report. i want to auto print PDF report by clicking a button.
    Plz help me.

    Just follow the Oracle reports 10g output directly to printer and you will able to print directly
    Hope this helps
    Hamid
    If response is helpful or correct mark it.

Maybe you are looking for

  • Problems trying to install configuration manager.

    Hi I've been trying to install SCCM 2012 onto a 2012R2 server. It is the second server on the network. The first is the domain controller, DNS and DHCP server. First I try to enable the roles specified BITS etc. Then I install SQL server 2012. Then I

  • Problem while running SOA Server

    Hi, i'm trying to starting SOA server. I started Admin Server successfully but I have problems while starting SOA server. When i'm trying to do that i get many errors, last three lines in console are following: 12 mismatched character '<EOF>' expecti

  • Why does Adobe Premiere CC crash whenever I put a new sequence in?

    Just tonight, while editing for my short video with my new capture card, an interesting problem occurred. Whenever I paste a clip of any kind, no matter the format or the quality, I put it into a new sequence and it takes just 3 seconds to crash adob

  • Ejecution of an scenario using the scheduling of a scenar

    Hi Guys, I am runing some interfaces using there schedule of an agent. I have two variables that take value like START_DATE='20120401' and END_DATE='20120402' but I need that the value assigned to these variables can be set taking the function sysdat

  • Windows 7 updater repeats its updates

    windows 7 updater repeats its updates walter shebib