Title: RE: [iText-questions] Re: Problem printing iText PDFs on Solaris using iprint command


    -----Original Message-----
    From:   [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED]

    Sent:   Tuesday, February 10, 2004 3:49
    To:     [EMAIL PROTECTED]
    Subject:        [iText-questions] Re: Problem printing iText PDFs on Solaris using iprint command


    Further investigation has determined that "iprint" is a shell script that uses "file" command to determine the type of file to be printed.
    What is happening is that the file command thinks that PDFs created with iText are "data" not PDF.

    So, they open in the viewer but are not PDF??!!

     It works fine for PDFs created from XSL-FO, which don't even start with %PDF.

    They start with what? Are you sure they are PDFs?

    The PDFs are passed to ghostscript to generate postscript that is sent to the printer using "lp".

    I've used gs to convert PDFs produced with iText to TIFF.
    Can you print PDFs created with Acrobat?

    Best Regards,
    Paulo Soares

    If I can't sort this out then I will have to recommend we spend $5000 USD to get a commercial PDF library  :-(


            Ross Dyson

    06/02/2004 09:45 AM
           
                      To:         [EMAIL PROTECTED]
                       cc:
            Subject & File Ref: Problem printing iText PDFs on Solaris using iprint command


    My application currently creates PDF files for printing.  They are printed from Solaris on the server using the "iprint" command.

    When a user wishes to do a reprint of a number of documents, it is best to join them together so that they come out on the printer as 1 job.

    I have started testing with iText, adapting some example code to open an existing PDF, add a watermark and write on the page.  The files produced open fine in Adobe PDF viewer, but they do not print with iPrint.  A service copies them to a temp file (see "163") below, then shells to call iprint.

    //sample: iprint -p it12 -f si.txt -o orientation=protrait
          String[] args = new String[]{prtCommand, "-p", printerName, "-f", file.getAbsolutePath(),
                                       
    "-o", orientationOption};

          StringBuffer cmdOutput =
    new StringBuffer();
         
    int retValue = p.execute(args, cmdOutput);
         
    if ( retValue != 0 )
           
    throw new PrintException("Fail to print, reason: "+cmdOutput.toString());


    Error:

    print.core.PrintException: Fail to print, reason: Unrecognised file format: /usr/local/bea2/weblogic61SP1/./163:        data

            at weblogic.iiop.OutboundRequestImpl.sendReceive(OutboundRequestImpl.java:48)

    Has anyone seen this before?

Reply via email to