Some test text!

Hamburger Icon

Nodejs / Guides / Convert from PDF

Convert PDF to multiple file types in Node.js

To convert PDF documents to different format types.

Internet connection is not required for conversion.
Convert PDF to DOCX, DOC, HTML, SVG, TIF, PNG, JPEG, XPS, EPUB, TXT, and many other formats.
async function main() {
  const doc = await PDFNet.PDFDoc.createFromFilePath(filename);

  // Convert PDF document to SVG
  await PDFNet.Convert.docToSvg(doc, output_filename + ".svg");

  // Convert PDF document to XPS
  await PDFNet.Convert.fileToXps(filename, output_filename + ".xps");

  // Convert PDF document to multipage TIFF
  const tiff_options = new PDFNet.Convert.TiffOutputOptions();
  await PDFNet.Convert.fileToTiff(filename, output_filename + ".tiff", tiff_options);

  // Convert PDF to XOD
  await PDFNet.Convert.fileToXod(filename, output_filename + ".xod");

  // Convert PDF to HTML
  await PDFNet.Convert.fileToHtml(filename, output_filename + ".html");

PDF Converter (SVG, XPS, TIFF, JPG, RTF, TXT, More)
Full sample code which shows how to use PDFNet Convert for direct, high-quality conversion between PDF, XPS, EMF, SVG, TIFF, PNG, JPEG, and other image formats.

About converting from PDF

The Apryse SDK also supports converting from PDF to other formats like EMF, EPUB, XOD, HTML and XPS.

In addition to the document formats, exporting to image formats like TIFF, SVG, PNG and JPEG are supported too.

Semantic structure information like tables, headers, footers, paragraphs are not part of the PDF specification and do not exist in PDFs. To extract this type of data, any type of conversion or extraction tool will need to have a good document understanding to differentiate between tables or paragraphs. As part of our efforts at Apryse to provide cutting edge document tools, we have created Apryse.AI - a utility for extracting tables and text from existing PDF documents as HTML or XML.

Get the answers you need: Chat with us