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

Python 3.6 - file not in binary mode for writing #2

Open
jdstrydom opened this issue Oct 9, 2018 · 3 comments
Open

Python 3.6 - file not in binary mode for writing #2

jdstrydom opened this issue Oct 9, 2018 · 3 comments

Comments

@jdstrydom
Copy link

Hi,

Using Python 3.6 - received error message and zero-size signed .pdf when using for example:

signpdf --date myfile.pdf signature.png

file <myfile.pdf> to write to is not in binary mode. It may not be written to correctly. [pdf.py:453]

I had to change line 62 of "/usr/local/lib/python3.6/dist-packages/signpdf.py"

From: with open(output_filename, 'w') as fh:
To: with open(output_filename, 'wb') as fh:

All good now
Regards
Jurie

@paddotk
Copy link

paddotk commented Jun 20, 2019

@jdstrydom Thanks for the tip, though that file does not exist for me . I have the folders /python2.7/ and /python3.5/ instead, and both their /dist-packages folders are empty.

It does seem to work as long as the image is within the bounds of the page though (in terms of coordinates).

I hope this bug can be fixed!

@Davidbillingsley
Copy link

@yourcelf @paddotk @jdstrydom I do have one question, that i thought of while working on this bug. Would it be more beneficial to have the signature image appear behind the pdf file? This way the pdf file will hide the image if text covers it, or do you want the image to hide any text the image file might be hiding?

@paddotk
Copy link

paddotk commented Jun 21, 2019

IMHO that's not logical. Also imagine dotted lines that are intended to put a signature on, that would obfuscate the signature image as well.
Also, this isn't really related to this topic..

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

3 participants