简体   繁体   中英

axAcroPDF does not display PDF on windows XP

I have a C# windows forms application that displays the user a pdf. I use the axAcroPDF control like that:

AxAcroPDFLib.AxAcroPDF pdfViewer = new AxAcroPDFLib.AxAcroPDF();
...
pdfViewer.loadFile(@"C:\a.pdf");

This works fine on my PC and on my colleagues', but only on the ones who have win7 running. When trying on a winXp machine it does not work, ie loadFile() returns false.

Any ideas?

Is AxAcroPDFLib supplied with Adobe Reader or other Adobe product, if so I guess you would need that installed on the target machine, checking that the versions are compatible?

and.. can see the same PDF in the same location (if thats not example code)

Ok, I solved it by late binding the reader by implementing axHost like this:

public class LateBoundPDFReader : AxHost
{
    public LateBoundPDFReader()
        : base("{CA8A9780-280D-11CF-A24D-444553540000}")
    {
    }
}

The only thing is, now I cannot use it in the designer of VS...why...?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM