Wordwrapping when printing
-
I am designing my print form but im having a small problem, some strings that I am wanting to print are longer than the print bounds and I would like to know if there is a way to make the string print within the bounds and wrap to the next line when it hits those bounds?
-
I am designing my print form but im having a small problem, some strings that I am wanting to print are longer than the print bounds and I would like to know if there is a way to make the string print within the bounds and wrap to the next line when it hits those bounds?
Hi, the application that shows stuff on the screen is also responsible for formatting it while printing. It could use the same PaintEvent handler for doing so. Amongst others this means the application itself must do any word wrapping that is required. Printing may vary from simple to complex depending on functionality: - if the screen also shows pages (as in MS Word when viewing "Print layout", then nothing much has to change for printing (except some border settings, and scaling that is) - if the screen only shows continuous data (as in Word's "Normal view", or in a simple text editor) then new code is required to figure out page boundaries etc. - furthermore there are issues around printer selection, page settings (per document? per page?), duplex printing, etc. So my advice is to separate all these concerns as much as possible. For one this implies providing a "page mode" or "print layout" view capability to your app (at least during the development phase, but then why not keep it?), in order to separate the different problem domains. Good luck ! :)
Luc Pattyn