I have been trying to get a pdf to open consistently in my Winform app's window with the following code:
AcroApp app = new AcroApp();
AcroAVDoc avDoc = new AcroAVDoc();
string myPath = "C:\\Users\\Jeff\\SkyDrive\\";
string myFile = "Child Support Data Sheet, Lake County.pdf";
//bool success = pdfDoc.Open(myPath + myFile, myFile);
app.Lock("Jeff's Program");
bool success = avDoc.OpenInWindowEx(myPath + myFile, this.Handle.ToInt32(),
(int)Acrobat.AVOpenParams.AV_DOC_VIEW, 1, 0, (short)Acrobat.PDViewMode.PDFullScreen,
(short)Acrobat.AVZoomType.AVZoomFitWidth, 0, 0, 0);
// bool success = app.Show();
MessageBox.Show(success.ToString());
avDoc.Close(0);
app.UnlockEx("Jeff's Program");
For whatever reason, it does not work most of the time. The Form1 window is blank, although sometimes, it contains the pdf. I have been trying to deal with that, but I have a more important question, first. Even if I get it working correctly, will it work on computers where end-users only have Acrobat Reader? If not, I need to look for another way. If it will work, I need to keep debugging (so does anyone have any suggestions)?