Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JEditorPane - Unprinted Elements  RSS feed

 
Darren Hamilton
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm using a JEditorPane to print html documents, I have a test set of documents that don't seem to be printing too well.

The HTML document has an image and a table.

Both do display correctly, but when printed in a loop, the first page rarely prints the image, all other pages can either:

print a small portion of the image,
clip the bottom border of the table,
print completely fine.

All this is done in a loop, so there is no difference between the pages. It's definitely not the printer. I have used several just in case.

Any ideas?

EDIT: Now I am home, I can show you test code that demonstrates the problem.

Note: Don't select a real printer, use "Print To File" or "One Note".

My *guess* is that the image has not yet fully been drawn when it goes to print, and that if left longer, it would finish drawing it, then go to print.

If I'm right, how do I check before I print?



I am also sure there are better ways to print multiple pages, but most of the guides I could find where either:

  • Very Old
  • Overly Complicated
  • Poorly disguised ads for 3rd party utilities


  • [ February 11, 2008: Message edited by: Darren Hamilton ]
     
    Darren Hamilton
    Greenhorn
    Posts: 3
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Originally posted by Darren Hamilton:
    I'm using a JEditorPane to print html documents, I have a test set of documents that don't seem to be printing too well.

    The HTML document has an image and a table.

    Both do display correctly, but when printed in a loop, the first page rarely prints the image, all other pages can either:

    print a small portion of the image,
    clip the bottom border of the table,
    print completely fine.

    All this is done in a loop, so there is no difference between the pages. It's definitely not the printer. I have used several just in case.

    Any ideas?

    EDIT: Now I am home, I can show you test code that demonstrates the problem.

    Note: Don't select a real printer, use "Print To File" or "One Note".

    My *guess* is that the image has not yet fully been drawn when it goes to print, and that if left longer, it would finish drawing it, then go to print.

    If I'm right, how do I check before I print?



    I am also sure there are better ways to print multiple pages, but most of the guides I could find where either:

  • Very Old
  • Overly Complicated
  • Poorly disguised ads for 3rd party utilities


  • [ February 11, 2008: Message edited by: Darren Hamilton ]
     
    Don't get me started about those stupid light bulbs.
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!