예제 #1
0
 public void DisplayPDFFile(string pdfpath)
 {
     try
     {
         if (!string.IsNullOrEmpty(pdfpath))
         {
             MyaxAcroPDF.LoadFile(pdfpath);
             SetPdf();
         }
         else
         {
             throw new Exception("pdf文件路径问空");
         }
     }
     catch (Exception ex)
     {
         Log.Error("[" + System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "][" + System.Reflection.MethodBase.GetCurrentMethod().Name + "] err" + ex);
         MessageBox.Show(ex.Message);
     }
 }
예제 #2
0
 private void SetPdf()
 {
     try
     {
         MyaxAcroPDF.setShowToolbar(true);
         MyaxAcroPDF.setShowScrollbars(true);
         MyaxAcroPDF.setPageMode("thumbs");
         MyaxAcroPDF.setView("fit");
         MyaxAcroPDF.AllowDrop = false;
         panel1.Hide();
         panel2.Hide();
         //MyaxAcroPDF.
         //MyaxAcroPDF.
         //MyaxAcroPDF.setPageMode("pages only");
         //MyaxAcroPDF.Dock = System.Windows.Forms.DockStyle.Fill;
         //MyaxAcroPDF
     }
     catch
     {
         Log.Error("[" + System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "][" + System.Reflection.MethodBase.GetCurrentMethod().Name + "] err");
         throw;
     }
 }