Determine if same document is opened
Hello,
I have developed a plugin to open a document from the document path received from external program.
Is there any way to avoid reloading the document when same document is opened twice.
Here is my code snippet:
ACCB1 void ACCB2 OpenDocument()
{
AVDoc avDoc = AVAppGetActiveDoc();
PDDoc pdDoc = AVDocGetPDDoc(avDoc);
char filePath[256];
GetPrivateProfileString("OpenFile", "filePath", "", filePath, 256, iniFilePath);
ASAtom pathType = ASAtomFromString("Cstring");
//Create an ASText object
ASText titleText = ASTextNew();
ASTextSetPDText(titleText, "This PDF was opened by using the Acrobat SDK");
//Create an ASPathName object
ASFileSys fileSys = ASGetDefaultFileSysForPath(pathType, filePath);
ASPathName pathName = ASFileSysCreatePathName(fileSys, pathType, filePath, NULL);
//Open the PDF file
AVDoc myDoc = AVDocOpenFromFile(pathName, fileSys,NULL);
//Do some clean up
ASFileSysReleasePath(fileSys, pathName);
ASTextDestroy(titleText);
}
Thanks
