レス書き込み
スレへ戻る
写
レス栞
レス消
Pythonのお勉強 Part74
PC,スマホ,PHSは
ULA
べっかんこ
公式(スマホ)
公式(PC)
で書き込んでください。
名前
メール
引用切替:
レスアンカーのみ
>>341 > 聞いてみた結果 > --from PIL import Image > from reportlab.lib.pagesizes import portrait > from reportlab.pdfgen import canvas > import os > # 画像が保存されているディレクトリのパス > image_dir = 'my_folder' > output_pdf = 'output.pdf' > # 画像ファイルのリストを取得し、ファイル名順にソート > image_files = sorted([f for f in os.listdir(image_dir) if f.endswith('.jpg')]) > # 画像の幅を取得(すべての画像が同じ幅である前提) > first_image = Image.open(os.path.join(image_dir, image_files[0])) > width, _ = first_image.size > # PDFキャンバスの作成 > c = canvas.Canvas(output_pdf) > # 画像をPDFに追加 > for image_file in image_files: > image_path = os.path.join(image_dir, image_file) > img = Image.open(image_path) > img_width, img_height = img.size > if img_width != width: > raise ValueError(f"Image {image_file} has a different width: {img_width}") > # ページサイズを画像の縦サイズに設定し、新しいページを追加 > c.setPageSize((width, img_height)) > c.showPage() > # 画像をPDFに描画 > c.drawImage(image_path, 0, 0, width=width, height=img_height) > # PDFの保存 > c.save()
ローカルルール
SETTING.TXT
他の携帯ブラウザのレス書き込みフォームはこちら。
書き込み設定
で書き込みサイトの設定ができます。
・
ULA
・
べっかんこ(身代わりの術)
・
べっかんこ(通常)
・
公式(スマホ)
・
公式(PC)[PC,スマホ,PHS可]
書き込み設定(板別)
で板別の名前とメールを設定できます。
上
下
板
覧
索
設
栞
歴
Google検索
Wikipedia
ぬこの手
ぬこTOP
0.009s