ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / Developing an application or website / Controls, windows and pages / Controls: Available types / PDF Reader control
  • Overview
  • Manipulating PDF Reader controls programmatically
  • Initializing a PDF Reader control
  • Printing the content of a PDF Reader control
  • PDF Reader control properties
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Overview
PDF Reader controls can be manipulated programmatically.
To programmatically manipulate PDF Reader controls, you can use the PDF Reader control functions.
This help page explains how to programmatically manipulate PDF Reader controls.
Manipulating PDF Reader controls programmatically

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 control description window).
  • Assign the PDF file to the PDF Reader control. For example:
    // Sélectionne un fichier .pdf dans le répertoire en cours
    sNomFichier is string
    sNomFichier = fSelect("", "Présentation.pdf", ...
    	"Sélection de fichiers PDF", ...
    	"Fichier Pdf (*.pdf)" + TAB + "*.pdf", "*.pdf", fselOpen)
    
    IF sNomFichier ~="" THEN
    	// Aucun fichier sélectionné
    	RETURN
    END
    
    // Chargement du fichier PDF
    PDF_MonDocument = sNomFichier
    If passwords are used:
    • WINDEV If the file is password-protected, a window will appear to enter the password.
    • AndroidiPhone/iPad It is not possible to open a protected PDF file.
  • Use the <PDF Reader>.Open function. For example:
    PDF_MonDocument.Ouvre("C:\Users\test\Documents\fichier.pdf")
    
    IF ErrorOccurred() THEN
    	Error(ErrorInfo())
    	RETURN
    END
    Note: The <PDF Reader>.Open function allows you to program the file password.

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_MonLecteurPDF)

PDF Reader control properties

The following properties are specific to PDF Reader controls. 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: 09/20/2024

Send a report | Local help