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.
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.
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.
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.
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.
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.
Create visually appealing marketing materials like brochures and flyers by converting HTML templates to high-quality PDFs and images.
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.
To start using MarkupGo, sign up on our dashboard and obtain your API key. This key is required for all API requests.
Log in to the MarkupGo dashboard and navigate to the Template Editor. Here, you can create and manage your templates:
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));
});
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));
});