Untitled conversation
- Usercode
def write_pdf_weasy(html_path, pdf_path): # Read HTML content with open(html_path, encoding='utf-8') as f: html_content = f.read() # Define CSS for two-column layout and pagination css = CSS(string=""" @page { size: A4 landscape; margin: 20px; } body { font-family: sans-serif; column-count: 2; column-gap: 40px; column-rule: 1px solid #ddd; margin: 0; padding: 20px; } p, h1, h2, h3, blockquote { break-inside: avoid; page-break-inside: avoid; } /* Scale only images inside figures to prevent layout overflow */ figure img { max-width: 100%; max-height: 650px; height: auto; display: block; } /* Prevent figure from breaking awkwardly */ figure { break-inside: avoid; margin: 1em 0; } """) # Generate PDF HTML(string=html_content).write_pdf(pdf_path, stylesheets=[css])
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.