Home | About us | Overview | Software - Download | Evaluate | Order | Support | Contact | F.A.Q. | Documentations | Blog | Newsletter
Loading...

PDF password

Support for GdViewer OCX and GdViewer Pro ActiveX/SDK.

PDF password

Postby GrubyGreg » Mon Feb 15, 2010 10:27 pm

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
GrubyGreg
 
Posts: 9
Joined: Sun Feb 15, 2009 6:48 pm

Re: PDF password

Postby Loïc » Tue Feb 16, 2010 9:48 am

Hi Greg,


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


With best regards,

Loïc
Loïc Carrère, support team.
www.orpalis.com
User avatar
Loïc
Site Admin
 
Posts: 4226
Joined: Tue Oct 17, 2006 10:48 pm
Location: France

Re: PDF password

Postby rhahn » Thu Mar 03, 2011 1:35 am

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
rhahn
 
Posts: 4
Joined: Fri Feb 18, 2011 1:27 am
Location: Edmonton Alberta Canada

Re: PDF password

Postby rhahn » Fri Mar 04, 2011 2:06 am

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.
rhahn
 
Posts: 4
Joined: Fri Feb 18, 2011 1:27 am
Location: Edmonton Alberta Canada


Return to GdViewer [Pro] ActiveX

Who is online

Users browsing this forum: No registered users and 1 guest