Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

startModifiedIndirectObject always create new object #360

Open
ohroy opened this issue Nov 29, 2023 · 0 comments
Open

startModifiedIndirectObject always create new object #360

ohroy opened this issue Nov 29, 2023 · 0 comments

Comments

@ohroy
Copy link

ohroy commented Nov 29, 2023

I try to modify sth in pdf (hidden the secret message in pdf), follow the doc

 const ctx = writer.getObjectsContext();
ctx.startModifiedIndirectObject(i)
// do sth
ctx.endIndirectObject()

It works perfect, but the only things is that startModifiedIndirectObject will always create new object instead replace old one in the real pdf file
It will append some new info after the end of pdf file

%%EOF
12 0 obj
endobj
14 0 obj
endobj
16 0 obj
endobj
29 0 obj
endobj
31 0 obj
<<
	/ModDate (D:20231130025534+05'00')
>>
endobj

And if I exec 10 times, it will append 10 times these sections..... so file will big and big. And the secret message I want to changed is still in the real pdf

How can I optimize the real pdf file ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant