Log of #ghostscript at irc.freenode.net.

Search:
 <<<Back 1 day (to 2017/10/19)20171020 
ManDay Hi, I just have a silly question for PDF experts: What sense does it make that I have form based document and when I'm trying fill in the form or make any modifications to the PDF at all on my E-Reader I get an "error" that "Editing the document is not allowed". How am I not "allowed" to edit my own files?07:56.50 
kens Well you could have set an Owner password, and permissions such that the file cannot be edited07:57.24 
  In that case you would have to open the file with teh Owner password to make changes07:57.36 
ManDay kens: It's just a PDF on a VFAT filesystem (with appropriate permissions)07:57.58 
kens If the User password was empty you could still open the file and view it, just not make changes07:58.05 
  Well, you asked a question, that is a possible answer. You didn't give any details of the file, nor what application you are using, so any reply must obviously be general07:58.42 
ManDay kens: How can there be a password on my own file? If I can see it, not being able to edit it seems like an arbitrary restriction by the viewer - not a technical limit07:58.42 
kens It could be a restriction of the viewer, how can I possibly tell ?07:59.01 
  And why should there not be an owner password on the file ?07:59.15 
  You haven't (for example) said how you created it07:59.25 
ManDay I was given the form to fill out. I really don't understand the meaning of an "owner password". It's a file I've got read and write permissions to. There is technically nothing that should stop me from making changes as I want, right?08:00.04 
kens PDF files can be password protected, separately from the file system08:00.20 
  They have 2 ppotential passwords, a User password and an Owner password08:00.35 
  If you supply the owner password then you can do anything, if you only supply the User password (or its empty) you can view hte file content, but actions are limited by the Permissions embedded in the file08:01.12 
  THis has nothing to do with the Operating System of file system08:01.22 
  Since you were given the file, I would guess that it has an Owner password and you aren't using it08:01.44 
ManDay But how can it technically be possible that I *can't* edit the file although I can see it? Even if there were some sort of assymetric encryption, I couldn't imagine what would stop me from creating a duplicate?08:02.05 
kens Because a conforming PDF consumer is not permitted to allow you to change a file that you have no permission to acces. Its the same as your Operating System respecting the permissions flags on your file system08:02.43 
ManDay So and if your viewer is not "conforming" it doesn't get the key from some central authority (I guess Adobe?) to view the file? But I can view the file on an opensource viewer (zathura with poppler plugin)!08:04.41 
kens You can view the file on any viewer if you have no User password, that's totally separate08:05.18 
  There is no central authority or key08:05.27 
  Its precisely the same as the permissions flags on a file system08:05.42 
  You could, for example, take your hard disk to another computer running a hypothetical version of Linux which can read the file system, but does not respect the permissions flags and that would open the file08:06.22 
  (Leaving aside encrypted file systems for now)08:06.32 
  PDF consumers read the (encrypted) PDF file08:06.53 
  If you supply the correct password then they will let you edit it, if you don't then they won't08:07.06 
  (This assumes an empty owner password)08:07.20 
  If teh owner password is not empty then the PDF si the same as an encrypted file system, the comsumer *can't* read the file without the password, because that's the encryption key08:07.51 
ManDay Sorry but I see your analogy to the encrypted FS falling short at the point where read and write permissions are different. If I have sufficient knowledge to read the file, then I can store an unecrypted version of it and hence have full control. So "conformity" aside, there should technically be a way to edit the file, right?08:11.53 
kens I'm using the file system analogy because that's what you seem to be fixated on08:12.25 
ManDay And if this is all about conformity (as in flags) which is the tool to change that?08:12.35 
kens You can't change the permissions if you don't have permission to change the permissions08:13.10 
ManDay Just technically the reader is the one barring me from editing the file because the file tells it "I don't want to be edited without the correct password". It's not like there is a technical reason not being able to edit it.08:13.21 
kens And you could, to continue your analogy with the file system, use something like Ghostscript to read a PDF file, and then write a new copy without the permissions or password. So this is also technically possible08:13.54 
ManDay Christ sake, I can see the unencrypted version. What stops me from storing it back with whatever permissions I want?08:13.57 
  Ok08:14.16 
  Is there a way gs can handle this without "regenerating" stuff (i.e. just scalpel like fix the permissions)?08:15.00 
