AVDoc.Open('D:\upload\test.pdf', 'PDF title');
// Open document
// 參數1, full path
// 參數2, windows title
AVDoc := AcroApp.GetActiveDoc;
// Get frontmost document
PDDoc := AVDoc.GetPDDoc;
// Get associated PDDoc
AcroApp.Show; //AcroApp.Hide;
// 決定是否顯示 Acrobat View
PageNum := PDDoc.GetNumPages;
// Get PDF total pages
AVDoc.PrintPagesSilent(0, PageNum, 0, 0, 0);
// 列印特定的Page
// 參數1, 起始頁數, 0 為第一頁
// 參數2, 結束頁數
showmessage('ok');
finally
PDDoc.Close;
//AVDoc.Close; //If PDDoc & AVDoc are constructed the same file,
//Close PDDoc will destroy both.
AcroApp.exit;
end;