Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using require instead of nodejs modules (import) #42

Closed
ghost opened this issue Nov 18, 2019 · 2 comments
Closed

Using require instead of nodejs modules (import) #42

ghost opened this issue Nov 18, 2019 · 2 comments

Comments

@ghost
Copy link

ghost commented Nov 18, 2019

Hello,

After install of the node-signpdf i do:

const signpdf = require('node-signpdf')
const sign = signpdf.sign(
                        FS.readFileSync("pdf.pdf"),
                        FS.readFileSync("p12.p12")
                        );

But it gives:
TypeError: signpdf.sign is not a function

How to proceed with this? Thank you.

@ghost ghost closed this as completed Nov 18, 2019
@ghost
Copy link
Author

ghost commented Nov 18, 2019

I found out.... it is:

const signpdf = require('node-signpdf')
const sign = signpdf.SignPdf(
                        FS.readFileSync("pdf.pdf"),
                        FS.readFileSync("p12.p12")
                        );

The documentation is wrong.

@ghost ghost reopened this Nov 18, 2019
@ghost ghost closed this as completed Nov 18, 2019
@romische
Copy link

romische commented Apr 1, 2020

Hello,
Just in case it helps someone... for me it was

var { SignPdf } = require("node-signpdf")
new SignPdf().sign(pdfBuffer, p12Buffer);

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant