作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我尝试动态创建并静默打印文档。问题是我需要缩放文档以适合页面。我尝试使用 PrintTicket.PageScalingFactor 但它不起作用:当打印机打印文档时,PageScalingFactor=50 和 PageScalingFactor=250 之间没有区别。 PageScalingFactor 不影响任何东西。这是一个代码片段:创建 PrintTickets:
PrintTicket tkt = new PrintTicket();
tkt.Collation = Collation.Uncollated;
tkt.CopyCount = 1;
tkt.DeviceFontSubstitution = DeviceFontSubstitution.On;
tkt.Duplexing = Duplexing.OneSided;
tkt.InputBin = InputBin.AutoSelect;
tkt.OutputColor = OutputColor.Monochrome;
tkt.PageMediaSize = new PageMediaSize(PageMediaSizeName.ISOA9);
tkt.PageMediaType = PageMediaType.Unknown;
tkt.PageOrder = PageOrder.Standard;
tkt.PageOrientation = PageOrientation.Portrait;
tkt.PageResolution = new PageResolution(PageQualitativeResolution.Draft);
tkt.PageScalingFactor = 40;
tkt.PagesPerSheet = 1;
tkt.TrueTypeFontMode = TrueTypeFontMode.DownloadAsOutlineFont;
StackPanel myPanel = new StackPanel();
myPanel.Margin = new Thickness(15);
设置 PrintQueue 和用数据填充 StackPanel 并不重要打印:
myPanel.Measure(new Size(dialog.PrintableAreaWidth,
dialog.PrintableAreaHeight));
myPanel.Arrange(new Rect(new Point(0, 0),
myPanel.DesiredSize));
dial2.PrintVisual(myPanel, "A Great Image.");
我将 PageScalingFactor 设置为 40、100、250 - 输出相同。我该怎么办?
最佳答案
PageScaling 功能是否设置为 CustomSquare?
关于c# - 为什么 PageScalingFactor 不影响任何东西?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13193834/
我尝试动态创建并静默打印文档。问题是我需要缩放文档以适合页面。我尝试使用 PrintTicket.PageScalingFactor 但它不起作用:当打印机打印文档时,PageScalingFacto
我是一名优秀的程序员,十分优秀!