Unhandled exception in Adobe Reader while passing a search parameter in C#

0

I'm writing a WinForms application and there's a method to search text strings into an array of pdf files. When the given text is found, the method should open the proper file, highlighting said text.

I followed the specifics found in the Parameters for Opening PDF Files document, and this is the part of the code where I call the reader:

string arg = "/A search=\"" + parametri.testoDaRicercare + "\" \"" + file + "\"";
Process.Start("AcroRd32.exe", arg);

where parametri.testoDaRicercare is the string with the given text and file is the path to the pdf file.

Now, it works flawlessly with Adobe Reader XI, while I am given this error using Adobe Reader DC:

Unhandled exception in 0x61D6796F (AcroRd32.exe) in AcroRd32.exe: 0xC0000005: access violation while reading the path 0x000002C0. An Exception occurred.

By the way I don't know whether it's a simple Adobe+Win10 issue or whatever, because if I set the parameters to open the pdf at a certain page it works fine on both machines.

string arg = "/A \"page=" + pagina + "\" \"" + file + "\"";
Process.Start("AcroRd32.exe", arg);
c#
winforms
pdf
process
asked on Stack Overflow Jun 9, 2017 by Davide Vitali • edited Jun 12, 2017 by Davide Vitali

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0