PDF
Introduction
- PDF endpoint convers websites to PDFs
- You can see the original docs from here
Example
https://puppeteer-service.appysode.com/pdf?url=https://mrtgny.com&printBackground=true&pageRanges=1-1&scale=1.5
Interface
interface PuppeteerService extends PDFOptions{
download?: boolean; // Default is false. If sets as true it downloads the file
fileName?: string; // Default value is the url
url: string;
}
// Supported parameters
interface PDFOptions {
displayHeaderFooter?: boolean; // Whether to show the header and footer.,
footerTemplate?: string; // HTML template for the print footer
headerTemplate?: string; // HTML template for the print header
format?: PaperFormat; // Default value is a4
height?: number;
width?: number
scale?: number
preferCSSPageSize?: // Give any CSS @page size declared in the page priority over what is declared in the width or height or format option.
pageRanges?: string; // Paper ranges to print, e.g. 1-5, 8, 11-13.
landscape?: boolean // Whether to print in landscape orientation.,
omitBackground?: boolean // Hides default white background and allows generating pdfs with transparency.,
printBackground?: booelan //Set to true to print background graphics.
}
declare type PaperFormat = 'letter' | 'legal' | 'tabloid' | 'ledger' | 'a0' | 'a1' | 'a2' | 'a3' | 'a4' | 'a5' | 'a6';