You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

@onedoc/client

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@onedoc/client

Onedoc client for JavaScript


Version published
Weekly downloads
632
decreased by-11.24%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

@onedoc/client

Installation

Onedoc is available as an npm package.

npm install @onedoc/client

Usage

Below is the simplest example of using Onedoc to render a PDF from HTML. It outputs the PDF to a file called test.pdf.

import { Onedoc } from "@onedoc/client";
import { writeFileSync } from "fs";

const onedoc = new Onedoc("xxx-xxx-xxx-xxx"); // your API key

const { file, error, info } = await onedoc.render({
  html: "<h1 style='color: red;'>Hello world!</h1>",
  assets: [],
});

if (error) {
  throw error;
}

writeFileSync("./test.pdf", Buffer.from(file), "binary");

Documentation

For more information, please visit our documentation.

Support

For any questions or feature requests, please get in touch on Discord.

FAQs

Package last updated on 21 May 2024

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc