Printing a string to multi-page

H

Hai Ly Hoang

Hi,
I have string which contains linefeed and carry-return characters (eg.
"Banana \r\n Apple \r\n...");
To print this string, i make use of PrintPage event of PrintDocument with
DrawString methods.

It causes a trouble, when the string is covered more than one-page when
being printed, some of the string will disapper.

How to solve this trouble ?
 
M

Michael Mayer

Hai Ly Hoang said:
I have string which contains linefeed and carry-return characters (eg.
"Banana \r\n Apple \r\n...");
To print this string, i make use of PrintPage event of PrintDocument with
DrawString methods.

It causes a trouble, when the string is covered more than one-page when
being printed, some of the string will disapper.

Take a look at the StringFormat and StringTrimming used in
graphics.DrawString overloads. Here's an article that goes into some
details on these trimming types:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwinforms/html/printwinforms.asp

(it's in vb.net but you should have no problem understanding what he's
talking about)

Additionally, if you'd like more info, have a look at my printing library
and some of the links from this page:
http://www.mag37.com/projects/Printing/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top