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

can i use buffer instead of path #203

Open
biloo-dev opened this issue Oct 27, 2020 · 1 comment
Open

can i use buffer instead of path #203

biloo-dev opened this issue Oct 27, 2020 · 1 comment

Comments

@biloo-dev
Copy link

**Hi everyone **
I have an image that received it from the server
I don't want to save it to path
Can I use buffer instead of path

let ImgBuffer = res.data
const pdfDoc = new HummusRecipe(input, output);
    pdfDoc
      .editPage(2)
      .image(ImgBuffer), 350, 660, {
        width: 200,
        keepAspectRatio: true,
      }) 
      .endPage()
      .endPDF(console.log);
@hdiaz-nectia
Copy link

I want to do the same but with the encrypt method:

let bufferPdf;
const pdfDoc = new HummusRecipe(filename);
pdfDoc
    .encrypt({
        userPassword: key,
        ownerPassword: key,
        userProtectionFlag: 4
    })
    .endPDF(buffer => {
        bufferPdf = buffer;
    });

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

2 participants