Skip to content

Fetch objects from /add objects to a given PDFGroup #410

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

appfrosch
Copy link

In an app where I was using the package, I was confronted with the problem that I had already rendered content in a PDFGroup that I wanted to add to another PDFGroup.

I am very sure that I am holding it extremely wrong and that there must be another solution to this problem already that I am not seeing–but at the same time, I came up with a solution that works for me:

  • creating a getter to fetch the internal PDFGroup.objects array
  • creating the func PDFGroup.add(_:_:) to to add an object (which is a tuple of PDFGroupContainer and PDFRenderObject to a PDFGroup

Since PDFGroup.objects is internal, an extension from my own app didn't work–so I added the code to the package itself.

I had this solution of mine in place now for a few months, but due to some git actions it seemed that my change had dissappeared from my local copy of the package–which meant I had to understand the problem (again) and reimplement my solution.

This time around I decided to fork the project though to not end up in a place where I have to reconstruct everything again–and also I thought, perhaps it might be of use to others as well, so why not create a pull request for it.

I am not that experienced when it comes to participating in open source, so let me know what I can improve on, if something comes to mind.

Also, and I'm repeating myself here, I am quite sure there must be a better solution to my problem–so if you can hint to that so that I can get rid of this hack again, please let me know

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

Successfully merging this pull request may close these issues.

1 participant