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

Adds option to enable annotation copying - and other PdfSharpCore Features #229

Open
peterharding93 opened this issue Jan 22, 2025 · 2 comments
Labels
enhancement New feature or request investigation Under investigation

Comments

@peterharding93
Copy link

peterharding93 commented Jan 22, 2025

The PdfSharpCore project (branched many years ago) support for deep-copying annotations on a page. It has a fairly simple pull request to implement it:
ststeiger/PdfSharpCore#77 Adds option to enable annotation copying

Is anyone else interested in having this feature migrated?

I (like many people) have been using PdfSharpCore for a few years due to the NetCore/NetFramework compatibility. Now I have to move back due to PdfSharpCore and the version problems / security risks with the ImageSharp libraries. That project is as good as unmaintained from what I can see.
There are probably other features that would be useful to migrate back.

I also got a lot of benefit from being able to read dodgy PDF's with "PdfReadAccuracy.Moderate". Not sure if that is viable to include in PdfSharp?

Maybe someone else has already looked into this and has tried including these features? Or any recommendations on how I go about this?

@packdat
Copy link

packdat commented Jan 24, 2025

Seems to be already done ? (although without the AnnotationCopyingType)
See here.

But IMO, the import is still incomplete.
When you're importing pages from a document that contains an AcroForm, the Widget-Annotations of the fields would be imported, but the AcroForm itself is left out (unless it is handled somewhere else).

@peterharding93
Copy link
Author

Thanks that info is useful. I just read about the distinction between the AcroForm and the Annotation Widgets.

Regarding Annotation copy, I now think:

  1. A complete solution would need to copy the relevant fields from AcroForm. I'm not sure if PdfSharpCore did that.
  2. The PDFSharpCore optionally performs deep copy, PdfSharp does not. Maybe this copies the form fields? In early testing I found I needed the deep copy, but I'm not sure anymore.
  3. My testing is inconclusive. PdfSharp annotation copies seem to NOT work in Edge browser, but they do in other browsers / viewers.

I will continue to test and investigate.

Regarding my other thought, on PdfReadAccuracy, I found that PdfSharp implemented a better solution to improve robustness, the read options. Nothing to do there.

I recommend this task can be **closed / rejected ** further work on annotation copying is a bigger exercise than just copying what was done in PdfSharpCore.

@ThomasHoevel ThomasHoevel added enhancement New feature or request investigation Under investigation labels Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request investigation Under investigation
Projects
None yet
Development

No branches or pull requests

3 participants