kens No08:15.05 
  And what you are asking for there is hacking, in the US you could be prosecuted under teh DMCA for that08:15.29 
ManDay So if there is content embededded in the PDF which GS doesn't understand (I guess such Adboe feature stuff and scripting etc does exit) I will lose it in the process?08:15.40 
kens Yes.08:15.47 
ManDay Wow, seriously? Hacking? I have a bunch of bytes on my computer and it's illegal to modify them? o_O08:16.08 
  crazy world08:16.10 
kens Go back to whoever gave you the file, explain the problem and ask them to sort it ou08:16.14 
  You are circumventing a legal copyright protection mechanism08:16.30 
  If you strip DRM from audio files you would be in the same position08:16.49 
  Or ebooks etc.08:16.55 
  Its all bytes08:16.59 
ManDay I would assume all those you mentioned would be fine as long as I don't redistribute the data.08:18.37 
kens Nope08:18.43 
ManDay Then that's equally crazy.08:18.49 
kens Just circumventing a file is enough, though obviously if you don't distribute it the chances of being caught are minimal08:19.05 
ManDay Definitely crazy.08:19.33 
  Well thanks for the explanation. It's all about crazy laws in the end!08:19.46 
kens I'm sure the content owner would assure you its all about their legal protection from people wishing to copy their intellectual property08:20.28 
  But laws are laws08:20.39 
ManDay That's where the crazyness lies: There is nothing wrong with merely copying anyone's intellectual property.08:21.37 
  The making of a copy or modification alone bears no consequences whatsoever. The prohibition is purely preemptive to the distribution.08:22.17 
kens I suggest you go argue with a lawyer, not an engineer08:22.45 
ManDay Yeah I understand you're just the bearer of the message ;)08:23.08 
  Wouldn't hurt to agree, though :-P08:23.19 
kens Since my ability to eat depends on intellectual proerty I'm not going to agree. Nor debate this further, I do have work to do.....08:24.07 
  If you need to fill the form in, and can't then the only real recourse is to tell whoever gave you the form and ask them to sort the problem out for you08:24.31 
ManDay Now it's you who is not understanding properly that I'm stating a technical fact (apart from my opinion of it being "crazy")08:25.35 
  That the copying itsself has no meaning08:25.51 
  Is there a way to extract definite readings of these flags from a file with gs?08:49.52 
  (i.e. whether it's protected by writing by an owner password and such)08:50.05 
kens Out of the box, no. Can it be added ? Yes, with some PostScript programming08:50.43 
  Acrobat will give the infornation in the propertioes dialog08:51.11 
ManDay kens: ok i can do ps. can you point me to the right keyword I should look at ?08:54.27 
kens Offhand no08:54.36 
ManDay :p08:54.48 
  Ok thanks ;)08:54.50 
kens You need to look in ghostpdl/Resource/pdf_main.ps08:54.51 
ManDay ok!08:54.59 
kens And deteremine where the password stuff is08:55.02 
  Which is then handled in pdf_sec.ps08:55.08 
  Fundamentally, if the file is encrypted then GS will attempt to use the defaulty user password, if that fails then it will tell you and exit08:55.44 
  If it succeeds, then it uses the Permissions flag to restrict what it does thereafter08:56.04 
  Might be just /P because PDF allows for shorthand sometimes08:56.16 
  Yes its just /P08:56.40 
  In the standard Encryption dictionary08:56.53 
  Of course there are several different kinds of encryption, I'm assuming this is standard, that's one of the things you'll haev to figure out08:57.21 
  It occurs to me that the supplier of this PDF form probably expects you to print it and fill in the hard copy.08:58.27 
ManDay They suggested I do it on the computer09:03.31 
kens Well then I'd be inclined to go back and tell them you can't09:03.46 
  But its up to you09:03.50 
ManDay Sure, but first I want to make sure it's actually up to them and not some incompatibility issue or bug09:04.16 
  It's not the first time they hand out this form so I must assume there could be a mistake on my part09:04.45 
  bah i guess I'll just boot another os with acrobat installed09:07.45 
  if it doesn't work there they have to admit it's with them09:07.54 
 Forward 1 day (to 2017/10/21)>>> 
ghostscript.com #mupdf
Search: