Acrobat SDK:如何从CAcroPDDoc对象获取PDF文档路径?
Got it, let's work through this! You're right that the CAcroPDDoc object doesn't expose a direct property or method to grab the PDF's file path—it's focused on the document's content and internal structure, not the file system reference.
But since you already have the AvDocObj (the CAcroAVDoc instance) that you used to retrieve PdDocObj, that's where you can pull the file path from. The CAcroAVDoc class has a GetFileName() method that returns the full file path of the open PDF.
Here's the straightforward code to use:
// Use your existing AvDocObj to get the PDF path string pdfFilePath = AvDocObj.GetFileName();
A quick heads-up: If the document is newly created and hasn't been saved yet, GetFileName() might return an empty string or a temporary system path. You'll want to add a check for that scenario if your workflow involves handling unsaved documents.
内容的提问来源于stack exchange,提问作者Aniket Bhansali

