From 78c78f0b91b243a98c6ae7126addf6a5ef10173b Mon Sep 17 00:00:00 2001 From: Lukas Mertens Date: Sat, 2 Jun 2018 15:22:08 +0200 Subject: [PATCH 1/2] Fixed error in Readme.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c4552f0..ab28565 100644 --- a/README.md +++ b/README.md @@ -125,7 +125,7 @@ PDFAssembler = require('pdfassembler').PDFAssembler; ### Loading a PDF -To us PDF Assembler, you must create a new PDF Assembler instance and initialize it, either with your own PDF structure object: +To use PDF Assembler, you must create a new PDF Assembler instance and initialize it, either with your own PDF structure object: ```javascript // helloWorldPdf = the pdf object defined above const newPdf = new PDFAssembler(helloWorldPdf); From 05f4b5c565ed80f214ca86d13a5cc9b90cdcb155 Mon Sep 17 00:00:00 2001 From: Lukas Mertens Date: Sun, 3 Jun 2018 16:20:23 +0200 Subject: [PATCH 2/2] Fixed error in example-code I fixed the error, that pdfObject is used like a method, even though it's a property. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ab28565..2ca36cd 100644 --- a/README.md +++ b/README.md @@ -139,13 +139,13 @@ const newPdf = new PDFAssembler(binaryPDF); ### Editing the PDF object -After you've created a new new PDF Assembler instance, you can request a promise with the PDF structure object, and then edit it. +After you've created a new PDF Assembler instance, you can request a promise with the PDF structure object, and then edit it. (Some of PDF Assembler's actions are asynchronous, so it's necessary to use a promise to make sure the PDF is fully loaded before you edit it.) For example, here is how to edit a PDF to remove all but the first page: ```javascript newPdf - .pdfObject() + .pdfObject .then(function(pdf) { pdf['/Root']['/Pages']['/Kids'] = pdf['/Root']['/Pages']['/Kids'].slice(0, 1); });