You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

github.com/Kenasvarghese/PDF-Generator

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/Kenasvarghese/PDF-Generator

v0.0.0-20250130120617-025d78f2be0c
Source
Go
Version published
Created
Source

PDF Generator

A simple and efficient PDF generation app that allows users to generate PDFs dynamically using predefined templates. The app exposes a POST endpoint that accepts a request body with the necessary data and configuration to generate the PDF. The template used for the PDF is customizable within the app.

Run Locally

Clone the project

  git clone https://github.com/Kenasvarghese/PDF-Generator.git

Go to the project directory

  cd PDF-Generator

Start the server

  go run main.go

NOTE: You can change host, browserURL, template of the service by editting the corresponding file

- Change configuration file

Update values of file ./config/config.json

{
    "port":"8008",
    "basepath":"/v1",
    "browserurl":""
}
- Change PDF template

Update html of file ./pdfgenerator/template.go

- To get browser WS address
  • Close all instances of chrome,

  • Run chrome in remote debugging mode

    • On Windows:
    chrome.exe --remote-debugging-port=9222
    
    • On macOS/Linux:
    google-chrome --remote-debugging-port=9222
    
  • Navigate to: Remote Debugging Interface

- To generate PDF
  • Send a post request
    • Path: /generate
    • Method: POST
    • Body:
      {
          "name":"kenas",
          "email":"name@example.com",
          "dob":"01/12/2025",
          "gender":"male"
      }
      
  • The PDF will be generated in output.pdf

FAQs

Package last updated on 30 Jan 2025

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.