Add PyMuPDF engine #113

Closed
opened 3 years ago by mara0004 · 5 comments

PyMuPDF is a fast, powerful and well-maintained PDF library for Python. Could it be added as an additional engine for img2pdf, or is the AGPL license a problem?
In case PyMuPDF gets added, I would suggest to remove pdfrw support, as the latter is not maintained anymore since a longer time (see also #108).

[PyMuPDF](https://github.com/pymupdf/PyMuPDF) is a fast, powerful and well-maintained PDF library for Python. Could it be added as an additional engine for img2pdf, or is the AGPL license a problem? In case PyMuPDF gets added, I would suggest to remove pdfrw support, as the latter is not maintained anymore since a longer time (see also https://gitlab.mister-muffin.de/josch/img2pdf/issues/108).
josch commented 3 years ago
Owner

I don't see how it can be possible to add mupdf as another engine option, because as far as I understand its API, one cannot control precisely the PDF objects. Instead PyMuPDF is a high-level library that is doing the fiddling with PDF objects for you.

I don't see how it can be possible to add mupdf as another engine option, because as far as I understand its API, one cannot control precisely the PDF objects. Instead PyMuPDF is a high-level library that is doing the fiddling with PDF objects for you.
Poster

Oh, okay, I didn't know that.

Oh, okay, I didn't know that.
mara0004 closed this issue 3 years ago
Poster

I think PyMuPDF even has its own means to add images to PDFs, so img2pdf would not be necessary anyway.

I think PyMuPDF even has [its own means](https://pymupdf.readthedocs.io/en/latest/faq.html#how-to-add-images-to-a-pdf-page) to add images to PDFs, ~~so img2pdf would not be necessary anyway~~.
josch commented 3 years ago
Owner

I think PyMuPDF even has its own means to add images to PDFs, so img2pdf would not be necessary anyway.

It is, because that API function is not able to insert some of the images that img2pdf can insert into a PDF.

> I think PyMuPDF even has [its own means](https://pymupdf.readthedocs.io/en/latest/faq.html#how-to-add-images-to-a-pdf-page) to add images to PDFs, so img2pdf would not be necessary anyway. It is, because that API function is not able to insert some of the images that img2pdf can insert into a PDF.
Poster

Right, I expressed myself awkwardly. I didn't mean this method would be equivalent to img2pdf, but it would at least cover the basic functionality of adding images to PDFs.
It's just that if I were to develop an application with PyMuPDF, I would probably not use img2pdf and accept that some image types are not supported, rather than add an additional dependency and so on.

Right, I expressed myself awkwardly. I didn't mean this method would be equivalent to img2pdf, but it would at least cover the basic functionality of adding images to PDFs. It's just that if I were to develop an application with PyMuPDF, I would probably not use img2pdf and accept that some image types are not supported, rather than add an additional dependency and so on.
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: josch/img2pdf#113
Loading…
There is no content yet.