From 34607efd32ac87400bf8f56ce23403c76e433b9a Mon Sep 17 00:00:00 2001 From: liuwei Date: Mon, 3 Mar 2025 15:41:18 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E5=85=A5=E5=88=86=E9=A1=B5=EF=BC=8C?= =?UTF-8?q?=E9=80=86=E5=BA=8F=E6=8E=92=E5=88=97=E5=B8=96=E5=AD=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sehuatang/shehuatang.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sehuatang/shehuatang.py b/sehuatang/shehuatang.py index 1b1b4c1..4d8ee6f 100644 --- a/sehuatang/shehuatang.py +++ b/sehuatang/shehuatang.py @@ -8,7 +8,7 @@ from selenium.webdriver.common.by import By from selenium.webdriver.chrome.options import Options from webdriver_manager.chrome import ChromeDriverManager from bs4 import BeautifulSoup -from reportlab.lib.pagesizes import letter +from reportlab.lib.pagesizes import letter, A3 from reportlab.lib import colors from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, Image, PageBreak from reportlab.lib.styles import getSampleStyleSheet @@ -98,7 +98,7 @@ def fetch_and_create_pdf(url): # 设置PDF pdf_filename = f"JAV-{today}-{len(today_posts)}.pdf" - doc = SimpleDocTemplate(pdf_filename, pagesize=letter) + doc = SimpleDocTemplate(pdf_filename, pagesize=A3) # 遍历帖子 for post in today_posts: @@ -145,7 +145,7 @@ def fetch_and_create_pdf(url): if image: img = PILImage.open(image) img_width, img_height = img.size - image_width = 450 + image_width = 500 image_height = int((img_height / img_width) * image_width) img_stream = BytesIO(image.getvalue()) content.append(Image(img_stream, width=image_width, height=image_height))