HTML to PDF Documentation

website·Indexed 30 days ago

https://html-to-pdf.io

Developer tools and API for generating PDFs from HTML and CSS. Features a REST API based on the OpenAPI specification and multiple SDKs, including JavaScript support for React and Vue JS. Documentation covers setup, SDK integration, and API usage for versions 0.1.x and 0.2.0.

Tokens
2.8K
Snippets
11
Records
26
Agent score
44%

What's inside HTML to PDF

  1. Overview of the HTML to PDF API

    The HTML to PDF API allows developers to generate high-quality PDFs from HTML, CSS, JavaScript, and images. It is designed for automated report generation and dynamic invoice creation, integrating into any application via a RESTful API or managed SDKs. The service supports modern HTML5 and CSS3 standards.
  2. Overview of the HTML to PDF API

    The HTML to PDF API allows developers to generate high-quality PDFs from HTML, CSS, JavaScript, and images. It is designed for automated report generation and dynamic invoice creation, integrating into any application via a RESTful API or managed SDKs. The service supports modern HTML5 and CSS3 standards.
  3. Generate PDFs using HTML and CSS via html-to-pdf.io

    html-to-pdf.io provides a serverless solution to generate PDFs at scale. It allows developers to build PDFs using standard web technologies (HTML and CSS), ensuring all styles are rendered. The service is accessible via managed SDKs or a REST API.
  4. Build a custom REST API client using OpenAPI specifications

    HTML-to-PDF.io provides OpenAPI specifications to allow developers to build and test their own REST API clients instead of using managed SDKs. These specs define the required authentication, API paths, and data types for each version. To automate client generation, it is recommended to use tools such as Swagger Codegen or OpenAPI Generator.
  5. Manage billing and cancellations

    Billing is handled via Stripe and occurs every 30 days from the date of registration. There are no long-term commitments; users can cancel at any time. The service retains the current month's fee and does not offer refunds.
  6. Get started with HTML to PDF

    To begin generating PDFs from HTML, follow these three steps: 1. Install an official HTML to PDF SDK or implement a custom REST client. 2. Sign up for an account to obtain your API key. 3. Integrate the API key into your application to start generating PDFs.
  7. Install the html-to-pdf.io JavaScript SDK

    To start generating PDFs using HTML and CSS at scale, install the official JavaScript SDK using pnpm.
    pnpm i @html-to-pdf.io/sdk-javascript
  8. Get started with HTML to PDF

    To begin generating PDFs using HTML to PDF, follow these three steps:

    1. Install one of the official HTML to PDF SDKs or implement a custom REST client to interact with the API.
    2. Sign up for an account to obtain your API key (free tier available).
    3. Use the SDK or REST API to convert HTML content into PDF documents.
  9. Generate a PDF using the TypeScript/JavaScript SDK

    The @html-to-pdf.io/sdk-javascript package allows you to generate PDFs from HTML in both Browser and Node.js environments. The htmlToPdf function requires an API key and the HTML content to be converted. The result is returned as pdfData, which is a base64 encoded string of the generated PDF.
    # Install via npm, yarn, or pnpm
    pnpm i @html-to-pdf.io/sdk-javascript
    import { htmlToPdf } from "@html-to-pdf.io/sdk-javascript"
    
    const { pdfData } = await htmlToPdf({
      apiKey: "<your-api-key>",
      html: "<html><body> ... </body></html>",
    })
    
    // pdfData is a base64 encoded string of the generated PDF
  10. Build a custom REST API client using OpenAPI specifications

    HTML-to-PDF.io provides OpenAPI specifications that allow developers to build and test their own REST API clients. These specs define the required authentication, API paths, and data types for each version. To automate client generation, it is recommended to use tools such as Swagger Codegen or OpenAPI Generator.
  11. Integrate HTML to PDF in a React application

    The HTML to PDF JavaScript SDK (version 0.2.0) allows you to integrate PDF generation directly into your website, enabling users to download PDFs from a React-based frontend. The SDK is compatible with both browser-based React applications and Node.js environments.
  12. Generate PDFs using the TypeScript/JavaScript SDK

    The @html-to-pdf.io/sdk-javascript package allows you to generate PDFs from HTML in both Browser and Node.js environments. The SDK requires an API key obtained from the html-to-pdf.io dashboard. The htmlPost method returns a pdfData object containing a base64 encoded string of the generated PDF.
    # Install via npm, yarn, or pnpm
    pnpm i @html-to-pdf.io/sdk-javascript
    import { Configuration, HTMLToPDFApi } from "@html-to-pdf.io/sdk-javascript"
    
    const htmlToPDF = new HTMLToPDFApi(
      new Configuration({
        apiKey: "<your-api-key>",
      })
    )
    
    try {
      const { pdfData } = await htmlToPDF.htmlPost({
        body: JSON.stringify({
          html: "<html><body> ... </body></html>",
        }),
      })
    
      // pdfData is a base64 encoded string of the generated PDF
    } catch (error) {
      console.error(error)
    }