Try this to display a PDF in a form.

You need adobe acrobat reader loaded 

*****************
* Start Code
*
* a_PDF in Form
* Uses acrobat Reader Component acroPDF.PDF.1

public goPDFForm
goPDFForm=NEWOBJECT("PDFViewer")
goPDFForm.Show()
RETURN

DEFINE CLASS PDFViewer AS Form

   AutoCenter = .T.
   Height = 350
   Width = 500
   Caption = "PDF Viewer"
   Name = "PDFViewer"

   ADD OBJECT cmdFile AS commandbutton WITH ;
      Top = 12, ;
      Left = 12, ;
      Height = 27, ;
      Width = 144, ;
      Caption = "Select File", ;
      Name = "cmdFile"

   ADD OBJECT cmdExit AS commandbutton WITH ;
      Top = 12, ;
      Left = 168, ;
      Height = 27, ;
      Width = 84, ;
      Caption = "Exit", ;
      Name = "cmdExit"

   ADD OBJECT olePDF AS olecontrol WITH ;
      OLEClass = "acroPDF.PDF.1", ;
      Top = 48, ;
      Left = 12, ;
      Name = "olePDF"

   PROCEDURE Init
      THISFORM.ReSize()
   ENDPROC

   PROCEDURE Resize
      THISFORM.olePDF.Height=THISFORM.Height-60
      THISFORM.olePDF.Width=THISFORM.Width-24
      THISFORM.olePDF.Refresh()
   ENDPROC

   PROCEDURE cmdFile.Click
      LOCAL lcFile
      lcFile=GETFILE("PDF")
      IF NOT EMPTY(lcFile)
         THISFORM.olePDF.LoadFile(lcFile)
      ENDIF
   ENDPROC

   PROCEDURE cmdExit.Click
      THISFORM.Release()
   ENDPROC

   PROCEDURE olePDF.Init
      IF NOT DODEFAULT()
        RETURN .F.
      ENDIF
      THIS.SetShowToolbar(.F.)
   ENDPROC

ENDDEFINE
*
* End Code
********

-----Original Message-----
From: ProFox [mailto:[email protected]] On Behalf Of Laurie Alvey
Sent: 15 July 2016 13:04
To: ProFox Email List <[email protected]>
Subject: Re: more on PDF and VFP

I tried the same as Rafael and found it very powerful. Haven't figured out how 
to use the SetProgress method.

Laurie

On 14 July 2016 at 18:57, Chris Davis <[email protected]> wrote:

> I have PDF's on my forms with the
>
> Shell.Explorer.2 control.  This is on the form as OWB i.e. 
> thisform.owb
>
> Code something like this ...
>
> lcFile="c:\my.pdf"
>
> lcretfile=ALLTRIM(lcfile)+"#toolbar=0&navpanes=1&scrollbar=0&statusbar=0&messages=0&view=fit&pagemode=thumbs&page=1"
>
> DO WHILE (Thisform.oWB.OBJECT.Busy OR Thisform.oWB.OBJECT.ReadyState <> 4)
>         DOEVENTS
> ENDDO
>
> Thisform.oWB.OBJECT.Navigate(lcretfile)
>
> DO WHILE (Thisform.oWB.OBJECT.Busy OR Thisform.oWB.OBJECT.ReadyState <> 4)
>         DOEVENTS
> ENDDO
>
> Can't remember why the do while bit was required other than it was as 
> this is very old code.
>
>
>
> -----Original Message-----
> From: ProfoxTech [mailto:[email protected]] On Behalf Of 
> Desmond Lloyd
> Sent: 14 July 2016 16:48
> To: [email protected]
> Subject: Re: more on PDF and VFP
>
> Fascinating.... <Really>
>
> On 14 July 2016 at 07:50, Alan Bourke <[email protected]> wrote:
>
> > > (I have the free version of FoxitReader installed in my computer)
> >
> > Google Chrome's built-in PDF renderer is based on Foxit, fact fans.
> >
> > --
> >   Alan Bourke
> >   alanpbourke (at) fastmail (dot) fm
> >
[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to