ststeiger / PdfSharpCore

Port of the PdfSharp library to .NET Core - largely removed GDI+ (only missing GetFontData - which can be replaced with freetype2)
Other
1.07k stars 238 forks source link

Font changed to a different when opening existing PDF #275

Open anddrzejb opened 2 years ago

anddrzejb commented 2 years ago

Hi

So I load an existing PDF document using

PdfDocument document = PdfReader.Open(new MemoryStream(pdfStream), PdfDocumentOpenMode.Modify);

The document has these fonts defined: image

However when I save the pdf, the font is different: image

Am I doing something wrong or this behaviour is expected? How can I ensure PdfSharpCore won't change the fonts (or anything visual for that matter)?

The PDF was generated on the same machine by Playwright - actually, in the same process.