Copy link to clipboard
Copied
In some of my company's applications, we open up the PDF via code and set the title as something more descriptive than the file name. This has worked for both Acrobat 9 and Acrobat DC. We're now looking to switch to Acrobat 2017, and it looks like for some computers it works (except the title disappears when focus is lost) and some computers the Acrobat will error out. Does anyone know a workaround?
Below, the steps I can take to produce the error and the sample code that opens it up
SAMPLE STEPS
SAMPLE CODE BELOW
public static void OpenFile(int handle, string pdfLocation, string description)
{
var gAppClass = new Acrobat.AcroApp();
var avDOC = new Acrobat.AcroAVDoc();
OpenAvDoc(handle, avDOC, pdfLocation);
avDOC.BringToFront();
gAppClass.Show();
avDOC.SetTitle(description);
}
private static bool OpenAvDoc(int handle, Acrobat.AcroAVDoc avDOC, string pdfLocation)
{
bool result = false;
// if no foreground, or couldn't open window, open normally.
if (handle <= 0 || !avDOC.SetViewMode(0))
{
result = avDOC.Open(pdfLocation, "");
}
else
{
try
{
result = avDOC.OpenInWindowEx(pdfLocation, handle, (int)Acrobat.AVOpenParams.AV_PAGE_VIEW, 1, 0, (short)Acrobat.PDViewMode.PDUseNone, (int)Acrobat.AVZoomType.AVZoomFitWidth, 0, (short)9999, (short)9999);
}
catch
{
result = avDOC.Open(pdfLocation, "");
}
}
return result;
}
Copy link to clipboard
Copied
I have exactly the same problem with Acrobat DC, it works with earlier version of acrobat pro just not the DC version. Crash always occurs on the second open of pdf after closing the first.
any workaround for this Chris?