PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
This content has been translated automatically. Click here to view the French version.
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Returns an Image type variable containing a page from a PDF file.
Versions 26 and later
Windows This function is now available for WEBDEV sites in Windows.
New in version 26
Windows This function is now available for WEBDEV sites in Windows.
Windows This function is now available for WEBDEV sites in Windows.
Example
// Extracts page 3 from the text.pdf file
MyImage is Image = PDFExtractPage("text.pdf", 3)
SAI_NumberPagePDF.BackgroundColour = White
SI SAI_NumPagePDF = 0 ALORS
Info("You must indicate the page number to be extracted")
SAI_NumberPagePDF.BackgroundColour = PastelRed
ReturnToCapture( SAI_NumPagePDF)
RETURN
END
 
sNewPath is a chain = fSelectDir( sPathOrigine, ...
0
 
// Search in the DOC_Contact file of the label contained in the table.
HLitSearch(DOC_Contact, IDDOC_Contact, TABLE_Fen_Liste_Documents.COL_IDDOC_Contact)
IF HFound() THEN
HourGlass()
 
MyPathPDF is a string = sNewPath + "\" + ...
DOC_Contact.IDDOC_Contact + "." + DOC_Contact.format
 
// Document is a memo containing the PDF
SI PAS HExtraitMémo(DOC_Contact, Document, MonCheminPDF) ALORS
Error(HErrorInfo())
ELSE
0
Error("The PDF does not contain enough pages", ...
"Salary rescinded")
RETURN
END
 
MyImagePDF is an Image = PDFExtractPage( MyPathPDF, ...
SAI_NumPagePDF)
// Removing the original PDF
fDelete( MonCheminPDF)
 
MyImagePNG is a string = sNewPath + "\" + DOC_Contact.IDDOC_Contact + ...
 "_Page" + SAI_NumPagePDF + ".PNG"
dSauveImagePNG(MonImagePDF, MonImagePNG)
ShellExecute( MonImagePNG)
END
HourGlass(False)
END
Syntax
<Result> = PDFExtractPage(<File path> , <Page number> [, <Width> [, <Height> [, <Password>]]])
<Result>: Image (image variable)
Image variable containing the image of extracted page. The returned image is a raster image (non vectorial).
Remark: If the PDF file does not exist or if the page does not exist, the Image variable returned will be invalid. The ErrorOccurred variable will correspond to True.
<File path>: Character string (with quotes)
Path of PDF file from which the page will be extracted.
<Page number>: Integer
Number of the page to extract.
<Width>: Optional integer
Width at which the page must be rasterized.
If this parameter is not specified (or if this parameter is equal to 0), the height and width will be calculated from the page size (in millimeters), by considering a DPI set to 300.
<Height>: Optional integer
Height at which the page must be rasterized.
If this parameter is not specified (or if this parameter is equal to 0), the height and width will be calculated from the page size (in millimeters), by considering a DPI set to 300.
<Password>: Optional character string (with quotes)
Password of PDF document.
Business / UI classification : Business Logic
Component : wd260pdf.dll
Minimum version required
  • Version 20
This page is also available for…
Comments
Click [Add] to post a comment