Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pdf Document Metadata and Properties are incorrect when adding UserPassword or OwnerPassword #418

Open
dssmith opened this issue Jan 3, 2024 · 0 comments

Comments

@dssmith
Copy link

dssmith commented Jan 3, 2024

using PdfSharpCore.Pdf;
using PdfSharpCore.Pdf.Security;

Console.WriteLine("Hello, World!");

var doc = new PdfDocument();
doc.Info.Title = "Issue Submission";
doc.Info.Subject = "Subject";
doc.Info.Author = "Author";
doc.Info.Creator = "Creator";
doc.Info.Keywords = "Keyword:one;Keyword:two";
doc.Info.ModificationDate = DateTime.Now;

doc.SecuritySettings.DocumentSecurityLevel = PdfDocumentSecurityLevel.Encrypted128Bit;
doc.SecuritySettings.UserPassword = "user";
doc.SecuritySettings.OwnerPassword = "owner";

PdfPage page = doc.AddPage();

doc.Save(@"c:\temp\test.pdf");

image

`

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

No branches or pull requests

1 participant