galkahana / HummusJS

Node.js module for high performance creation, modification and parsing of PDF files and streams
http://www.pdfhummus.com
Other
1.14k stars 169 forks source link

Text replace #454

Open rozxter1 opened 3 years ago

rozxter1 commented 3 years ago

Is there any working example for text replacing with current Hummus version used ?

I have tried for text replace https://github.com/galkahana/HummusJS/issues/71#issuecomment-394203268 - is not working with current HummusJs version (1.0.110) . Gives error : TypeError: pageObject.getDictionary(...).toJSObject(...).Contents.getObjectID is not a function Disabling that line, gives new error:

const readStream = copyingContext.getSourceDocumentParser().startReadingFromStream(textStream)
                                                                            ^
TypeError: Wrong arguments. provide a PDF stream input

All other examples around web whats based on that reply also is not working. Maybe someone can say what version was used for that example?

Thank you!