Adobe ACROBAT SDK 8.1 Manual page 82

Developing plug-ins and applications
Table of Contents

Advertisement

Adobe Acrobat SDK
Developing Plug-ins and Applications
wndClass.lpszMenuName
wndClass.cbWndExtra
wndClass.lpszClassName = "ExternalWindow";
if (!RegisterClass(&wndClass))
return false;
return true;
}
//Display an open dialog box that enables a user to select a PDF file
ASPathName OpenPDFFile(ASFileSys * ASF)
{
//Declare an AVOpenSaveDialogParamsRec object
AVOpenSaveDialogParamsRec dialogParams;
//Create local variables
AVFileFilterRec filterRec,*filterRecP ;
AVFileDescRec descRec;
ASPathName * pathName = NULL;
ASFileSys fileSys = NULL;
ASBool bSelected = false;
char errorBuf[256];
//Set up the PDF file filter description
strcpy (descRec.extension, "pdf");
descRec.macFileType = 'PDF ';
descRec.macFileCreator = 'CARO';
//Set attributes that belong to the AVFileFilterRec object
memset (&filterRec, 0, sizeof(AVFileFilterRec));
filterRec.fileDescs = &descRec;
filterRec.numFileDescs = 1;
filterRecP = &filterRec;
//Set attributes that belong to the AVOpenSaveDialogParamsRec object
memset (&dialogParams, 0, sizeof (AVOpenSaveDialogParamsRec));
dialogParams.size = sizeof(AVOpenSaveDialogParamsRec);
dialogParams.fileFilters = &filterRecP;
dialogParams.numFileFilters = 1;
DURING
//Set the AVFileFilterRec object's filterDescription attribute
filterRec.filterDescription = ASTextNew();
ASTextSetEncoded (filterRec.filterDescription, "Adobe PDF Files",
ASScriptToHostEncoding(kASRomanScript));
//Set the AVOpenSaveDialogParamsRec object's windowTitle attribute
dialogParams.windowTitle = ASTextNew();
ASTextSetEncoded (dialogParams.windowTitle, "Select A PDF Document To
Open",ASScriptToHostEncoding(kASRomanScript));
//Display the Open dialog box - pass the address of the ASFileSys object
bSelected = AVAppOpenDialog(&dialogParams, &fileSys,
(ASPathName**)&pathName, NULL, NULL);
= NULL;
= 0;
Working with Documents and Files
Displaying a PDF document within a window
82

Advertisement

Table of Contents
loading

Table of Contents