You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to generate pdf in my react js web app with the simple code
const stream = PDFMake.createPdfKitDocument(
JsxPdf.renderPdf(
<document defaultStyle={{ font: 'OpenSans', fontSize: 12 }}>
<content>This will appear in my PDF!</content>
</document>,
),
);
// write the stream to a file; this could also be streamed to an HTTP connection, stdout etc
stream.on('finish', () => console.log('PDF generated'));
stream.pipe(fs.createWriteStream('test.pdf'));
stream.end();
But I am getting error of Root element must be a < document >, so is there anything I am missing in the code? Please suggest a solution.
The text was updated successfully, but these errors were encountered:
I tried to generate pdf in my react js web app with the simple code
But I am getting error of Root element must be a < document >, so is there anything I am missing in the code? Please suggest a solution.
The text was updated successfully, but these errors were encountered: