• Post Reply Bookmark Topic Watch Topic
  • New Topic

Print Multi page JEditorPane html contents in Java  RSS feed

Kevin Dsouza
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
down vote favorite
share [fb] share [tw]

I have developed a code in Java where I have embedded HTML content into a JEditorPane by setting its content type to text / html.

However this content spills over to the second page and so on. I know that the JEditorPane has a print() method that prints the contents of the JEditorPane and I know that the print() method of the JEditorPane prints all the contents of the JEditorPane and even prints multiple pages.

What I want is that the top, left, right and bottom margins should be set to 0.

If I would simply leave the work of setting the margins to 0 at run-time by changing the print settings before printing, it would just not work.

Due to this I had to implement the Printable interface. But when I used the Printable interface it allows to print only the first page of the JEditorPane.

When I searched a lot for this solution I got this link on Google;


But the problem here is that I am using html contents in the JEditorPane. I dont know how to integrate the above solution provided in the link with a JEditorPane that consists of HTML Code
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!