Turn Markdown or HTML you write into a well-set PDF: a report, invoice, letter, resume or plain document. Tables, headings, lists, images by URL and page breaks work; header, footer and page numbers are optional. For an invoice, resume or letter, prefer data (the fields, with template set to match): it is laid out properly, and an invoice is added up for you (leave out amounts, subtotal, tax or total to have them worked out; give them and they are checked). extract_data's invoice result can be passed as data as it is. Use it whenever the person wants a document they can download, print or send.
View input schema
{
"type": "object",
"properties": {
"markdown": {
"type": "string",
"minLength": 1,
"maxLength": 1000000
},
"html": {
"type": "string",
"minLength": 1,
"maxLength": 2000000
},
"data": {
"anyOf": [
{
"type": "object",
"properties": {
"heading": {
"description": "Printed at the top. Default \"Invoice\"; e.g. \"Tax invoice\", \"Quote\".",
"type": "string",
"maxLength": 60
},
"invoice_number": {
"type": "string",
"maxLength": 100
},
"issue_date": {
"description": "Printed as given.",
"type": "string",
"maxLength": 60
},
"due_date": {
"type": "string",
"maxLength": 60
},
"currency": {
"description": "An ISO code (\"USD\", \"NPR\") for proper formatting, or a symbol (\"Rs.\").",
"type": "string",
"maxLength": 12
},
"locale": {
"description": "Number format, e.g. \"en-IN\" for 1,00,000.00. Default \"en-US\".",
"type": "string",
"maxLength": 20
},
"vendor": {
"type": "object",
"properties": {
"name": {
"type": "string",
"maxLength": 200
},
"address": {
"description": "Lines separated by newlines.",
"type": "string",
"maxLength": 1000
},
"tax_id": {
"type": "string",
"maxLength": 100
},
"email": {
"type": "string",
"maxLength": 200
},
"phone": {
"type": "string",
"maxLength": 100
},
"logo_url": {
"description": "https image, top left.",
"type": "string",
"maxLength": 2000,
"format": "uri"
}
}
},
"customer": {
"type": "object",
"properties": {
"name": {
"type": "string",
"maxLength": 200
},
"address": {
"description": "Lines separated by newlines.",
"type": "string",
"maxLength": 1000
},
"tax_id": {
"type": "string",
"maxLength": 100
},
"email": {
"type": "string",
"maxLength": 200
},
"phone": {
"type": "string",
"maxLength": 100
}
}
},
"line_items": {
"minItems": 1,
"maxItems": 500,
"type": "array",
"items": {
"type": "object",
"properties": {
"description": {
"type": "string",
"maxLength": 1000
},
"quantity": {
"anyOf": [
{
"type": "number"
},
{
"type": "string",
"maxLength": 40,
"pattern": "\\d"
}
],
"description": "A number, or text as printed (\"1,250.00\")."
},
"unit_price": {
"anyOf": [
{
"type": "number"
},
{
"type": "string",
"maxLength": 40,
"pattern": "\\d"
}
],
"description": "A number, or text as printed (\"1,250.00\")."
},
"amount": {
"description": "Left out: quantity × unit_price.",
"anyOf": [
{
"type": "number"
},
{
"type": "string",
"maxLength": 40,
"pattern": "\\d"
}
]
}
},
"required": [
"description"
]
}
},
"subtotal": {
"description": "Left out: the lines added up.",
"anyOf": [
{
"type": "number"
},
{
"type": "string",
"maxLength": 40,
"pattern": "\\d"
}
]
},
"discount": {
"description": "Taken off the subtotal.",
"anyOf": [
{
"type": "number"
},
{
"type": "string",
"maxLength": 40,
"pattern": "\\d"
}
]
},
"tax_rate": {
"description": "Percent, e.g. 13 for 13%.",
"type": "number",
"minimum": 0,
"maximum": 100
},
"tax_label": {
"description": "Default \"Tax\"; e.g. \"VAT 13%\".",
"type": "string",
"maxLength": 40
},
"tax": {
"description": "Left out: tax_rate of the subtotal after discount.",
"anyOf": [
{
"type": "number"
},
{
"type": "string",
"maxLength": 40,
"pattern": "\\d"
}
]
},
"shipping": {
"anyOf": [
{
"type": "number"
},
{
"type": "string",
"maxLength": 40,
"pattern": "\\d"
}
],
"description": "A number, or text as printed (\"1,250.00\")."
},
"total": {
"description": "Left out: subtotal − discount + tax + shipping.",
"anyOf": [
{
"type": "number"
},
{
"type": "string",
"maxLength": 40,
"pattern": "\\d"
}
]
},
"amount_paid": {
"description": "Prints a balance due.",
"anyOf": [
{
"type": "number"
},
{
"type": "string",
"maxLength": 40,
"pattern": "\\d"
}
]
},
"payment_details": {
"description": "Bank or payment instructions.",
"type": "string",
"maxLength": 2000
},
"notes": {
"type": "string",
"maxLength": 4000
}
},
"required": [
"line_items"
]
},
{
"type": "object",
"properties": {
"name": {
"type": "string",
"maxLength": 120
},
"headline": {
"type": "string",
"maxLength": 200
},
"contact": {
"description": "Email, phone, city, links: one line, in order.",
"maxItems": 8,
"type": "array",
"items": {
"type": "string",
"maxLength": 200
}
},
"summary": {
"type": "string",
"maxLength": 3000
},
"experience": {
"maxItems": 40,
"type": "array",
"items": {
"type": "object",
"properties": {
"title": {
"type": "string",
"maxLength": 200
},
"subtitle": {
"description": "Organization, school, issuer.",
"type": "string",
"maxLength": 200
},
"location": {
"type": "string",
"maxLength": 120
},
"start": {
"type": "string",
"maxLength": 40
},
"end": {
"description": "\"Present\" for a current one.",
"type": "string",
"maxLength": 40
},
"text": {
"type": "string",
"maxLength": 2000
},
"bullets": {
"maxItems": 20,
"type": "array",
"items": {
"type": "string",
"maxLength": 600
}
}
},
"required": [
"title"
]
}
},
"education": {
"maxItems": 20,
"type": "array",
"items": {
"type": "object",
"properties": {
"title": {
"type": "string",
"maxLength": 200
},
"subtitle": {
"description": "Organization, school, issuer.",
"type": "string",
"maxLength": 200
},
"location": {
"type": "string",
"maxLength": 120
},
"start": {
"type": "string",
"maxLength": 40
},
"end": {
"description": "\"Present\" for a current one.",
"type": "string",
"maxLength": 40
},
"text": {
"type": "string",
"maxLength": 2000
},
"bullets": {
"maxItems": 20,
"type": "array",
"items": {
"type": "string",
"maxLength": 600
}
}
},
"required": [
"title"
]
}
},
"skills": {
"description": "A list, or groups: [{ \"label\": \"Languages\", \"items\": [\"Nepali\", \"English\"] }].",
"anyOf": [
{
"maxItems": 80,
"type": "array",
"items": {
"type": "string",
"maxLength": 80
}
},
{
"maxItems": 20,
"type": "array",
"items": {
"type": "object",
"properties": {
"label": {
"type": "string",
"maxLength": 80
},
"items": {
"maxItems": 40,
"type": "array",
"items": {
"type": "string",
"maxLength": 80
}
}
},
"required": [
"label",
"items"
]
}
}
]
},
"sections": {
"description": "More sections: projects, certifications, awards.",
"maxItems": 10,
"type": "array",
"items": {
"type": "object",
"properties": {
"heading": {
"type": "string",
"maxLength": 80
},
"entries": {
"maxItems": 40,
"type": "array",
"items": {
"type": "object",
"properties": {
"title": {
"type": "string",
"maxLength": 200
},
"subtitle": {
"description": "Organization, school, issuer.",
"type": "string",
"maxLength": 200
},
"location": {
"type": "string",
"maxLength": 120
},
"start": {
"type": "string",
"maxLength": 40
},
"end": {
"description": "\"Present\" for a current one.",
"type": "string",
"maxLength": 40
},
"text": {
"type": "string",
"maxLength": 2000
},
"bullets": {
"maxItems": 20,
"type": "array",
"items": {
"type": "string",
"maxLength": 600
}
}
},
"required": [
"title"
]
}
}
},
"required": [
"heading",
"entries"
]
}
}
},
"required": [
"name"
]
},
{
"type": "object",
"properties": {
"sender": {
"type": "object",
"properties": {
"name": {
"type": "string",
"maxLength": 200
},
"address": {
"description": "Lines separated by newlines.",
"type": "string",
"maxLength": 1000
},
"tax_id": {
"type": "string",
"maxLength": 100
},
"email": {
"type": "string",
"maxLength": 200
},
"phone": {
"type": "string",
"maxLength": 100
}
}
},
"recipient": {
"type": "object",
"properties": {
"name": {
"type": "string",
"maxLength": 200
},
"address": {
"description": "Lines separated by newlines.",
"type": "string",
"maxLength": 1000
},
"tax_id": {
"type": "string",
"maxLength": 100
},
"email": {
"type": "string",
"maxLength": 200
},
"phone": {
"type": "string",
"maxLength": 100
}
}
},
"date": {
"type": "string",
"maxLength": 60
},
"reference": {
"type": "string",
"maxLength": 120
},
"subject": {
"type": "string",
"maxLength": 300
},
"greeting": {
"description": "\"Dear Ms Rai,\"",
"type": "string",
"maxLength": 200
},
"body": {
"type": "string",
"minLength": 1,
"maxLength": 100000,
"description": "Markdown; a blank line starts a paragraph."
},
"closing": {
"description": "\"Yours sincerely,\"",
"type": "string",
"maxLength": 100
},
"signature_name": {
"type": "string",
"maxLength": 120
},
"signature_title": {
"type": "string",
"maxLength": 200
}
},
"required": [
"body"
]
}
],
"description": "Instead of markdown/html: the fields of an invoice, resume or letter (set template to match). We lay it out; for an invoice we also add up the lines, tax and total and report anything that doesn't add up."
},
"template": {
"type": "string",
"enum": [
"plain",
"report",
"invoice",
"letter",
"resume"
]
},
"style": {
"description": "quiet (default): modern sans, gray labels. classic: serif, fine rules, centered heads; suits letters and traditional CVs.",
"type": "string",
"enum": [
"quiet",
"classic"
]
},
"title": {
"description": "Also the file name.",
"type": "string",
"maxLength": 200
},
"page_size": {
"type": "string",
"enum": [
"A4",
"Letter"
]
},
"margin": {
"type": "string",
"enum": [
"none",
"small",
"normal",
"wide"
]
},
"header": {
"type": "string",
"maxLength": 200
},
"footer": {
"type": "string",
"maxLength": 200
},
"page_numbers": {
"type": "boolean"
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema"
}