How to create Excel file with EPPlus for A4 paper

穿精又带淫゛_ 提交于 2019-12-05 18:59:09

I found the solution.

EPPlus has a printerSettings for this. The line to use is

ws.PrinterSettings.FitToPage = true;

By using this, the default files properties force Excel to print the data in only one page.

Hope this help some other devs.

You can also use this line of code for a specific paper size:

ws.PrinterSettings.PaperSize = ePaperSize.A4;

Hopte this helps some others people.

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