remo
remo

Reputation: 3484

JEditor pane printing issue with Horizontal scroll bar

We use Jeditor pane for displaying HTML text, but when we try to print with horizontal scroll bar on editor pane the right edge of the page is cut off, Did any experience it? Any ideas on fixing this?

Upvotes: 1

Views: 231

Answers (2)

StanislavL
StanislavL

Reputation: 57381

I think that happens because printer page width is less than your JEditorPane's width.

You can try something like this http://java-sl.com/JEditorPanePrinter.html

Obtain the page's widht, calculate it in pixels and set it to your JEditorPane. See PageFormat.

Upvotes: 0

spot35
spot35

Reputation: 888

I think this will be because the preferredSize of the viewport component is now unlimited. You could try manually setting the preferredWidth of the underlying viewport component.

Upvotes: 1

Related Questions