By clicking on a button in a Matlab GUI, the program should jump to a specific page in the PDF using the system command like in this example: system ("Acrobat directory" /A "page=2" "your file directory" &);
But while another Tab is open and the button is clicked on again, it should jump to another page in the same PDF, using the same command, while the pdf file is still open:
System ("Acrobat directory" /A "page=18" "your file directory" &);
But unfortunately Matlab reopens Acrobat Reader at the previous page 2, not at page 18.
When I close Acrobat Reader before calling the system command again, it works. (Closing with: (dos('taskkill /F /IM acroRd32.exe');)
This is an example of how I solved it till now.
dos('taskkill /F /IM acroRd32.exe');
system(['"C:\Program Files (x86)\Adobe\Acrobat Reader DC\Reader\AcroRd32.exe" /A "' ['page=' num2str(cell)] '" "' [path] '" & ']);
Obviously, I don’t want, that Acrobat Reader is always shut down, cause there might be unsaved changes or other needed files still open.
So, is there a way, to close only the specific file in Acrobat Reader, or to even jump to another page without having to close Acrobat before?
I really hope someone can help me :)