Some test text!

Loading...
Guides
Create a blank PDF

Create a new blank PDF document in Node.js

To create a new document as a blank PDF.

async function main() {
  // use the empty constructor to create a blank PDF
  const doc = await PDFNet.PDFDoc.create();

  // optionally perform some document processing using read write operations 
  // found under 'Editing Page Content' or 'Page Manipulation'

  // save the document to the filesystem
  await doc.save(output_filename, PDFNet.SDFDoc.SaveOptions.e_linearized);

  // optionally save the document to a memory buffer
  const buf = await doc.saveMemoryBuffer(PDFNet.SDFDoc.SaveOptions.e_linearized);
}
PDFNet.runWithCleanup(main);

Read & write a PDF file from/to memory buffer
Full source code which illustrates how to read/write a PDF document from/to memory buffer. This is useful for applications that work with dynamic PDF documents that don't need to be saved/read from a disk.

Get the answers you need: Support

Upcoming Webinar: Customer Experience and Retaining Control: Boosting Document Automation and Efficiency in Financial Services | Sept 15, 2022 at 11 am PT

PDFTron SDK

The Platform

NEW

© 2022 PDFTron Systems Inc. All rights reserved.

Privacy

Terms of Use