PDF password
PDF password
I have some PDF files which are password protected. Can you supply the password programmatically? I would like to create a procedure which would check the Windows user and if it is me then the procedure would supply the password (so that gdViewer does not ask me for the password).
Greg
Greg
Re: PDF password
Hi Greg,
Turn the PdfShowDialogForPassword property to False. Then, catch the PdfPasswordRequest to provide the PDF passwortd using your own way.
IE:
With best regards,
Loïc
Turn the PdfShowDialogForPassword property to False. Then, catch the PdfPasswordRequest to provide the PDF passwortd using your own way.
IE:
Code: Select all
Private Sub GdViewer1_PdfPasswordRequest(Password As String)
Password = MyPasswordQuery()
End Sub
Loïc
Re: PDF password
Sorry to dig up an old post.
Is there a way to Cancel from the event? The box I show to the user lets them cancel the operation but then an invalid PW error is shown. What I would like to do is Catch the Cancel from my dialog and err.raise 32755. The rest of my app does a lot of work with windows Common dialog and I've got it wired up to fall through and pretend like nothing happed.
I"ve tried raising the err inside the event but VB will not let it fall down the stack and let my FileOpen() handle it. It just shows a runtime err0r
The only reason I don't use the built in GD password dialog is so that I can catch the PW and reuse it during saving and to send it to a thumbnail ocx i use so the user doesn't need to enter it twice.
Thanks
Ron
Is there a way to Cancel from the event? The box I show to the user lets them cancel the operation but then an invalid PW error is shown. What I would like to do is Catch the Cancel from my dialog and err.raise 32755. The rest of my app does a lot of work with windows Common dialog and I've got it wired up to fall through and pretend like nothing happed.
I"ve tried raising the err inside the event but VB will not let it fall down the stack and let my FileOpen() handle it. It just shows a runtime err0r
The only reason I don't use the built in GD password dialog is so that I can catch the PW and reuse it during saving and to send it to a thumbnail ocx i use so the user doesn't need to enter it twice.
Thanks
Ron
Re: PDF password
I was able to get close to what I want using the status id's 201 202 to tell the difference between a blank pw and a wrong pw. I set up my form to send a blank pw if cancel was pressed and if the user entered a blank pw i returned a vbcrlf as a placeholder so it would come back as bad rather than canceled. I get the GdPicturePro5 msgbox "Invalid password." which is annoying if cancel is pressed.
A very nice improvement would be to have all of the management pushed to the application if PDFShowDialogForPassword = false . Also, a function to test whether or not a PDF is pw protected and with what method would be nice.
A very nice improvement would be to have all of the management pushed to the application if PDFShowDialogForPassword = false . Also, a function to test whether or not a PDF is pw protected and with what method would be nice.
Re: PDF password
SilentMode = True
Who is online
Users browsing this forum: No registered users and 2 guests