This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
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;