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 with async/await #76

Open
mattboutet opened this issue Sep 19, 2018 · 0 comments
Open

Using with async/await #76

mattboutet opened this issue Sep 19, 2018 · 0 comments

Comments

@mattboutet
Copy link

Not so much an issue as a note for future explorers. Many of the functions of this library rely on this, and so won't work out of the box with Utils.promisify.

In order to successfully use promisify, it's necessary to use bind to correctly set the context when promisifying.

Example:
const fillFormWithFlatten = Utils.promisify(PDFFiller.fillFormWithFlatten.bind(PDFFiller));
await fillFormWithFlatten(original, destination, fields, false);

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