Get document information
10 Jul 20261 minute to read
The PDF Viewer allows you to access the filename and file path of the loaded PDF document.
Refer to the following code example to access the filename.
//Initialize the PDF Viewer
PdfViewerControl pdfViewer = new PdfViewerControl();
//Loads the PDF document in PDF Viewer
pdfViewer.Load(@"input.pdf");
//Gets the filename of loaded PDF document
string fileName = pdfViewer.DocumentInformation.FileName;'Initialize the PDF Viewer
pdfViewer As New PdfViewerControl()
'Loads the PDF document in PDF Viewer
pdfViewer.Load("input.pdf")
'Gets the filename of loaded PDF document
Dim fileName As String = pdfViewer.DocumentInformation.FileNameRefer to the following code example to access the file path.
//Initialize the PDF Viewer
PdfViewerControl pdfViewer = new PdfViewerControl();
//Loads the PDF document in PDF Viewer
pdfViewer.Load(@"input.pdf");
//Gets the file path of loaded PDF document
string filePath = pdfViewer.DocumentInformation.FilePath;'Initialize the PDF Viewer
pdfViewer As New PdfViewerControl()
'Loads the PDF document in PDF Viewer
pdfViewer.Load("input.pdf")
'Gets the file path of loaded PDF document
Dim filePath As String = pdfViewer.DocumentInformation.FilePathNOTE
The sample project to get document information is available in the GitHub link.