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.