我尝试动态创建并静默打印文档。问题是我需要缩放文档以适应页面。我尝试使用 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 - 输出相同。我应该怎么办?