hummusRecipe icon indicating copy to clipboard operation
hummusRecipe copied to clipboard

can i use buffer instead of path

Open biloo-dev opened this issue 3 years ago • 1 comments

**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);

biloo-dev avatar Oct 27 '20 14:10 biloo-dev

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;
    });

hdiaz-nectia avatar Nov 23 '20 19:11 hdiaz-nectia