I am trying to read the the content from a pdf file programmatically with C#, by adding reference to Acrobat.dll in the project and use APIs
This is the code which give me an error message "There was an error opening this document. This file cannot be found."
public String getText()
{
AcroAVDoc pdfDoc = new AcroAVDoc();
if (pdfDoc.Open(FileName, ""))
{
AcroPDPage page;
AcroPDDoc pdf = (AcroPDDoc)pdfDoc.GetPDDoc();
int pages = pdf.GetNumPages();
......
}
My project file was successfully build. Through debugging, I found the error message was shown just running the above line of code in red.
I also tested that opening PDF file in windows file browser, it works fine.
Does anybody have the same problem before?
Oh, ok.
1. Be sure you don't just have Adobe Reader installed. You need a full copy of Acrobat.
2. Sometimes it seems necessary to create an AcroExch.App object first.
3. I have found debuggers can be misleading. Did you try adding a message after the new AcroAVDoc to see if it actually passed that line?
Thanks!
I don't quite understand "full copy of Acrobat", I have Adobe Acrobat 9 Standard, Adobe Reader 9.3.4 installed, Does it mean that I have "full copy of Acrobat"?
I added a message after the new AcroAVDoc, it didn't passed that line.
I would try to create an AcroExch.App object first, and see what happen
Just to clarify the meaning of the comma in " I have Adobe Acrobat 9 Standard, Adobe Reader 9.3.4 installed". Do you mean that you have both of these products installed, the purchased Acrobat and the free Adobe Reader?
This can cause problems; try starting Acrobat first to make sure Reader doesn't get involved.
Yes, I have both the purchased Acrobat and the free Adobe Reader installed on my computer.
You are right. I just noticed I have a pdf file opened with Adobe Reader. I think the project just look the current activate Adove reader and get an error.
After I closed the Adobe Reader, it run successfully.
Thanks !
Could you tell me how to open Adobe Acrobat interface without Reader involved even I have a activate Reader?
North America
Europe, Middle East and Africa
Asia Pacific