Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
            }
        }