jesparza / peepdf

Powerful Python tool to analyze PDF documents
http://peepdf.eternal-todo.com
GNU General Public License v3.0
1.32k stars 242 forks source link

embed file error #68

Closed eilc0 closed 7 years ago

eilc0 commented 7 years ago

Hi I try to add txt file to an existing PDF document.

peepdf -i

ppdf>open my file ppdf> embed /root/Bureau/share/file.txt text/plain PPDF> *** Error: Exception not handled using the interactive console!! Please, report it to the author!!

any idea please ?

thank you

jesparza commented 7 years ago

Hi @eilc0,

Could you attach the error file which was generated, please? I have the feeling that you don't have permissions to access that file (located in a root path). If this is the case maybe a more explicit error should be added to show this to the user...

Cheers!

eilc0 commented 7 years ago

you'r right, it was due to root path. Thank you !

now I try to embed a jpg file into an existing pdf

PPDF> embed photo.jpg image/jpeg

File embedded successfully!!

But when I open the file.pdf with peepdf again, I don't find any new object :/

any idea ?

thank you

jesparza commented 7 years ago

Ok, it looked like it, hehe. After using "embed" you have to save the file using "save" to save replacing the content of the current file or "save newfile.pdf" to create a new file. Let me know if this works!

eilc0 commented 7 years ago

thank you !