I’m a newbie as a developer (and user) to Krita. I started working on “Krisenter” - a plugin for viewing (and annotating) pdf slide presentations from within Krita.
I have some developer questions. Is there a API for dynamically adding (and removing) key-bindings? I’d like to override Left and Right within my plugin when “loading a pdf file” and restore them to their previous values at the end of the “presentation”. Is that possible?
Is there any library in Krita for converting a list of images into a multi-page pdf file? I am familiar with the cairo python binding, but I’d rather not pull in another dependency if there already is support in the Krita code base.
Thanks for the tip and the code. After reading up some more on python pdf libraries I think that I’ll add the external dependency pikepdf though, as it has the advantage of allowing adding annotations to the existing pdf structure, without having to turn the input pages to raster. This suits better my usecase of adding annotations to an existing pdf file.
Ok. But that is still not enough for what I need, as I plan to read an already existing pdf file and then drawing overlays on top of the existing pages. Your use case is different as you are creating pdf files from scratch based on info within Krita.
But question on which I provide an answer was Is there any library in Krita for converting a list of images into a multi-page pdf file?
I never tried to read PDF file with Qt, don’t know if it’s easy or not…
Qt provides many classes to read/write PDF. https://wiki.qt.io/Handling_PDF
Anyway, if you find a way to import an external library that can be used in Window/Linux/MacOS without need for user to manually install a third party software on system, I’m interested
I don’t know if it will help you but you can check out the comic manager plugin which is shipped with Krita. It takes multiple kra files and exports them to epub or cbz etc.
As a reference I got a great answer from the author of qpdf about how to add an image overlay to a page of a pdf file. This is exactly what I was looking for, for saving the user annotations to a pdf file. Note that pikepdf is the python binding to qpdf.