pdf-lib
pdf-lib copied to clipboard
pdf-lib automatically add a layer without any operation
What were you trying to do?
i start a simple demo, just load a pdf file, then save it as a new file, without any other operation
Why were you trying to do this?
i want test the pdf-lib's usability
How did you attempt to do it?
i just load and then save the file, without any other operation. demo project is below pdflib-demo.zip
What actually happened?
when load a pdf file, without doing anything, just save as a new file, pdf-lib has add a layer automatically
What did you expect to happen?
when load a pdf file, without doing anything, just save as a new file, it should be the same as the origin file
How can we reproduce the issue?
run the example node project, then get the new.pdf, you can find that it's different from the origin.pdf the new.pdf has automatically add a layer show in right-top corner
Version
1.17.0
What environment are you running pdf-lib in?
Node
Required Reading
- [X] I have read www.sscce.org.
- [X] My report includes a Short, Self Contained, Correct (Compilable) Example.
- [X] I have read Smart Questions.
- [X] I have read 45 GitHub Issues Dos and Don'ts.
Additional Notes
No response
Hello @shukaka!
Thank you for submitting this bug report and providing a SSCCE. I was able to reproduce the issue.
The "new" text is present in the origin.pdf but isn't visible for some reason. When it's saved with pdf-lib, the mechanism that was hiding the text isn't preserved. This is why it looks like new text is coming out of nowhere. That being said, I'm not sure what mechanism is being used to hide the text in the original document. Will need to figure that out in order to fix the issue.
Can you share any details about how the origin.pdf was created?
@Hopding Thank you for reply!
i don't know how the file is created, it was uploaded by my user, i can't find the creater.
i have compared the origin.pdf and new.pdf in adobe pdf reader,i found that the new.pdf has duplicate a layer called "watermark", I don't know if this will help for you