0.0.1 • Published 7 months ago

bruhat-pdf-production v0.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
7 months ago

Booking PDF Generator

Generate detailed, professional PDF booking confirmations with ease, using Express and PDFKit.

Features

  • Customizable booking details.
  • Two-column layout for organized information.
  • Includes a second page for terms and conditions.
  • Integrates images and styled elements.
  • Seamless download as a PDF file.

Installation

Install the package using npm:

npm install booking-pdf-generator

Usage

API Endpoint: POST /generate-pdf

Request Body: Send a JSON object with printBookingData containing the booking details:

{
  "printBookingData": {
    "BookingNumber": "12345",
    "BookingType": "Full Container",
    "Product": "Electronics",
    "PlaceOfReceipt": "Chennai",
    "POL": "Singapore",
    "POD": "Los Angeles",
    "Cargo": "TV Sets",
    "CargoNature": "Fragile",
    "Remarks": "Handle with care"
  }
}

Response: A dynamically generated PDF file will be downloaded.

Example Setup

const express = require('express');
const app = express();
const generatePDF = require('booking-pdf-generator');

app.use(express.json());
app.post('/generate-pdf', generatePDF);

app.listen(5000, () => {
  console.log('Server is running on http://localhost:5000');
});

Dependencies

License

This project is licensed under the MIT License.


Let me know if you'd like any adjustments!