ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Standard functions / Windows functions / Scanner functions
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Retrieves a document from a scanner in a variable of type Image.
Example
MonScanneur is Scanner 
MonScanneur = ScanSelect()

// Affiche le document présent dans le scanneur dans un champ Image
IMG_MonImage = ScanToImage(MonScanneur)
IF ErrorOccurred THEN
	Error("Le document n'a pas été scanné", ErrorInfo())
END

// Scan de toutes les pages du chargeur
ScanToImage(MonScanneur, TraitePageScan)
// Traitement d'une page scannée
INTERNAL PROCEDURE TraitePageScan(nNumPage is int, ImageScan is Image)
	dSaveImageJPEG(ImageScan, "page" + nNumPage + ".jpg")
END
Syntax

Scanning a single page Hide the details

<Result> = ScanToImage(<Scanner>)
<Result>: Image variable
Image variable retrieved from the scanner. If an error occurs, the ErrorOccurred variable is set to True and ErrorInfo returns the corresponding error message.
<Scanner>: Scanner variable
Name of the Scanner variable initialized with the details of the scanner to be used.

Scanning multple pages (with feeder) Hide the details

<Result> = ScanToImage(<Scanner> [, <Number of pages>] , <End of page scan>)
<Result>: Boolean
  • True if the scan was completed successfully,
  • False if an error occurs during the scan process. The corresponding error message is returned by ErrorInfo.
<Scanner>: Scanner variable
Name of the scanner variable initialized with the details of the scanner to be used.
<Number of pages>: Optional integer
  • Number of pages to be scanned,
  • scanNumberPagesAll constant to scan all the pages in the feeder (default value).
<End of page scan>: Procedure name
Name of the WLanguage procedure ("callback") called once a page has been scanned. This procedure has the following format:
<Procedure name>(<Page number>, <Image>)
where:
  • <Numéro de page> Scanned page number.
  • <Image> Variable of type Image containing the scanned page. This variable is only valid when the Procedure is called: it must therefore be copied or saved in a file (no reference should be made to this variable).
If the procedure returns False, the scan is interrupted.
Business / UI classification: UI Code
Component: wd300std.dll
Minimum version required
  • Version 27
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 03/28/2025

Send a report | Local help