You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Support to attach images jpg and png as a page, to merge with PDFs, simply convert image to pdf (how fronted of img2pdf), or combined several images as pages of one PDF, a lot of new features.
The Python library img2pdf can do the job. According to img2pdf on Gitlab, a pseudo-code could be:
if extension_file is jpg/png:
import img2pdf
# specify paper size (A4)
a4inpt = (img2pdf.mm_to_pt(210),img2pdf.mm_to_pt(297))
layout_fun = img2pdf.get_layout_fun(a4inpt)
# convert the image to pdf page
with open("imageTOconvert","wb") as f:
f.write(img2pdf.convert('temporaryPDF.pdf', layout_fun=layout_fun))
# open/add the PDF created with the current code of Pdfarranger
......
# remove the file created by img2pdf after adding it or when exit Pdfarranger
import os
os.remove("temporaryPDF.pdf")
It is also necessary:
Add img2pdf as dependency (available in the official Ubuntu/Archlinux/Manjaro/others repositories).
When clicking on open/add a pdf, add .png and .jpg to the list of extensions to search.
Change README.md for mention the new features and "frontend for python-pyPdf and img2pdf".
The text was updated successfully, but these errors were encountered:
What is the point of copying Pdf Shuffler, rebranding, and not making relevant improvements that justify the fork? Especially being easy to program and not affecting to the features provided by Pdf Shuffler.
I do not know enough of Python, implement the idea depends on others, it's their decision.
I won't work on that feature as I prefer to keep using imagemagick or img2pdf in command line than using pdfarranger. But if someone do it and manage to make the dependencies (img2pdf or whatever) optional (in the python code and in the setup.py), I'll integrate his work.
Support to attach images jpg and png as a page, to merge with PDFs, simply convert image to pdf (how fronted of img2pdf), or combined several images as pages of one PDF, a lot of new features.
The Python library img2pdf can do the job. According to img2pdf on Gitlab, a pseudo-code could be:
It is also necessary:
The text was updated successfully, but these errors were encountered: