diff --git a/PDFApp.js b/PDFApp.js index 3f608ae..f26711f 100644 --- a/PDFApp.js +++ b/PDFApp.js @@ -84,16 +84,16 @@ function getMetadata() { * ### Description * Update PDF metadata of a PDF blob. * - * @param {Object} object Object for updading PDF metadata. + * @param {Object} object Object for updating PDF metadata. * @return {promise} Updated PDF blob. */ -function udpateMetadata(object) { +function updateMetadata(object) { if (!this.pdfBlob) { throw new Error("Please set the source PDF blob using the setPDFBlob method."); } const pdfBlob = this.pdfBlob; const PDFA = new PDFApp(this); - return PDFA.udpateMetadata(pdfBlob, object); + return PDFA.updateMetadata(pdfBlob, object); } /** @@ -351,7 +351,7 @@ class PDFApp { * @param {Object} object Object including the values for updating metadata. * @return {promise} PDF Blob. */ - udpateMetadata(pdfBlob, object) { + updateMetadata(pdfBlob, object) { if (typeof object != "object" || Object.keys(object).length == 0) { throw new Error("Please set valid object for updating PDF metadata."); } @@ -1132,4 +1132,4 @@ class PDFApp { async getPDFObjectFromBlob_(blob) { return await this.PDFLib.PDFDocument.load(new Uint8Array(blob.getBytes())); } -} +} \ No newline at end of file diff --git a/README.md b/README.md index 71d759e..105e6f8 100644 --- a/README.md +++ b/README.md @@ -73,7 +73,7 @@ This library uses the following 3 scopes. ||| | [exportPages](#exportpages) | Export specific pages from a PDF blob. | | [getMetadata](#getmetadata) | Get PDF metadata from a PDF blob. | -| [udpateMetadata](#udpatemetadata) | Update PDF metadata of a PDF blob. | +| [updateMetadata](#updateMetadata) | Update PDF metadata of a PDF blob. | | [reorderPages](#reorderpages) | Reorder pages of a PDF blob. | | [mergePDFs](#mergepdfs) | Merge multiple PDF files in a single PDF. | | [convertPDFToPng](#convertpdftopng) | Convert PDF pages to PNG images. | @@ -191,9 +191,9 @@ PDFApp.setPDFBlob(blob).getMetadata() - This is from my post "[Management of PDF Metadata using Google Apps Script](https://medium.com/google-cloud/management-of-pdf-metadata-using-google-apps-script-60fd41f4fc16)". - + -## udpateMetadata +## updateMetadata ![](images/fig3.png) @@ -213,7 +213,7 @@ const object = { producer: "sample producer", }; -PDFApp.setPDFBlob(blob).udpateMetadata(object) +PDFApp.setPDFBlob(blob).updateMetadata(object) .then(newBlob => DriveApp.createFile(newBlob)) .catch(err => console.log(err)); ```