Results 1 to 7 of 7
  1. #1
    BobswYourUcle is offline Member
    Join Date
    Mar 2011
    Posts
    23
    Rep Power
    0

    Default Printing to browser

    Hello,

    I have a ByteArrayOutputStream, is it possible to print this through the browser? I have looked for examples and to my surprise I have found none.

    Thanks.

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,899
    Rep Power
    25

    Default

    to print this through the browser?
    Can you explain this?
    Is the output to be read by the browser? What is the browser supposed to do with it?
    Normally browser's either read html files from a disk or ask servers for some html.
    Or is the output do be displayed in an applet being hosted by the browser?
    Or do you want an applet running in a browser to be able to user the local printer?

  3. #3
    BobswYourUcle is offline Member
    Join Date
    Mar 2011
    Posts
    23
    Rep Power
    0

    Default

    Sorry,

    I have a ByteArrayOutputStream. I do not want to display what is whitin the ByteArrayOutputStream to the screen but use the browsers print functionality to print it.
    For instance in IE if you click file > print I want to be able to send the ByteArrayOutputStream to that browser functionality.

    Do you know if this is possible?

    Thanks

  4. #4
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,899
    Rep Power
    25

    Default

    What does the browser's "Print" button print?
    Is it the contents of a rendered HTML that is being shown?
    Are you asking: If there is a way to tell the browser to print something else besides what it is showing in its window?

    Are there any browser plugins that can intercept the Print button press and do their own thing?

  5. #5
    Dark's Avatar
    Dark is offline Senior Member
    Join Date
    Apr 2011
    Location
    Camp Lejuene, North Carolina
    Posts
    643
    Rep Power
    4

    Default

    You could possibly code a button on your webpage that prints the byteoutputstream, but I don't think you can make the browser only print that using its built in print function.
    • Use [code][/code] tags when posting code. That way people don't want to stab their eyes out when trying to help you.
    • +Rep people for helpful posts.

  6. #6
    BobswYourUcle is offline Member
    Join Date
    Mar 2011
    Posts
    23
    Rep Power
    0

    Default

    tahnsk again for your reply.

    I found that if I use iText and the the line:
    Java Code:
    com.lowagie.tools.Executable.printDocument("c:/test.pdf");
    it will do what I need.

    However I want to do this without a file as I do not want to save it. I need to find a way to print with a stream.

    Thanks again

  7. #7
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,224
    Rep Power
    20

    Default

    Use the Java Print Service?

    Of course we still have no idea where you are planning on printing from...

Similar Threads

  1. printing string backwards and printing every other
    By droidus in forum New To Java
    Replies: 22
    Last Post: 03-10-2011, 10:17 AM
  2. Web Browser
    By rao2141 in forum New To Java
    Replies: 4
    Last Post: 10-25-2010, 01:04 PM
  3. SWT browser help
    By MarkWilson in forum SWT / JFace
    Replies: 1
    Last Post: 04-07-2009, 11:56 AM
  4. Browser help
    By MarkWilson in forum Advanced Java
    Replies: 5
    Last Post: 09-20-2008, 12:20 PM
  5. how to get url from browser
    By srinivas reddy in forum New To Java
    Replies: 0
    Last Post: 02-08-2008, 08:46 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •