🛠️ToolsShed

画像→PDF変換

1枚以上の画像をPDFファイルに変換します。すべてブラウザ内で処理。

よくある質問

コード実装

from PIL import Image
import img2pdf

# Single image to PDF using img2pdf (lossless)
with open("output.pdf", "wb") as f:
    f.write(img2pdf.convert("input.jpg"))

# Multiple images to one PDF
images = ["page1.jpg", "page2.jpg", "page3.jpg"]
with open("combined.pdf", "wb") as f:
    f.write(img2pdf.convert(images))

# Using Pillow (with resizing / format conversion)
img = Image.open("input.png").convert("RGB")
img.save("output.pdf", "PDF", resolution=150)

Comments & Feedback

Comments are powered by Giscus. Sign in with GitHub to leave a comment.