コード例 #1
0
ファイル: PrintDocument.cs プロジェクト: 15831944/TabacLS
        private void print(Figure figure, int index, String path)
        {
            vdPrint printer = figure.getDocument().Model.Printer;

            //printer.DocumentName = lineNo.ToString();
            printer.PrinterName     = path + "\\" + index + ".pdf";
            printer.Resolution      = 300;
            printer.OutInBlackWhite = true;
            printer.paperSize       = new System.Drawing.Rectangle(0, 0, 827, 1169);//A4
            printer.LandScape       = false;
            printer.PrintExtents();
            printer.PrintScaleToFit();
            printer.CenterDrawingToPaper();
            printer.PrintOut();
        }
コード例 #2
0
 /// <summary>
 /// 保存为Pdf
 /// </summary>
 public void saveAsPdf(String fileName)
 {
     try
     {
         vdPrint printer = document.Model.Printer;
         //printer.DocumentName = lineNo.ToString();
         printer.PrinterName     = fileName;
         printer.Resolution      = 300;
         printer.OutInBlackWhite = true;
         printer.paperSize       = new System.Drawing.Rectangle(0, 0, 827, 1169);//A4
         printer.LandScape       = false;
         printer.PrintExtents();
         printer.PrintScaleToFit();
         printer.CenterDrawingToPaper();
         printer.PrintOut();
     }
     catch { }
     finally
     {
     }
 }