Fetch objects from /add objects to a given PDFGroup
#410
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 anotherPDFGroup
.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:
PDFGroup.objects
arrayPDFGroup.add(_:_:)
to to add anobject
(which is a tuple ofPDFGroupContainer
andPDFRenderObject
to aPDFGroup
Since
PDFGroup.objects
is internal, anextension
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