PDF Generation in Deno

How to generate PDFs using TTA in Deno.

Generate PDFs in Deno

import { TextToAnything } from "@texttoanything/deno";

const TTA = new TextToAnything(/*API token here*/);

const PDFFile = await TTA.generatePDF("test.pdf", {
  header: "Header HTML", // optional
  html: "<h1>Hello world!</h1>",
  footer: "Footer HTML", // optional
  landscape: false, // false -> portrait, true -> landscape mode (default)
  format: "A4",
});

Use TTA's PDF generation in Deno to create PDFs from HTML content. You can customize the header, footer, and layout (portrait/landscape) of the PDF.

The generated PDF file will be returned as a Blob.