Publish a printdocument derived object that supports printing a large number of texts and publish the source code.

Source: Internet
Author: User
Recently, there is a requirement in a project that requires one or more big texts, just like the ones in my graduation thesis. ArticleOutput to the printer. I have referred to many public libraries including codeproject. Source codeIn the codeproject CodeThe examples are for English text, but the method for measuring and calculating the size of Chinese strings using English code is not good, and text loss often occurs.

So I refer to a part of the Code on the codeproject and wrote the text printing code after I modified it again.

Function:
1 has three constructors: the non-parameter constructor, the string parameter constructor, and the stream parameter constructor, indicating that it can be a large string, obtain the content to be printed from a data stream.

2. You can define the number of lines printed per page.

3. You can customize the content of the header and footer.

4. Automatic printing and paging.

Disadvantages:
1. process the Chinese formatAlgorithmNot perfect yet. The line spacing during print preview is too close and ugly.
2. Unlike the word, the title and other content in the text cannot be processed with special font styles, that is, all printed text fonts are the same.

Click here to download

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.