You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, i Would like to know if i'm using the Recip object correctly. I want to loop over every page of my pdf document to add a text, for exmaple the page number to the document, but when im using the loop at the following example. The saved out put buffer is still the same. Im also using the createReader since i'm not able to get the page count over the recip.
constwriteTest=(pdfBuffer: Buffer)=>{this.logger.log("write file")fs.writeFileSync('./pdfs/BaseWithTestText.pdf',pdfBuffer);}constaddPageNumber=(pdfBuffer: Buffer,skipFirstPage?: boolean)=>{//create readStream from BufferconstreadBuffer=newPDFRStreamForBuffer(pdfBuffer);//create readStream to get Page CountconstpdfReader=createReader(readBuffer)//create recipeconstrecipe=newRecipe(pdfBuffer);//loop over pages at index 1for(leti=1;i==pdfReader.getPagesCount();i++){recipe.editPage(i).text("Test funktioniert das",42,42).endPage();}//save updated pdf to file systemrecipe.endPDF((cb)=>this.writeTest(cb));}constmain=()=>{constbuffer=fs.readFileSync('./pdfs/Base.pdf');addPageNumber(buffer);}main();
The text was updated successfully, but these errors were encountered:
Hello, i Would like to know if i'm using the Recip object correctly. I want to loop over every page of my pdf document to add a text, for exmaple the page number to the document, but when im using the loop at the following example. The saved out put buffer is still the same. Im also using the createReader since i'm not able to get the page count over the recip.
The text was updated successfully, but these errors were encountered: