|
|
|
|
|
PDFExtractPage (Function) In french: PDFExtraitPage Extracts a page from a PDF file in a variable of type Image.
MonImage is Image = PDFExtractPage("texte.pdf", 3)
MonPDF is pdfDocument = PDFOpen("test.pdf")
MonImage is Image = PDFExtractPage(MonPDF, 3)
SAI_NumPagePDF.CouleurFond = White
IF SAI_NumPagePDF = 0 THEN
Info("Vous devez indiquer le numéro de page à extraire")
SAI_NumPagePDF.CouleurFond = PastelRed
SetFocusAndReturnToUserInput(SAI_NumPagePDF)
RETURN
END
sNouveauChemin is string = fSelectDir(sCheminOrigine, ...
"Sélecteur de répertoire", "Sélectionnez le répertoire d'extraction de la page")
HReadSeek(DOC_Contact, IDDOC_Contact, TABLE_Fen_Liste_Documents.COL_IDDOC_Contact)
IF HFound() THEN
HourGlass()
MonCheminPDF is string = sNouveauChemin + "\" + ...
DOC_Contact.IDDOC_Contact + "." + DOC_Contact.Format
IF NOT HExtractMemo(DOC_Contact, Document, MonCheminPDF) THEN
Error(HErrorInfo())
ELSE
IF PDFNumberOfPages(MonCheminPDF) < SAI_NumPagePDF THEN
Error("Le PDF ne contient pas suffisamment de pages", "Traitement annulé")
RETURN
END
MonImagePDF is Image = PDFExtractPage(MonCheminPDF, SAI_NumPagePDF)
fDelete(MonCheminPDF)
MonImagePNG is string = sNouveauChemin + "\" + DOC_Contact.IDDOC_Contact + ...
"_Page" + SAI_NumPagePDF + ".PNG"
dSaveImagePNG(MonImagePDF, MonImagePNG)
ShellExecute(MonImagePNG)
END
HourGlass(False)
END
Syntax
Extracting a page from a PDF using the file path Hide the details
<Result> = PDFExtractPage(<File path> , <Page number> [, <Width> [, <Height> [, <Password>]]])
<Result>: Image (image variable) Image variable that contains the image of the extracted page. The returned image is a raster image.Note: If the PDF or the page does not exist, the Image variable returned will be invalid. The ErrorOccurred variable will correspond to True. <File path>: Character string Path of the PDF file from which the page will be extracted. <Page number>: Integer Number of the page to be extracted. <Width>: Optional integer Width at which the page is to be rasterized. If this parameter is not specified (or is set to 0), the height and width will be calculated from the page size (in millimeters), using a DPI of 300. <Height>: Optional integer Height at which the page is to be rasterized. If this parameter is not specified (or is set to 0), the height and width will be calculated from the page size (in millimeters), using a DPI of 300. <Password>: Optional string or Secret string Password of the PDF document.
New in version 2025Secret strings: If you use the secret string vault, the type of secret string used for this parameter must be "ANSI or Unicode string". To learn more about secret strings and how to use the vault, see Secret string vault.
Extracting a page from a PDF file using a pdfDocument variable Hide the details
<Result> = PDFExtractPage(<PDF document> , <Page number> [, <Width> [, <Height> [, <Password>]]])
<Result>: Image (image variable) Image variable that contains the image of the extracted page. The returned image is a raster image.Note: If the PDF or the page does not exist, the Image variable returned will be invalid. The ErrorOccurred variable will correspond to True. <PDF document>: pdfDocument variable Name of the pdfDocument variable that corresponds to the PDF document to be used. <Page number>: Integer Number of the page to be extracted. <Width>: Optional integer Width at which the page is to be rasterized. If this parameter is not specified (or is set to 0), the height and width will be calculated from the page size (in millimeters), using a DPI of 300. <Height>: Optional integer Height at which the page is to be rasterized. If this parameter is not specified (or is set to 0), the height and width will be calculated from the page size (in millimeters), using a DPI of 300. <Password>: Optional string or Secret string Password of the PDF document.
New in version 2025Secret strings: If you use the secret string vault, the type of secret string used for this parameter must be "ANSI or Unicode string". To learn more about secret strings and how to use the vault, see Secret string vault. Business / UI classification: Business Logic
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|