Beispiel #1
0
 private void Page_Load(object sender, System.EventArgs e)
 {
     PdfDistiller dist = new PdfDistillerClass();
     dist.bSpoolJobs = 1;
     dist.bShowWindow = 0;
     dist.FileToPDF(@"C:\Documents and Settings\raghunandanr\Desktop\measure list.ps",null,null);
 }
Beispiel #2
0
 private void x()
 {
     Excel.Application app = new ApplicationClass();
     try
     {
         //app.ActivePrinter = "Acrobat Distiller";
         Workbooks workBooks = app.Workbooks;
         Workbook workBook = (Workbook )workBooks.GetType().InvokeMember("Open",BindingFlags.InvokeMethod,null,workBooks,new object[]{@"C:\Documents and Settings\raghunandanr\Desktop\Template Format for PDF Transcription1.xls"});
         workBook.PrintOut(1,Type.Missing,1,false,"Acrobat Distiller",true,true,@"C:\Documents and Settings\raghunandanr\Desktop\Template Format for PDF Transcription1.ps");
         workBook.Close(false,Type.Missing,Type.Missing);
         PdfDistiller dist = new PdfDistillerClass();
         //dist.bSpoolJobs = 1;
         dist.bShowWindow = 0;
         dist.OnJobFail += new _PdfEvents_OnJobFailEventHandler(Fail);
         dist.FileToPDF(@"C:\Documents and Settings\raghunandanr\Desktop\Template Format for PDF Transcription1.ps",null,null);
         Marshal.ReleaseComObject(dist);
         dist=null;
     }
     catch(Exception ex){Response.Write(ex.Message);}
     finally
     {
         app.Quit();
         Marshal.ReleaseComObject(app);
         app = null;
         GC.Collect();
         GC.WaitForPendingFinalizers();
     }
 }
 private void x()
 {
     Excel.Application app = new ApplicationClass();
     try
     {
         //app.ActivePrinter = "Acrobat Distiller";
         Workbooks workBooks = app.Workbooks;
         Workbook  workBook  = (Workbook )workBooks.GetType().InvokeMember("Open", BindingFlags.InvokeMethod, null, workBooks, new object[] { @"C:\Documents and Settings\raghunandanr\Desktop\Template Format for PDF Transcription1.xls" });
         workBook.PrintOut(1, Type.Missing, 1, false, "Acrobat Distiller", true, true, @"C:\Documents and Settings\raghunandanr\Desktop\Template Format for PDF Transcription1.ps");
         workBook.Close(false, Type.Missing, Type.Missing);
         PdfDistiller dist = new PdfDistillerClass();
         //dist.bSpoolJobs = 1;
         dist.bShowWindow = 0;
         dist.OnJobFail  += new _PdfEvents_OnJobFailEventHandler(Fail);
         dist.FileToPDF(@"C:\Documents and Settings\raghunandanr\Desktop\Template Format for PDF Transcription1.ps", null, null);
         Marshal.ReleaseComObject(dist);
         dist = null;
     }
     catch (Exception ex) { Response.Write(ex.Message); }
     finally
     {
         app.Quit();
         Marshal.ReleaseComObject(app);
         app = null;
         GC.Collect();
         GC.WaitForPendingFinalizers();
     }
 }
        private void Page_Load(object sender, System.EventArgs e)
        {
            PdfDistiller dist = new PdfDistillerClass();

            dist.bSpoolJobs  = 1;
            dist.bShowWindow = 0;
            dist.FileToPDF(@"C:\Documents and Settings\raghunandanr\Desktop\measure list.ps", null, null);
        }