I am trying to get the pathname of the active document in Acrobat using the following:
However, the pathname I get is (for example) /D/Documents/Testing/Test.pdf
Is there a way to get a Windows-formatted path/filename?
Copy link to clipboard
I used ASFileSysDisplayStringFromPath
That is only superficially Unix style. What it actually is, is a DIPath (Device Independent Path) which is what is stored inside a PDF for links etc, and what Acrobat always uses internally. But...this code is fundamentally wrong because it treats an ASPathName as a string. Yes, sometimes it is, and sometimes it is binary data which would crash your plug-in. You need to treat an ASPathName as an opaque pointer, and pass it to an API (with the ASFileSys) for conversion. I think you may already have solved that, but it's important to mention it.
Thanks for the info, yes I dug a bit further into the documentation and found that method.