Example #1
0
 private static void Print(string x, Canvas mainWindowMainCanvas, bool MBLConfigureXpsPrintOn, bool MBLConfigureMFGOn, double w, double h, bool IsSizeAuto)
 { //加载图片到Image对象
     try
     {
         if (MBLConfigureXpsPrintOn)
         {
             LogHelper.Log("XpsEx PrintOn");
             XpsEx.GenerateXps(x + ".xps", mainWindowMainCanvas);
         }
         if (MBLConfigureMFGOn || !MBLConfigureXpsPrintOn)
         {
             LogHelper.Log("MFG PrintOn ");
             gbmp = x;
             System.Drawing.Printing.PrintDocument pd = new System.Drawing.Printing.PrintDocument();//Refreshpd();//
             pd.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(pd_PrintPage);
             pd.Print();
         }
     }
     catch (Exception ee)
     {
         LogHelper.Log("Print Exception" + ee.ToString());
     }
 }
Example #2
0
 public static bool ExportToXps(string path, Canvas surface)
 {
     return(XpsEx.GenerateXps(path, surface));
 }