Skip to content

add CheckSum to PdfEmbeddedFileStream#43

Open
julienrffr wants to merge 4 commits intoempira:masterfrom
KDS:file-attachment-checksum
Open

add CheckSum to PdfEmbeddedFileStream#43
julienrffr wants to merge 4 commits intoempira:masterfrom
KDS:file-attachment-checksum

Conversation

@julienrffr
Copy link

@julienrffr julienrffr commented Oct 16, 2023

add the ability to fill the /CheckSum of PdfEmbeddedFileStream

checksum has to be a MD5 hash of the file (according to spec)

Example usage:

From the document helper .AddEmbeddedFile:
var path = @"C:\Users\userxxx\Downloads\avion2.jpg"; document.AddEmbeddedFile("filename.jpg", path, "4f98ab027f9b64a1f7325aedfabe8c9f");

Or directly on PdfEmbeddedFileStream's constructor:
var embeddedFileStream = new PdfEmbeddedFileStream(Owner, stream, "4f98ab027f9b64a1f7325aedfabe8c9f");

HelloWorld-FB59FCE0CB3E4341B9C63E9D626484AB_tempfile.pdf

fileattachmentchecksum

NB: this feature is available in PDFsharp-extended nuget package

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant