What is Sejda?
Sejda is a Java library meant to simplify some common Pdf documents manipulations like split, merge, rotation, etc. It is an abstraction layer that allows developers to add Pdf manipulation capabilities to their applications without having to deal with low level API. Different implementations of the available tasks can be used to maximize flexibility and to take advantage of the strength points of the underlying pdf manipulation libraries.
Sejda as the natural evolution of pdfsam. When I started to develop pdfsam, more than 6 years ago, I was a young, enthusiastic and not really experienced developer. In those years pdfsam grew a lot with new features, user suggestions and bug fixes and I also made a lot of personal experience in software development but I realized at some point that some of the design choices I made were unfortunate and the code base wasn’t inline with 2010 software development standards. Pdfsam itself was/is working pretty well but maintenance was/is a bit of a hell so I made the choice, I started to rewrite the pdf manipulation logic with 5 years of experience on my shoulders and trying to keep a close eye on quality and best practices. Sejda is going to replace what was the pdfsam-console, it has more features, it has a bigger team working on it (we are 2 now), it’s built trying to follow best practices from Joshua Bloch in Effective Java and Robert C. Martin in Clean Code, it’s easier to maintain and extend and it’s not tied to a single pdf manipulation library but it tries to take advantage of strength points of all of them.
Does Sejda implement Pdf specification?
No. Sejda is not a Pdf manipulation library itself but it can use different available libraries to manipulate Pdf documents. Libraries like iText, PDFBox or ICEpdf can be used (and are used) as underlying to implement Sejda tasks. A developer can simply populate a parameter object and execute it with the configured task implementation without knowledge of the underlying library/libraries API.
What is a task in Sejda domain?
A Sejda task is one of the available Pdf documents manipulations. Different implementations of the same task are usually available in Sejda and a developer can choose the one the better fit his needs. This approach allows to maximize efficiency and flexibility taking advantage of the strength points of all the underlying libraries and letting the user complete freedom to choose the best implementation in different scenarios.
How does it work in few words?
Let’s assume you want to add Pdf rotation capabilities to your application. With a low level pdf manipulation library you learn the library API and implement the rotation. With Sejda you have to create and instance of a parameter object, populate it with your parameters (pages you want to rotate, type of rotation..) and execute it. If you find that the chosen implementation doesn’t perform as expected you can simply configure a different implementation for the rotate task using a different library (without having to learn a new set of API).