Closed bagsergen closed 2 years ago
sample-pdf-with-images.pdf
Hi, I'm trying to add info element. Error as below has occured when I tried this case. Sample file is downloaded from internet.
Environtment: .Net 4.8 Framework
The key-value should be added correctly.
PdfDocument document; try { document = PdfReader.Open(filePath); var properties = document.Info.Elements; properties.SetString("/" + key, value); document.Save(filePath); document = null; return true; } catch (Exception e) { if (document != null) document = null; throw; }
At first glance, this is a corrupt PDF file and not a bug in PDFsharp.
I understood, thank you.
Resources
sample-pdf-with-images.pdf
Issue
Hi, I'm trying to add info element. Error as below has occured when I tried this case. Sample file is downloaded from internet.
Environtment: .Net 4.8 Framework
Expected Behavior
The key-value should be added correctly.
Actual Behavior
Steps to Reproduce the Behavior