Nutrient Web SDK
    Preparing search index...

    Function convertToOffice

    • Converts a document to the specified supported conversion format.

      Returns a https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Promise|Promise resolving to an ArrayBuffer of the converted document, or rejecting with a NutrientViewer.Error.

      It requires a configuration object. If the configuration is invalid, the promise will be rejected with a NutrientViewer.Error.

      Parameters

      • configuration: StandaloneConfiguration

        A configuration Object.

      • format: string

        Format to export the document to.

      Returns Promise<ArrayBuffer>

      Promise that resolves to an ArrayBuffer of the converted file

      NutrientViewer.convertToOffice({
      document: "/article.pdf",
      licenseKey: "YOUR_LICENSE_KEY",
      },
      NutrientViewer.OfficeDocumentFormat.docx
      ).then((arrayBuffer) => {
      console.log("Successfully converted document", arrayBuffer);
      }).catch((error) => {
      console.error(error.message);
      })

      @public