npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

pantherpdf

v4.0.0-beta.6

Published

<div align="center"> <a href="https://github.com/othneildrew/Best-README-Template"> <img src="docs/logo.png" alt="Logo" width="150" height="215"> </a>

Downloads

15

Readme

Powerful TypeScript library designed for creating elegant and customized reports that can be seamlessly converted into PDF documents. This versatile library offers a plethora of features and capabilities, making it an essential tool for any application seeking a robust solution for generating high-quality PDF reports.

📸 Screenshot

Report editor in action Invoice template and final result

💪 Features

  1. Empower business users to design documents
  2. Intuitive drag-and-drop WYSISYG editor
  3. Powerful data bindings and rich built in widgets
  4. Extend with custom widgets, specific for your business domain
  5. Use JavaScript code to generate complex widgets, fetch data from database etc

💼 Managed service

We offer managed editor hosting and PDF generation service. While free editor is limited to React framework only, managed editor is embedded using <iframe> into any framework. Service includes additional email and phone support. Check it out!

⬇️ Installation

npm install --save pantherpdf
yarn add pantherpdf
pnpm add pantherpdf

👩🏻‍💻 Usage

Install peer dependencies

npm install --save @mui/material react react-dom

Frontend

import React, { useState } from 'react';
import { Report, Editor, ApiEndpoints, emptyReport } from 'pantherpdf';

const editorApi: ApiEndpoints = {};

function App() {
  const [report, setReport] = useState<Report>(emptyReport);
  // Use language="en-us" for imperial/US units.
  return (
    <Editor
      layout="fullscreen"
      report={report}
      setReport={setReport}
      api={editorApi}
    />
  );
}

PantherPDF editor supports dark mode. Note that "virtual paper" will stay white. Follow MUI instructions.

Backend

import { generate, emptyReport, ApiEndpoints } from 'pantherpdf';

const api: ApiEndpoints = {};

async function main()
{
  const report = {...emptyReport};
  const data = { type: 'as-is', value: {} };

  const result = await generate({ report, api, data });
  console.log(`Size of a file: ${result.body.length}`);
}
main();

Editor is a controlled component. Data is supplied/updated using props report and setReport. It can be used to load and save data to/from database.

Examples

👷🏻‍♂️ Development

Use demo project for development.

npm run start

Running tests:

npm run test

🔥 Extending with custom widgets

Editor can be extended with custom Widgets and Transforms. Widgets are visual building blocks for reports. Transforms are used for transforming source data before it is consumed by widgets. See property descriptions for each type for detailed explanation.

Custom widgets have to be specified in EditorProps and GenerateArgs.

import {
  Editor,
  EditorProps,
  Widget,
  Transform,
  defaultTransforms,
  defaultWidgets,
} from 'pantherpdf';

const myCustomWidget: Widget = { /* ... */ };
const myCustomTransform: Transform = { /* ... */ };

const editorProps: EditorProps = {
  /* ... */
  widgets: [...defaultWidgets, myCustomWidget],
  transforms: [...defaultTransforms, myCustomTransform],
};
const generateArgs: GenerateArgs = {
  /* ... */
  widgets: [...defaultWidgets, myCustomWidget],
  transforms: [...defaultTransforms, myCustomTransform],
};

function App() {
  return <Editor {...editorProps} />;
}

☎️ Feedback and feature requests

Open an issue! For our customers we offer email and phone support.

🤝 Contributing

Contributions are welcome!

⚖️ License

MIT Copyright © Ignac Banic, 2021-present