コード例 #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;
     }
 }