Finally, we partially solved the problem of customizing papersize in. Net drawing. Printing.

Source: Internet
Author: User

The problem that plagued me for a week has finally been solved.
Now the project needs to print all kinds of Bill printers are LQ-1600KIII dot matrix printers
Because the size of each bill is different, the paper height is different.
So we need to control the length of the printer paper to print one piece.

First set this way

Printdoc. defaultpagesettings. papersize = New Papersize ( " Custom " , 949 , 300 );

Unsuccessful

Later I thought about whether the printer had to add the custom paper,
So go to the printer and fax folder --> right-click --> server Properties
Added the custom paper type name 949w300h width 9.49in, height 3.00in
ThenProgramChange
Printdoc. defaultpagesettings. papersize = new papersize ("949w300h", 949,300 );
But still not.

It took n days to complete the experiment. Today, I suddenly remembered whether the new papersize would not work.
So I changed the program

Foreach (Papersize PS In Printdoc. printersettings. papersizes)
{
  If (PS. papername = " 949w300h " )
{
Printdoc. printersettings. defaultpagesettings. papersize = PS;
Printdoc. defaultpagesettings. papersize = PS;
}
}

It seems that the paper can only be selected from printdoc. printersettings. papersizes.
....
Although the problem has been solved
However, you still need to add paper for various bills. After all, there are many types of bills.
You must use the printer and fax folder --> right-click --> server properties to add
Is there a way to directly control the program without adding custom paper?

I think word has this function. You can specify the paper size when printing, instead of adding custom paper types.

Thank you for your advice.

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.