ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

New WINDEV and WEBDEV 2025 feature!
Help / WLanguage / WLanguage functions / Standard functions / PDF functions
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Checks the validity of PDF signatures. If there are any invalid signatures, this function allows you to get their details.
New in version 2025
Note: This function is only available from version 2025 Update 1.
Example
// Load PDF document
My_PDF is pdfDocument = pdf_file_path

// Check the signature
// Execute the procedure only if an invalid signature is detected
PDFVerifySignatures(My_PDF, Verification_procedure)
PROCEDURE Verification_procedure(PDF_doc, Signature_index, Error_code)
// Process the error code
Error_text is string
SWITCH Error_code
	CASE pdfInvalidSignature: Error_text = StringBuild("Signature %1 is invalid", Signature_index)
	CASE pdfCertificateExpired: Error_text = StringBuild("The certificate of the %1 signature has expired", Signature_index)
	CASE pdfModifiedAfterSigning: Error_text = "The PDF file was modified after signing"
END
// Identify invalid signature 
IF Signature_index > 0 THEN
	Error_text += CR + CR
	// Signature details
	let Signature_buffer = PDFGetSignature(PDF_doc, Signature_index)
	certif is Certificate = CertificateExtract(Signature_buffer)
	Error_text += StringBuild([
		Signature number %1
		Issuer: %2
		Name: %3
		Valid from: %4
		Valid until: %5
		Signature date: %6
	],
	Signature_index,
	certif.Issuer,
	certif.Name,
	DateToString(certif.StartValidityDate),
	DateToString(certif.EndValidityDate),
	DateToString(PDFGetSignatureDate(PDF_doc, Signature_index)))
END
// If 
IF ErrorOccurred THEN
	Error_text += CR + CR+ ErrorInfo(errSummary)
	// Displays the error
	Info(Error_text)
	// Stop reading signatures
	RETURN False
ELSE
	// Continue reading signatures
	// If an invalid signature is found, the procedure is restarted. 
	RETURN True
END
Syntax

Verifying the signatures of a pdfDocument variable Hide the details

<Result> = PDFVerifySignatures(<Document> , <WLanguage procedure>)
<Result>: Boolean
  • True if the verification was completed and no problems were detected. The document contains valid signatures or no signatures.
    Reminder: You can check the number of signatures with PDFNbSignatures.
  • False if the document could not be opened, if one of the signatures is invalid or if the document was modified after signing.
<Document>: pdfDocument variable
Name of the pdfDocument variable containing the PDF document to be analyzed.
<WLanguage procedure>: Procedure name
Name of WLanguage procedure ("callback") executed for each invalid signature found.
For more details on this procedure, see Parameters of the procedure used by PDFVerifySignatures.

Verifying the signatures of a PDF file Hide the details

<Result> = PDFVerifySignatures(<PDF file> [, <Password>] , <WLanguage procedure>)
<Result>: Boolean
  • True if the verification was completed and no problems were detected. The document contains valid signatures or no signatures.
    Reminder: You can check the number of signatures with PDFNbSignatures.
  • False if the document could not be opened.
<PDF file>: Character string
Name and path of the PDF file to be analyzed.
<Password>: Optional string or Secret string
PDF file password.
New in version 2025
Secret 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.
<WLanguage procedure>: Procedure name
Name of WLanguage procedure ("callback") executed for each invalid signature found.
For more details on this procedure, see Parameters of the procedure used by PDFVerifySignatures.
Business / UI classification: Business Logic
Component: wd300pdf.dll
Minimum version required
  • Version 2025
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/14/2025

Send a report | Local help