Answered
ASFileAcquirePathName returns UNIX-style pathname on Windows
I am trying to get the pathname of the active document in Acrobat using the following:
ACCB1 std::string ACCB2 GetActiveDocumentFilename() {
AVDoc activeDocument = AVAppGetActiveDoc();
if (!activeDocument) {
return "";
}
PDDoc document = AVDocGetPDDoc(activeDocument);
if (!document) {
return "";
}
ASFile file = PDDocGetFile(document);
if (!file) {
return "";
}
ASPathName filePath = ASFileAcquirePathName(file);
if (!filePath) {
return "";
}
return ASFileSysDIPathFromPath(NULL, filePath, NULL);
}
However, the pathname I get is (for example) /D/Documents/Testing/Test.pdf
Is there a way to get a Windows-formatted path/filename?
Cheers
Pete
