PDFKit, Not able to open the pdf generated
问题 I am trying to generate a pdf using some texts of my own (and not a html page). I tried using PDFKit. I am able to generate the pdf but then I am not able to open it in Preview (It may be damaged or use a file format that Preview doesn’t recognize.) Below is the code, var fs = require('fs'); PDFDocument = require ('pdfkit'); var doc = new PDFDocument // Embed a font, set the font size, and render some text doc.text('Some text with an embedded font!', 100, 100) // Add another page doc.addPage(