From 213cf534743327eb76264b77336777a5f3980f9b Mon Sep 17 00:00:00 2001 From: zboris12 Date: Sat, 17 Sep 2022 22:08:29 +0900 Subject: [PATCH] Improve samples in readme. --- README.md | 54 +++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index 9109c37..56e928a 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Just import the dependencies and this tool. ```html - + ``` ## Let's sign @@ -27,16 +27,16 @@ Sign with an invisible signature. * @param {ArrayBuffer} pdf * @param {ArrayBuffer} cert * @param {string} pwd - * @return {Blob} + * @return {Promise} */ async function sign1(pdf, cert, pwd){ - /** @type {SignOption} */ - var sopt = { - p12cert: cert, - pwd: pwd, - }; - var signer = new PdfSigner(sopt); - return await signer.sign(pdf); + /** @type {SignOption} */ + var sopt = { + p12cert: cert, + pwd: pwd, + }; + var signer = new PdfSigner(sopt); + return await signer.sign(pdf); } ``` @@ -49,26 +49,26 @@ Sign with a visible signature of a picture. * @param {string} pwd * @param {ArrayBuffer} imgdat * @param {string} imgtyp - * @return {Blob} + * @return {Promise} */ async function sign2(pdf, cert, pwd, imgdat, imgtyp){ - /** @type {SignOption} */ - var sopt = { - p12cert: cert, - pwd: pwd, - drawinf: { - area: { - x: 25, // left - y: 150, // top - w: 60, // width - h: 60, // height - }, - imgData: imgdat, - imgType: imgtyp, - }, - }; - var signer = new PdfSigner(sopt); - return await signer.sign(pdf); + /** @type {SignOption} */ + var sopt = { + p12cert: cert, + pwd: pwd, + drawinf: { + area: { + x: 25, // left + y: 150, // top + w: 60, // width + h: 60, // height + }, + imgData: imgdat, + imgType: imgtyp, + }, + }; + var signer = new PdfSigner(sopt); + return await signer.sign(pdf); } ```