ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / Developing an application or website / Controls, windows and pages / Controls: Available types / PDF Reader control
  • Overview
  • Handling the PDF Reader control through programming
  • Initializing a PDF Reader control
  • Printing the content of a PDF Reader control
  • Properties specific to the PDF Reader control
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Overview
A PDF Reader control can be handled through programming.
To handle a PDF Reader control through programming, WINDEV proposes the functions for managing the PDF Reader control.
This help page explains how to handle a PDF Reader control through programming.
Handling the PDF Reader control through programming

Initializing a PDF Reader control

To display a PDF file in a PDF Reader control, you can:
  • Define the initial document ("General" tab in the description window of control).
  • Assign the PDF Reader control with the PDF file. For example:
    // Selects a .pdf file in the current directory
    sFileName is string
    sFileName = fSelect("", "Presentation.pdf", ...
    "Selection of PDF files", ...
    "Pdf file (*.pdf)" + TAB + "*.pdf", "*.pdf", fselOpen)
     
    IF sFileName ~="" THEN
    // No selected file
    RETURN
    END
     
    // Load PDF file
    PDF_MyDocument = sFileName
    If passwords are used:
    • WINDEV If a password is used to protect the file at opening, a window will be displayed to type the password.
    • AndroidiPhone/iPad It is not possible to open a protected PDF file.
  • Use the PDFReaderOpen function. For example:
    PDFReaderOpen(PDF_MyDocument, "C:\Users\test\Documents\file.pdf")
     
    IF ErrorOccurred() THEN
    Error(ErrorInfo())
    RETURN
    END
    Remark: PDFReaderOpen allows you to give the file password through programming.

Printing the content of a PDF Reader control

To print the content of a PDF Reader control, all you have to do is use iPrintPDF. For example:
iPrintPDF(PDF_MyPDFReader)

Properties specific to the PDF Reader control

The following properties are specific to the PDF Reader control. They are mainly used to handle the control characteristics:
DisplayModeThe DisplayMode property gets and changes:
  • the display mode in a Word Processing control,
  • the display mode in a PDF Reader control
  • the display mode in an HTML Editor control,
  • the display mode in a Kanban control
DisplayModeAutoWhenLoadingThe DisplayModeAutoWhenLoading property is used to determine and change the display mode when loading a PDF document.
FilePathThe FilePath property gets:
  • the name of the xlsx file associated with a Spreadsheet control.
  • the name of the file associated with an Image Editor control.
  • the name of the PDF file associated with a PDF Reader control.
  • the name of the DOCX file associated with a Word Processing control.
  • the name of the wddiag file associated with a Diagram Editor control.
NavigationPaneVisibleThe NavigationPaneVisible property is used to display the thumbnail pane in the PDF Reader control.
NumberAccessiblePagesThe NumberAccessiblePages property is used to get the number of pages currently loaded in a PDF Reader or Word Processing control.
NumberDisplayedPageThe NumberDisplayedPage property is used to identify and change the number of the page currently displayed in the PDF Reader or Word Processing control.
NumberPageThe NumberPage property is used to get:
  • the number of pages in a "multi-page" image file. This image is displayed in an Image control or in the background of a Chart control.
  • the number of pages in a PDF file displayed in an Image control.
  • the number of pages found in a PDF file displayed in a PDF Reader control.
  • the number of pages found in a DOCX file displayed in a Word Processing control.
UseModeThe UseMode property is used to determine or change how the PDF Reader control reacts to mouse input. The mouse is used to select text in the document or to move within the document pages.
ZoomThe Zoom property gets or sets the zoom value:
  • in an Image control.
  • in a Map control.
  • in an Organization Chart control.
  • in a Table, TreeView Table, Pivot Table, Spreadsheet or List Box control.
  • in a Word Processing control.
  • in a PDF Reader control.
  • in a Camera control.
  • in a Diagram Editor control;
  • in a window.
For a complete list of WLanguage properties that can be used with PDF Reader controls, see PDF Reader control properties.
Minimum version required
  • Version 23
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/02/2023

Send a report | Local help