On Mon, 26 Aug 2024 at 17:58, zyx via Podofo-users <podofo-users@lists.sourceforge.net> wrote: > On Mon, 2024-08-26 at 15:19 +0200, Christian Sakowski wrote: > > i know the thread is 10 years old, but there was no final answer to > > this. > > many things changed during the years. The biggest is the API rewrite > Francesco Pretto is working on for the 1.x release/series. >
A more extensive API rework about /Names handling just landed[1]: it's meant to be used like in this[2] unit test and should provide a comprehensive answer on how to extract file attachments in PoDoFo with an higher level API. A frequent (and understandable) pattern in PoDoFo 0.9.x is that classes like PdfNamesTree (now PdfNameTrees) and few others offered generic but unspecialized helper methods, and not a comprehensive API to access the complexity and variety of the PDF document elements. This is clearly an approach that requires less design/development time, but I thought that with 1.0 we should have a better API to access these entities. I tried to preserve the old approach with generic/unspecialized methods so I put all those methods in a base pure interface class[3] and selectively implement publicly the appropriate methods in PdfNameTrees (I used the same approach in PdfPainter and PdfResources). It's sometimes embarrassing how long these reworks take, mostly because of the complexity of C++: I estimated I could write the same code twice as fast with a language of my liking (C#) with the same identical API expressivity and performance, if not better in some cases. The point is that C++ development (and API design in particular) requires many more micro decisions, and not always among the big amount of options you can choose to make the same thing there's one that gives the best theoretical performance. I could elaborate more on this later, but the good news now is that the last work further shrank my TODO list with all my objectives for the API review and I think in 2 weeks we can tag a 1.0.0-beta. In other news, I recently released[4] 0.10.4 with some critical/selected fixes that accumulated in the past few months. Greetings, Francesco [1] https://github.com/podofo/podofo/commit/25d7de8ed4e49fbee751a7bb3a13e249114b6314 [2] https://github.com/podofo/podofo/blob/73511a3514920463e0da9ff1d59cedcb66aabfcd/test/unit/BasicTest.cpp#L153 [3] https://github.com/podofo/podofo/blob/master/src/podofo/main/PdfNameTreeOperations.h [4] https://github.com/podofo/podofo/releases/tag/0.10.4 _______________________________________________ Podofo-users mailing list Podofo-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/podofo-users