Re: Problem - I want to print Current Output of Pdf file and shouldprint once.I get print dialog bo

Discussion in 'Java' started by Lew, May 30, 2007.

  1. Lew

    Lew Guest

    keto wrote:
    > multiposted


    Please do not multi-post. I have cross-posted this to the two groups where I
    read your posts.

    > public void doPost(HttpServletRequest request, HttpServletResponse
    > response)
    > throws ServletException, IOException {
    >
    > String strId="QI0001";
    > ByteArrayOutputStream baosPDF = generatePDFDocumentBytes(strId);
    > response.setContentType("application/pdf");
    > response.setContentLength(baosPDF.size());
    > ServletOutputStream out = response.getOutputStream();
    > baosPDF.writeTo(out);
    > out.flush();
    > try {
    > if (showPrintDialog){
    > if (printJob.printDialog()){
    > printJob.print();
    > }
    > }
    > } catch (Exception PrintException) {
    > PrintException.printStackTrace();
    > }


    Are you mixing Swing and servlets? That doesn't work.

    If you are writing a web app, which is not clear here, the PDF display in the
    browser will include a print button.

    Who do you imagine would respond to a server-side print dialog?

    > I get print dialog box


    Where?

    --
    Lew
     
    Lew, May 30, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. The One
    Replies:
    5
    Views:
    588
    Steve W. Jackson
    Nov 29, 2006
  2. keto
    Replies:
    0
    Views:
    1,043
  3. Ricardo Pog
    Replies:
    1
    Views:
    488
    Austin Ziegler
    Mar 26, 2008
  4. Matt
    Replies:
    1
    Views:
    305
    Randy Webb
    Nov 20, 2004
  5. Replies:
    4
    Views:
    181
    Ted Zlatanov
    Sep 13, 2006
Loading...

Share This Page