-1

I am using axAcroPDF to view PDF files in in my win form application. Whenever I try to run the app I get an empty messagebox like in the image below.

Does anyone know why? To load the PDF file I added this code to a button

OpenFileDialog dialog = new OpenFileDialog();
        dialog.Filter = "PDF files (*.PDF)|*.PDF|All files (*.*)|*.*";
        dialog.InitialDirectory = "C:";
        dialog.Title = "Select a PDF file";
        if (dialog.ShowDialog() == DialogResult.OK)
        {
            this.Controls.Add(this.axAcroPDF1);
            axAcroPDF1.src = dialog.FileName;
            filname1 = dialog.FileName;
            button2.Enabled = true;

Image:

enter image description here

halfer
  • 19,824
  • 17
  • 99
  • 186
Bari
  • 75
  • 1
  • 8

1 Answers1

1

I don't know if this answer can help you: I was doing the same work with Adobe Reader 9 and it gave me the same messagebox. Then I switch to Adobe Reader 10 and the message box disappears and my application works normally.

here is my code

        OpenFileDialog dlg = new OpenFileDialog();
        dlg.Filter = "pdf files (*.pdf) |*.pdf;";
        dlg.ShowDialog();
        if (dlg.FileName != null)
        {
            axAcroPDF1.setShowToolbar(true);
            axAcroPDF1.LoadFile(dlg.FileName);
        }
Paolo Zaia
  • 218
  • 3
  • 14