How could print a line without ending the page?
-
I want to do some printing randomly, each time print a single line. When I use EndDoc() or Escape(ENDDOC), the printer ends a page. How could I do printing like the POS terminal printer?
-
I want to do some printing randomly, each time print a single line. When I use EndDoc() or Escape(ENDDOC), the printer ends a page. How could I do printing like the POS terminal printer?
When printing, anything rendered to the printer HDC between calls to the StartPage()/EndPage() calls will be printed for that page (as long as its on the actual printable area). So you would be doing something like:
StartDoc()
while (pages_to_print)
{
StartPage()
while (output_for_this_page)
{
print_a_line
}
EndPage()
}
EndDoc()If you need to print like a terminal, you need to keep track of the current Y position on the page. After every line printed, you increment y value by the height of the line. When y > pageHeight, you end the current page and start a new one.
StartDoc()
while (pages_to_print)
{
StartPage()
y = 0
while (output_for_this_page)
{
print_a_line at 0,y
y += lineHeight
}
EndPage()
}
EndDoc()Roger Allen - Sonork 100.10016 If your dead and reading this, then you have no life!
-
I want to do some printing randomly, each time print a single line. When I use EndDoc() or Escape(ENDDOC), the printer ends a page. How could I do printing like the POS terminal printer?
StartDoc / EndDoc - designed to protect multipage documents from interspersed with others. PrintJob is suspended until EndDoc is called. >How could I do printing like the POS terminal printer? For remote spoolers - you can not, should not, and will not be allowed to; local - open device e.g. par port/usb and write directly. Even if local with direct write it still likely not work with most modern printers: laser printers, etc .... Brian
-
When printing, anything rendered to the printer HDC between calls to the StartPage()/EndPage() calls will be printed for that page (as long as its on the actual printable area). So you would be doing something like:
StartDoc()
while (pages_to_print)
{
StartPage()
while (output_for_this_page)
{
print_a_line
}
EndPage()
}
EndDoc()If you need to print like a terminal, you need to keep track of the current Y position on the page. After every line printed, you increment y value by the height of the line. When y > pageHeight, you end the current page and start a new one.
StartDoc()
while (pages_to_print)
{
StartPage()
y = 0
while (output_for_this_page)
{
print_a_line at 0,y
y += lineHeight
}
EndPage()
}
EndDoc()Roger Allen - Sonork 100.10016 If your dead and reading this, then you have no life!
But if I do not call EndPage() or EndDoc(),I could not get the line. I want to see something printed when I print a line. How? Thank u!