Skip to main content

Posts

Showing posts with the label java

HTML to PDF

Converting HTML to PDF with code offers more control and flexibility compared to online tools. Here are some ways to achieve this: 1. Using Python Libraries: Python provides several libraries for HTML to PDF conversion. Here are two popular options: WeasyPrint (using wkhtmltopdf): This library utilizes the powerful wkhtmltopdf tool for rendering HTML and generating PDFs. It offers fine-grained control over the conversion process. Here's an example using WeasyPrint: Python from weasyprint import HTML html_file = "my_report.html" # Replace with your HTML file path pdf_file = "report.pdf" HTML(filename=html_file).write_pdf(pdf_file) print("Converted HTML to PDF successfully!") Use code with caution. PDFKit (using wkhtmltopdf): Similar to WeasyPrint, PDFKit leverages wkhtmltopdf. It offers a simpler API for basic conversions. Here's an example using PDFKit: Python import pdfkit url = "https://www.example.com" # Replace with a...

JavaHiddenGems

Johanjanssen JavaHiddenGems Make sure to start the Docker-webserver-cache container before running the OWASP dependency check or the Old GroupIds Alerter.  Github Examples Apache PDFBox  Create and change PDF files or extract content from PDF files https://pdfbox.apache.org/ Apache POI  Create, change and read files based on the Office Open XML standards (OOXML) such as Word and Excel files. https://poi.apache.org/ ArchUnit Verify the Java code's architecture with unit tests. https://www.archunit.org/ AssertJ Test code with assertions. https://assertj.github.io/doc/ AutoService Generator for ServiceLoader service providers. https://github.com/google/auto AutoValue Generate immutable value classes. https://github.com/google/auto Awaitility Test asynchronous applications with a DSL. https://github.com/awaitility/awaitility Buildpacks Create (Docker) images. https://buildpacks.io/ ClassGraph Classpath and module scanner for Java and other JVM languages. https://github.com/c...