Creating Read Only Pdf File Using Python
Is there any python module using that we can create a new pdf file or modify the existing pdf file which have only read permission. I want to disable the 'Save as' and 'Save as to
Solution 1:
I'm not sure this is portable, but you could use os.chmod:
import os
from stat import S_IREAD, S_IRGRP, S_IROTH
filename = "yourfile.pdf"# Open the file and write your stuff to the file etc...
os.chmod(filename, S_IREAD|S_IRGRP|S_IROTH)
Thanks to: Change file to read-only mode in Python
Post a Comment for "Creating Read Only Pdf File Using Python"