Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

DynaPDF.CheckEmbeddedFileCheckSum

Checks the checksum for an embedded file.

Component Version macOS Windows Linux Server iOS SDK
DynaPDF 15.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "DynaPDF.CheckEmbeddedFileCheckSum"; PDF; Handle )   More

Parameters

Parameter Description Example
PDF The PDF reference returned from DynaPDF.New. $pdf
Handle The index number for the embedded file. Range from 0 to DynaPDF.GetEmbeddedFileCount. 0

Result

Returns status or error.

Description

Checks the checksum for an embedded file.
Returns 1 for checksum okay, 0 for checksum invalid and -1 if no checksum is present.

You may detect bad bytes e.g. from a disk reading error or transmitting error.
Since the checksum is just MD5, a malicious actor could swap out the content of the embedded file and fill in a new correct checksum.

Examples

Query name, content and check checksum:

Set Variable [ $name ; Value: MBS( "DynaPDF.GetEmbeddedFile"; $PDF; $Index; "name" ) ]
Set Variable [ $file ; Value: MBS( "DynaPDF.GetEmbeddedFileAsContainer"; $PDF; $Index ) ]
Set Variable [ $checksumOkay ; Value: MBS( "DynaPDF.CheckEmbeddedFileCheckSum"; $PDF; $Index) ]

See also

Release notes

Blog Entries

This function checks for a license.

Created 27th December 2024, last changed 31st December 2024


DynaPDF.CheckConformance - DynaPDF.CheckFieldNames