ststeiger / PdfSharpCore

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

AddPage does not copy annotations by default #346

Closed Methuselah96 closed 1 year ago

Methuselah96 commented 1 year ago

When migrating from PdfSharp, one of the breaking changes was that AddPage does not copy annotations by default. This was fairly difficult to diagnose and quite surprising default behavior.

PdfSharp used to not copy annotations by default. This was addressed in PdfSharpCore by adding an annotation copying option in https://github.com/ststeiger/PdfSharpCore/pull/91 which defaulted to not copying annotations (presumably to match the old behavior at the time).

Since then, PdfSharp has started copying annotations by default as of 1.50.4740-beta5 (here). This means that users migrating from PdfSharp will experience a silent breaking change.

I would like to propose that AddPage should copy annotations by default to match PdfSharp's default behavior. I understand that this would be a breaking change for PdfSharpCore users, so ideally this would be released in a major version, but I'm not sure what this project's versioning policy is, seeing as it's still on 1.x.x.

I created https://github.com/ststeiger/PdfSharpCore/pull/347 with this change, but I thought I should open an issue as well to get feedback on whether such a change would be welcome.