Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

dxPDFViewerOpenDocumentDialog(string) Method

Invokes the Open dialog allowing you to select a PDF document file for loading.

#Declaration

Delphi
function dxPDFViewerOpenDocumentDialog(var AFileName: string): Boolean;

#Parameters

Name Type Description
AFileName string

The full path to a PDF document.

#Returns

Type Description
Boolean

The function returns True if the function returns a non-empty path; otherwise - False.

#Remarks

You can use this global function together with the PDF Viewer’s LoadFromFile procedure to implement an alternative to the OpenDocument command. The dxPDFViewerOpenDocumentDialog function returns False if an end-user clicks the “Cancel” button in the Open dialog; otherwise, True. The path to a file selected by an end-user is returned as the AFileName parameter.

An example of using the dxPDFViewerOpenDocumentDialog function is listed below:

var
  AFileName: string;
//...
  if(dxPDFViewerOpenDocumentDialog(AFileName)) then  // If the file path is not an empty string
    dxPDFViewer1.LoadFromFile(AFileName);  // Load the specified PDF document
See Also