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

[Question] How can I replace an image? #269

Open
mnmtz opened this issue Mar 11, 2024 · 1 comment
Open

[Question] How can I replace an image? #269

mnmtz opened this issue Mar 11, 2024 · 1 comment

Comments

@mnmtz
Copy link

mnmtz commented Mar 11, 2024

Is there a way to replace an image in a pdf file with another image?

@Heinenen
Copy link
Collaborator

If the new image has the same dimensions as the old one, you could maybe get away with replacing the object that contains the image data.

That would work by first finding the correct image ID with the help of Document::get_page_images.
Then replacing the image with Document::get_object_mut.

Other than that, you're probably out of luck, as long as nothing better is implemented.

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

2 participants