Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/eduardylopes/pdf-generator

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/eduardylopes/pdf-generator

  • v0.0.0-20230722181536-85c689f7d3c0
  • Source
  • Go
  • Socket score

Version published
Created
Source

PDF Generator

The PDF Generator is a project that allows you to generate PDF files based on HTML templates. It utilizes the Go programming language and relies on the wkhtmltopdf tool to convert HTML to PDF. With this tool, you can easily create PDF documents from HTML templates and save the output files in the "tmp" directory.

Prerequisites

Before using this project, make sure you have the following installed:

  1. Go: The Go programming language. You can download it from the official website: https://golang.org/

  2. wkhtmltopdf: The binary from https://wkhtmltopdf.org/. This tool is responsible for converting the HTML template to a PDF document.

Installation

  1. Install Go by following the instructions on the official website.

  2. Download the wkhtmltopdf binary suitable for your operating system from https://wkhtmltopdf.org/ and install it. Make sure it's accessible via the command line by adding it to your system's PATH.

Getting Started

Follow these steps to generate PDFs using the PDF Generator:

  1. Clone the repository:
git clone https://github.com/eduardylopes/pdf-generator.git
cd pdf-generator
  1. Prepare your HTML templates:

Place your HTML templates inside the "templates" folder. These templates will be used to generate the content of the PDF files.

  1. Generate a PDF:

Use the following command to generate a PDF based on your HTML template:

go run main.go

Replace your_template.html with the filename of your HTML template, and the output.pdf will be saved in the "tmp" directory.

  1. Customize the output:

You can customize the PDF output further by specifying additional parameters supported by wkhtmltopdf. For example, you can set the page size, margins, header, footer, and more. To learn more about these options, refer to the wkhtmltopdf documentation.

FAQs

Package last updated on 22 Jul 2023

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc