Installation
npm install --save @types/svg-to-pdfkit
Summary
This package contains type definitions for svg-to-pdfkit (https://github.com/alafr/SVG-to-PDFKit).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/svg-to-pdfkit.
import PDFDocument = require("pdfkit");
declare function SVGtoPDF(
doc: typeof PDFDocument,
svg: SVGElement | string,
x?: number,
y?: number,
options?: SVGtoPDF.SVGtoPDFOptions,
): void;
declare namespace SVGtoPDF {
interface SVGtoPDFOptions {
width?: number;
height?: number;
preserveAspectRatio?: string;
useCSS?: boolean;
fontCallback?: (
family: string,
bold: boolean,
italic: boolean,
fontOptions: { fauxItalic: boolean; fauxBold: boolean },
) => string;
imageCallback?: (link: string) => string;
documentCallback?: (file: string) => string;
colorCallback?: (result: string, raw: string) => [[number, number, number], number];
warningCallback?: (str: string) => void;
assumePt?: boolean;
precision?: number;
}
}
export = SVGtoPDF;
Additional Details
- Last updated: Tue, 07 Nov 2023 15:11:36 GMT
- Dependencies: @types/pdfkit
Credits
These definitions were written by Philipp Katz.