private static void PrintControl(IWin32Window owner, LinkBase link, UserLookAndFeel lookAndFeel) { using PrintingSystem ps = new PrintingSystem(); link.PrintingSystemBase = ps; ps.Links.Add(link); using (new WaitCursor()) { link.CreateDocument(ps); } using var printTool = new PrintTool(ps); printTool.ShowRibbonPreviewDialog(owner, lookAndFeel); }
private static void ExecutePrintCommand(LinkBase link, PrintingSystemCommand command, object[] args) { using PrintingSystem ps = new PrintingSystem(); using (new WaitCursor()) { link.CreateDocument(ps); } using var printTool = new PrintTool(ps); if (args != null) { printTool.PreviewRibbonForm.PrintControl.ExecCommand(command, args); } else { printTool.PreviewRibbonForm.PrintControl.ExecCommand(command); } }