本文介绍了如何从打印预览中删除或更改边距?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试从打印预览中删除边距,或将其更改为1px。但它只是没有改变。
我尝试过:
I'm trying to remove the margins from the print preview, or change it to 1px. But it just doesn't change.
What I have tried:
public void Printing()
{
PrintDocument pd = new PrintDocument();
pd.PrintPage += new PrintPageEventHandler(printDocument1_PrintPage);
Margins margins = new Margins(1, 1, 1, 1);
printDocument1.DefaultPageSettings.Margins = margins;
}
推荐答案
PrintDocument pd = new PrintDocument();
pd.PrintPage += new PrintPageEventHandler(printDocument1_PrintPage);
然后设置一个完全不同的边距:
Then you set the margins for a totally different one:
Margins margins = new Margins(1, 1, 1, 1);
printDocument1.DefaultPageSettings.Margins = margins;
这篇关于如何从打印预览中删除或更改边距?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!