FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Acrobat reader
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Acrobat reader
Posted: Thu Nov 05, 2009 11:41 AM
Dear friend, the following sample opens a PDF in Acrobat Reader:

Code (fw): Select all Collapse
#include "Fivewin.ch"


FUNCTION MAIN()

    LOCAL oWnd, oPdf

    DEFINE WINDOW oWnd

    oPdf = TActiveX():New( oWnd, "AcroPDF.PDF" )

    oPdf:LoadFile = "E:\FW\Update43-29-sera.pdf"

    oWnd:oClient = oPdf

    ACTIVATE WINDOW oWnd;
             MAXIMIZED

    RETURN NIL


Anybody knows how to open a password protected PDF without user intervention (the program knows the password)?

Thanks in advance.

EMG
Posts: 36
Joined: Thu Oct 26, 2006 05:23 PM
Re: Acrobat reader
Posted: Thu Nov 05, 2009 08:51 PM

Enrico,

This doesn't answer your question exactly, but I use a great library for all kinds of PDF related work, and it definitely allows you to open a secured PDF with ease. You can then resave it with new options or do all kinds of cool stuff. Also, I use the Sumatra PDF reader for super fast display of PDF files.

Check it out:

http://www.quickpdflibrary.com

http://blog.kowalczyk.info/software/sumatrapdf

Andy

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Posts: 230
Joined: Sat Apr 19, 2008 10:28 PM
Re: Acrobat reader
Posted: Fri Nov 06, 2009 08:53 AM
Good morning.


DEFINE WINDOW oWnd
oPdf = TActiveX():New( oWnd, "AcroPDF.PDF" )
oPdf:LoadFile = "E:\FW\Update43-29-sera.pdf"


I use Foxit freeware instead of Acrobat Reader. While Acrobat reader is bigger than 70 mb, Foxit is only 5 mb and much, much faster to load and to open files. Intregration with Firefox is also better than acrobat. Also I don't like that acrobat reader is looking for upgrades all the time. So my question is: What do I have to put to replace "AcroPDF.PDF" in you code above.

Thank you very much.

Alvaro
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Acrobat reader
Posted: Fri Nov 06, 2009 10:42 AM

Are you sure that Foxit offers an ActiveX object?

EMG

Posts: 230
Joined: Sat Apr 19, 2008 10:28 PM
Re: Acrobat reader
Posted: Fri Nov 06, 2009 11:25 AM

Yes, I just found out:

http://www.foxitsoftware.com/pdf/sdk/activex/

http://foxit.vo.llnwd.net/o28/pub/foxit ... _guide.pdf

The reader is freeware, but the ocx is not, I think. I will try it.

Alvaro

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Acrobat reader
Posted: Fri Nov 06, 2009 12:19 PM

I wonder if similar documentation is available for Acrobat reader...

EMG

Posts: 1598
Joined: Fri Oct 07, 2005 05:56 PM
Re: Acrobat reader
Posted: Sat Nov 07, 2009 06:41 PM
Dear All,

This function is useful. How can I make it on Top of Window Backgroup? Because when I use this function from the Main window, it will be minimized.
Enrico Maria Giordano wrote:Dear friend, the following sample opens a PDF in Acrobat Reader:

Code (fw): Select all Collapse
#include "Fivewin.ch"


FUNCTION MAIN()

    LOCAL oWnd, oPdf

    DEFINE WINDOW oWnd

    oPdf = TActiveX():New( oWnd, "AcroPDF.PDF" )

    oPdf:LoadFile = "E:\FW\Update43-29-sera.pdf"

    oWnd:oClient = oPdf

    ACTIVATE WINDOW oWnd;
             MAXIMIZED

    RETURN NIL


Anybody knows how to open a password protected PDF without user intervention (the program knows the password)?

Thanks in advance.

EMG

Regards,
Dutch
Regards,

Dutch



FWH 2304 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio

FWPPC 10.02 / Harbour for PPC (FTDN)

ADS V.9 / MySql / MariaDB

R&R 12 Infinity / Crystal Report XI R2

(Thailand)
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Acrobat reader
Posted: Sat Nov 07, 2009 07:15 PM
Try:

Code (fw): Select all Collapse
SETWINDOWPOS( oWnd:hWnd, -1, 0, 0, 0, 0, 3 )


EMG
Posts: 230
Joined: Sat Apr 19, 2008 10:28 PM
Re: Acrobat reader
Posted: Sun Nov 08, 2009 08:00 PM

Andy, can you show how you inicialize the activex control with quickpdflibrary?

I get an error with:

::oControl := TActiveX():New( oWnd, "QuickPDFAX0717.PDFLibrary" ) // crash

Thank you very much

Alvaro

Posts: 36
Joined: Thu Oct 26, 2006 05:23 PM
Re: Acrobat reader
Posted: Tue Nov 10, 2009 03:39 AM

Alvaro,

I am not using the ActiveX version so I don't have any experience with it...sorry.

I use the DLL version.

Andy

Posts: 230
Joined: Sat Apr 19, 2008 10:28 PM
Re: Acrobat reader
Posted: Tue Nov 10, 2009 08:37 AM

Hi Andy,

Could you share the code of an example on how to get started with the DLL ?

Thank you,

Alvaro

Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
Re: Acrobat reader
Posted: Sat Nov 14, 2009 01:48 AM
Hi Enrico,

Maybe you can find your answer here:

http://www.adobe.com/devnet/acrobat/?view=documentation
Thanks,

Jeff Barnes



(FWH 16.11, xHarbour 1.2.3, Bcc730)
Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
Re: Acrobat reader
Posted: Sat Nov 14, 2009 02:09 AM
Hi Enrico,

I found this while searching the net:

>To programmatically enter a password and bypass the user
>interface prompt for
>password, you must replace the standard "security handler" for
>Acrobat with your own
>security handler. There is no way to bypass the password prompt with
>the standard
>Acrobat security handler. For an example of a custom security
>handler, see the "Rot13"
>sample plug-in.


Looks like this "Rot13 Sample Plug-in" is supplied with Acrobat 4 SDK

Hope this helps.
Thanks,

Jeff Barnes



(FWH 16.11, xHarbour 1.2.3, Bcc730)
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM

Continue the discussion