Receipt printers and endless paper reel
Posted: Tue Dec 08, 2009 10:30 am
Hi
Just to summarize all the thoughts mentioned above:
Assume that the report template has only one page in the Designer.
So to print the report on reel paper you need to specify the papersource, paperkind, and page size
report.Pages[0].PaperSize = System.Drawing.Printing.PaperKind.Custom;
report.Pages[0].PaperSourceFirstPage = System.Drawing.Printing.PaperSourceKind.Custom;
report.Pages[0].PaperSourceOtherPages = System.Drawing.Printing.PaperSourceKind.Custom;
report.Pages[0].Height = your height of one page;
report.Pages[0].Width = your width of one page;
report.Render();
report.Print();
But there is no one universal rule for all printers, for example let's take a simple printer Canon Pixma-4600:
PaperSourceKind for this printer contains five different values. One from them is 'Automatic' and others are Custom.
So the settings of the printer contain PapersSource structure and only inner part of that structure has a PaperSourceKind type.
So not always possible to specify a PaperSource parameter of the Page in the report explicitly.
In such cases all we can do is to use a PrintDialog standard windows dialogue for setting of the printer parameters.
We constantly receive Emails from our customers with confirmation of the fact that some printer drivers require specifying in their properties of exactly the same format name from their inner list. If the paper format was not from the printer's inner list then the default format will be used instead. And the same situation with a PaperSource parameter.
Sometimes if a PaperKind was set correctly, but the PaperSource was not set properly, all print settings could be reset in their default value.
Thank you.
Just to summarize all the thoughts mentioned above:
Assume that the report template has only one page in the Designer.
So to print the report on reel paper you need to specify the papersource, paperkind, and page size
report.Pages[0].PaperSize = System.Drawing.Printing.PaperKind.Custom;
report.Pages[0].PaperSourceFirstPage = System.Drawing.Printing.PaperSourceKind.Custom;
report.Pages[0].PaperSourceOtherPages = System.Drawing.Printing.PaperSourceKind.Custom;
report.Pages[0].Height = your height of one page;
report.Pages[0].Width = your width of one page;
report.Render();
report.Print();
But there is no one universal rule for all printers, for example let's take a simple printer Canon Pixma-4600:
PaperSourceKind for this printer contains five different values. One from them is 'Automatic' and others are Custom.
So the settings of the printer contain PapersSource structure and only inner part of that structure has a PaperSourceKind type.
So not always possible to specify a PaperSource parameter of the Page in the report explicitly.
In such cases all we can do is to use a PrintDialog standard windows dialogue for setting of the printer parameters.
We constantly receive Emails from our customers with confirmation of the fact that some printer drivers require specifying in their properties of exactly the same format name from their inner list. If the paper format was not from the printer's inner list then the default format will be used instead. And the same situation with a PaperSource parameter.
Sometimes if a PaperKind was set correctly, but the PaperSource was not set properly, all print settings could be reset in their default value.
Thank you.