Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Simple python wrapper to convert HTML to PDF with headless Chrome via selenium.
pip install pyhtml2pdf
Use with website url
from pyhtml2pdf import converter
converter.convert('https://pypi.org', 'sample.pdf')
Use with html file from local machine
import os
from pyhtml2pdf import converter
path = os.path.abspath('index.html')
converter.convert(f'file:///{path}', 'sample.pdf')
Some JS objects may have animations or take a some time to render. You can set a time out in order to help render those objects. You can set timeout in seconds
converter.convert(source, target, timeout=2)
Compress the converted PDF
Some PDFs may be oversized. So there is a built in PDF compression feature.
The power of the compression,
converter.convert(source, target, compress=True, power=0)
You can use print options mentioned here
converter.convert( f"file:///{path}", f"sample.pdf", print_options={"scale": 0.95} )
Use it to compress a PDF file from local machine
import os
from pyhtml2pdf import compressor
compressor.compress('sample.pdf', 'compressed_sample.pdf')
Inspired the works from,
FAQs
Simple python wrapper to convert HTML to PDF with headless Chrome via selenium.
We found that pyhtml2pdf demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.