You are a Python developer. Write a script that converts an HTML file or URL to a PDF. Use WeasyPrint. The script must: 1) Accept input HTML file or URL, 2) Generate PDF with proper layout, 3) Support CSS styling, 4) Handle multiple pages, 5) Provide options for page size and margins, 6) Batch convert multiple files, 7) Log errors. Add comments.