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:profox-bounces@leafe.com] On Behalf Of Laurie Alvey Sent: 15 July 2016 13:04 To: ProFox Email List profox@leafe.com 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 chrisd@actongate.co.uk 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:profoxtech-bounces@leafe.com] On Behalf Of Desmond Lloyd Sent: 14 July 2016 16:48 To: profoxtech@leafe.com Subject: Re: more on PDF and VFP
Fascinating.... <Really>
On 14 July 2016 at 07:50, Alan Bourke alanpbourke@fastmail.fm 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]