MarkupGo Docs 🤘

Getting Started

Welcome to MarkupGo documentation!

Welcome to MarkupGo documentation!

Welcome to MarkupGo 🎉, your one-stop solution for generating images and PDFs using HTML, CSS, and JavaScript templates. This guide will walk you through the initial steps to get you started with our platform.

Key Features

Template Editor

One of the standout features of MarkupGo is the Template Editor. This interactive tool enables users to create, edit, and manage templates effortlessly. With the Template Editor, you can design reusable HTML, CSS, and JavaScript snippets, which can be used to generate PDFs and images on-the-fly.

URL to PDF/Image Generation

MarkupGo makes it easy to convert web pages to PDFs or images. Simply provide the URL, and the API will handle the rest, giving you a high-fidelity rendering of the web content.

HTML to PDF/Image Generation

For more control over your content, you can directly pass HTML to the API to generate PDFs or images. This method is perfect for dynamically generated content or custom-designed documents.

Image transformation API

The Image Transformation API allows you to transform images on-the-fly. You can resize, crop, rotate, and apply various filters to images. The API is designed to be simple and easy to use, and it is optimized for performance. For more information, see the Image Transformation documentation.

Use Cases

Business Reports and Invoices

Automate the creation of business reports and invoices by generating PDFs from HTML templates or web pages. Customize the appearance using the Template Editor to match your brand's style.

Marketing Materials

Create visually appealing marketing materials like brochures and flyers by converting HTML templates to high-quality PDFs and images.

E-commerce Receipts and Labels

Streamline the generation of e-commerce receipts and shipping labels by using MarkupGo to convert order details and shipping information into neatly formatted PDFs and images.

Getting Started

1. Sign Up and Get Your API Key

To start using MarkupGo, sign up on our dashboard and obtain your API key. This key is required for all API requests.

2. Explore the Template Editor

Log in to the MarkupGo dashboard and navigate to the Template Editor. Here, you can create and manage your templates:

  • Create a New Template: Design your template using HTML, CSS, and JavaScript.
  • Save and Preview: Save your template and preview it to ensure it looks exactly how you want.
  • Reuse and Customize: Use your saved templates to generate PDFs and images, customizing them as needed.

3. Generate a PDF from a Template

Using HTTP Request

Use the following example to generate a PDF from a template:

import MarkupGo from 'markupgo-node';
import * as fs from 'fs';

const markupGo = new MarkupGo({
    API_KEY: 'YOUR_API_KEY'
});

const templateData: TemplateData = {
    id: PODCAST_TEMPLATE_ID,
    context: { 
      title: 'Episode 1',
      description: 'We talk about stuff and things, tune in!'
    }
};

const pdfOptions: PdfOptions = {
    properties: {
        printBackground: true,
        landscape: true
    }
};

markupGo.pdf.fromTemplate(templateData, pdfOptions).json().then((task) => {
    console.log(task);
});

markupGo.pdf.fromTemplate(templateData, pdfOptions).buffer().then((buffer) => {
    fs.writeFileSync('output.pdf', Buffer.from(buffer));
});

4. Generate an Image from a URL

Generate an image from a web page using the following example:

import MarkupGo from 'markupgo-node';
import * as fs from 'fs';

const markupGo = new MarkupGo({
    API_KEY: 'YOUR_API_KEY'
});

const url: string = 'https://markupgo.com';

const imageOptions: ImageOptions = {
    format: 'jpeg',
    width: 800,
    height: 600
};

markupGo.image.fromUrl(url, imageOptions).json().then((task) => {
    console.log(task);
});

markupGo.image.fromUrl(url, imageOptions).buffer().then((buffer) => {
    fs.writeFileSync('output.jpg', Buffer.from(buffer));
});

Additional Resources