Print on continuous paper using c#

梦想与她 提交于 2019-12-18 07:46:36

问题


I write a one POS system. I want to print on continuous paper but I don't figure out how I can accomplish this.

I use the .net (C#). I try with crystal report as well as System.drawing classes.

Any idea will be helpful for me...


回答1:


If you're using a C# PrintDocument to generate your print job, could you just initialize the paper size to what you need for header/footer then increment the PageHeight property before you draw a new line?

printdoc.DefaultPageSettings.PaperSize.Height += lineheight;



回答2:


I think you have three options: 1) You can precalculate the pagesize before printing 2) While you're printing the items check the Y position and compare it to the maximum Y position for items. If it's greater than maximum, print footer and ajust the Y positions for the un printed items. 3) Design an invisible box for each items and calculate how many of them fit in a page. Then you just need to divide the items in pages.

I hope my English is good enough.



来源:https://stackoverflow.com/questions/4064103/print-on-continuous-paper-using-c-sharp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!