C# 使用adobe PDF reader控件 在windows server 2003以上都不能显示pdf文件
部分代码:
axAcroPDF1.CreateControl();
// int page = Convert.ToInt32(station_sub.Substring(station_sub.IndexOf(":") + 1, station_sub.IndexOf(";") - station_sub.IndexOf(":") - 1));
((System.ComponentModel.ISupportInitialize)(axAcroPDF1)).BeginInit();
//com.Location = new Point(0, 24);
//com.Size = new Size(300, 300);
axAcroPDF1.TabIndex = 0;
axAcroPDF1.Dock = DockStyle.Fill;
this.Controls.Add(axAcroPDF1);
axAcroPDF1.setView("fit");
((System.ComponentModel.ISupportInitialize)(axAcroPDF1)).EndInit();
Form1.Loginfo.Info( axAcroPDF1.ToString());
_mux.OpenPdf(axAcroPDF1, page);
OpenPdf函数:
void OpenPdf(AxAcroPDF com, int page ){
string tmppath = Directory.GetCurrentDirectory() + "\\" + "包装SOP.pdf";
Form1.Loginfo.Info(com.LoadFile(@tmppath));
}
以上代码
在xp,win7下可以 ,但是在windows server中不显示,Form1.Loginfo.Info(com.LoadFile(@tmppath)显示为fasle;
说明没加载成功文件。