PDF-XChange Viewer SDK for Developer's
(ActiveX and Simple DLL Versions)
Moderators:PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange
ctrl.DoDocumentVerb(docId, "", "RemoveSecurity", dataIn, NULL, PXCVA_NoUI);
// if success - save document without security
ctrl.SaveDocument(docId);
But where do I set the special owner password after opening the document for calling RemoveSecurity?
I your documentation, I read: "For example, if the document is the password-protected then you should specify the special *owner
password for opening."
*OpenDocument will only allow a "OpenPassword" but no way to set the "OwnerPassword".
A PDF could have two passwords - a user and owner one. It could be that the PDF has an empty user password and an arbitrary owner one - if you open the file with empty password in this case you won't be able to change (remove) the security restrictions, and if you open it with the owner password - the RemoveSecurity will work.
If you want prompt answers - we do need all information and samples - otherwise our team have to spend valuable time potentially recreating a sample PDF and application to provide an answer - if you are happy to wait until someone has the time to do all this - just let us know and we will place it into the queue that things go when where we cannot quickly test and get to the bottom of it - the choice is yours.
Time is at an absolute premium here at the moment preparing new releases and products - the staff that answer these questions have to be interrupted from doing their primary job to do so - and we try and minimise the 'down time' by ensuring we have as complete a set of info as we can - so you can an expedited answer and they can test and answer quickly.
Please understand we ask such annoying questions for good reason - not to simply irritate you ...
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.
If you want prompt answers - we do need all information and samples - otherwise our team have to spend valuable time potentially recreating a sample PDF and application to provide an answer - if you are happy to wait until someone has the time to do all this - just let us know and we will place it into the queue that things go when where we cannot quickly test and get to the bottom of it - the choice is yours.
Time is at an absolute premium here at the moment preparing new releases and products - the staff that answer these questions have to be interrupted from doing their primary job to do so - and we try and minimise the 'down time' by ensuring we have as complete a set of info as we can - so you can an expedited answer and they can test and answer quickly.
Please understand we ask such annoying questions for good reason - not to simply irritate you ...
Sorry, but up to the present moment I was thinking, that there is no bug or prblem with the viewer - I was thinking there is only a code-mistake from me. I was not aware that you test the code yet to need. So please let me know, if you need further infos/code samples!
I am not saying there is or is not a bug - I am just saying that to ensure we can answer fully and quickly - we do need as much info to test and reproduce the problem - so then we can say - its your code or no - its our bug.
Thanks for your your understanding.
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.
We have found one small but annoying bug with 'OpenDocument'. Current behavior is: if document is secured the viewer firstly will try to open it with empty password and if success - will ignore the non-empty 'owner' password passed from you. Sure - it is wrong behavior and we will fix it in the next build. Currently you may use next workaround:
Viewer.OpenDocument sFileName, "", 0, PXCVA_NoUI
Viewer.DoDocumentVerb 0, "", "RemoveSecurity", DataIn, Null, 0 // use it without PXCVA_NoUI ! it will ask the 'owner' password...
Viewer.SaveDocument 0, sNewFileName, PXCVA_DocumentSaveCopyAs, PXCVA_Sync Or PXCVA_NoUI
HTH.
PDF-XChange Co. LTD (Project Developer)
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
Vasyl-Tracker Dev Team wrote:Viewer.DoDocumentVerb 0, "", "RemoveSecurity", DataIn, Null, 0 // use it without PXCVA_NoUI ! it will ask the 'owner' password...
Thank you for Lightspeed answer. But the Owner PW is very secret and comes AES crypted from the database. I can not prompt a dialog for entry it.
So I think I must wait for next build
What do you think, the next build will be released?
@Paul, Stefan: Thanks to you too for very fast help!
When The Viewer prompts you for the password - you can capture the
Prompts.EnterDocumentPassword
Event pass the password from the database without any user interaction.
I do not have any specific date for the next build yet - but will let you know as soon as I do