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))