// Option 1: Using CDN (include this script tag in your HTML)// <script src="https://cdn.jsdelivr.net/npm/@joyfill/components@latest/dist/joyfill.min.js"></script>// Option 2: Using ES Modules// import Joyfill from "@joyfill/components/dist/joyfill.min.js";// Initialize JoyDocExporterconst container = document.getElementById('exporter-container');const myDocument = Joyfill.getDefaultDocument();Joyfill.JoyDocExporter( container, { doc: myDocument, config: { page: { height: 1056, width: 816, padding: 20 } }, theme: { fontFamily: 'sans-serif', field: { margin: 4 } } });
Note: For JavaScript usage, you must import from dist/joyfill.min.js because it’s a UMD bundle that includes React and provides browser-friendly wrapper functions. The main package exports (@joyfill/components) are React components that require React as a peer dependency.