hummusRecipe icon indicating copy to clipboard operation
hummusRecipe copied to clipboard

Delete Page

Open mumapu opened this issue 5 years ago • 3 comments

Hello! Thanks for amazing library! It's possible delete pages?

mumapu avatar Feb 19 '19 17:02 mumapu

https://github.com/galkahana/HummusJS/issues/340

Hello, HummusJS does not provide this feature out of box. At this moment, you can create a new pdf and just append the page you need.

chunyenHuang avatar Feb 19 '19 17:02 chunyenHuang

I am Trying to extract just single page From new.pdf which is 7 pages. But geting 5 pages Append is not working for me What is Wrong in my code ...?

const sourcePDF = path.join(__dirname, `/output/new.pdf`);
                console.log('sourcePDF => ' + sourcePDF);
                const longPDF = path.join(__dirname, `/comprressed/two.pdf`);
                const fOutput = path.join(__dirname, `/output/two.pdf`);
                console.log('fOutput => ' + fOutput);
                const pdfDoc = new HummusRecipe(sourcePDF, fOutput);
                pdfDoc
                    .appendPage(longPDF, 1)
                    .endPDF();

                res.send(longPDF.metadata);

Asumoon avatar Feb 22 '19 09:02 Asumoon

https://github.com/chunyenHuang/hummusRecipe#append-pdf

chunyenHuang avatar Feb 22 '19 17:02 chunyenHuang