survey-pdf
Version:
A UI component that uses SurveyJS form JSON schemas to render forms as PDF documents. It populates PDF fields with data collected using SurveyJS Form Library and lets you export your SurveyJS forms as editable or pre-filled PDFs.
36 lines (32 loc) • 1.49 kB
JavaScript
/*!
* surveyjs - SurveyJS PDF library v2.5.21
* Copyright (c) 2015-2026 Devsoft Baltic OÜ - http://surveyjs.io/
* License: MIT (http://www.opensource.org/licenses/mit-license.php)
*/
import { P as PDFFormFillerBase, _ as __awaiter } from './pdf-form-filler-shared.mjs';
export { a as PDFJSAdapter, b as PDFLibAdapter } from './pdf-form-filler-shared.mjs';
/**
* A plugin that enables you to fill interactive fields in existing PDF forms.
*
* This plugin requires a third-party library, such as [`pdf-lib`](https://pdf-lib.js.org/) or [PDF.js](https://mozilla.github.io/pdf.js/):
*
* [View pdf-lib Demo](https://surveyjs.io/pdf-generator/examples/map-survey-responses-to-pdf-fields-using-pdflib/ (linkStyle))
*
* [View PDF.js Demo](https://surveyjs.io/pdf-generator/examples/fill-in-pdf-form-fields-with-dynamic-survey-data-using-pdfjs/ (linkStyle))
*/
class PDFFormFiller extends PDFFormFillerBase {
saveToFile(pdfBytes, fileName) {
return __awaiter(this, void 0, void 0, function* () {
const blob = new Blob([pdfBytes], { type: 'application/pdf' });
const link = document.createElement('a');
link.href = URL.createObjectURL(blob);
link.download = fileName;
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
URL.revokeObjectURL(link.href);
});
}
}
export { PDFFormFiller };
//# sourceMappingURL=pdf-form-filler.mjs.map