Subject Re: PDF file display
From Mustansir Ghor <mustan31@hotmail.com>
Date Tue, 13 Jul 2021 12:38:07 -0400
Newsgroups dbase.getting-started

Dear Olaf

Thank You. It works perfect

Regards
Mustansir

Olaf Rausch Wrote:

> please try this:
> form.microsoftwebbrowser1.nativeobject.navigate2("about:blank")
> Regards
> Olaf
>
> Am 12.07.2021 um 21:59 schrieb Mustansir Ghor:
> > Dear Mervyn Sir
> >
> > I am coming back to Active X object again. Below command works perfect. When we open the form, the Active X object display a blank white box. But then when we go to another record where the fields is blank meaning  there is no pdf file for it, in such cases Navigate2(" ") does not blank the box. I wonder what we need to put in navigate2( )
> >
> >    form.microsoftwebbrowser1.nativeobject.navigate2("C:\Program Files (x86)\dBASE\dBASE2019\Licenses\dBASE_2019_License.pdf")
> >
> > Best Regards
> > Mustansir
> >
> >
> >
> > Mervyn Bick Wrote:
> >
> >> On 2021/06/26 10:56, Mustansir Ghor wrote:
> >>> Dear ALL
> >>>
> >>> I wish to display a PDF file having 10-15pages document in a similar fashion as picture object that being displayed with image object.
> >>>
> >>>
> >>> Can anybody help me to guide how this can be achieved.
> >>
> >> To display a .pdf file in a form you need to use an ActiveX control.
> >> Some, but not all, PDF readers do supply an ActiveX control which you
> >> can use.  I believe older versions of Adobe Reader did but newer
> >> versions don't.  I use the Foxit ActiveX for my own forms.
> >>
> >> The problem with using an ActiveX control is that there must be a copy
> >> on any computer that your form runs on.  Fortunately the
> >> MicrosoftWebBrowser ActiveX control will also display .pdf files and
> >> there is almost certain to be a copy on Windows machines.
> >>
> >> With a form open in the designer select "Set up ActiveX components" from
> >> the File menu.  This will show you all the ActiveX components registered
> >> on your computer.  Find MicrosoftWebBrowser and select it.  This will
> >> make it available in the ActiveX tab on the Components Palette.
> >>
> >> You tell the ActiveX control which file to open by specifying it in the
> >> control's nativeObject NAVGATE2() method.
> >>
> >> A little example is attached.  I've used the dBASE Licence PDF.  You may
> >> need to change the path on your computer.  You can, of course, simply
> >> change the reference to any .pdf file
> >>
> >> The preference on my computer is for the browser to use Foxit to open
> >> .pdf files so the example may work a bit differently on your computer.
> >> On mine right-clicking pops up a menu with various options.  You will
> >> just have to experiment a bit.
> >>
> >> Mervyn.
> >>
> >>
> >> ** END HEADER -- do not remove this line
> >> //
> >> // Generated on 2021-06-26
> >> //
> >> parameter bModal
> >> local f
> >> f = new dBASE_LicenseForm()
> >> if (bModal)
> >>     f.mdi = false // ensure not MDI
> >>     f.readModal()
> >> else
> >>     f.open()
> >> endif
> >>
> >> class dBASE_LicenseForm of FORM
> >>     with (this)
> >>        onOpen = class::FORM_ONOPEN
> >>        height = 22.0
> >>        left = 32.1429
> >>        top = 0.0
> >>        width = 129.0
> >>        text = ""
> >>     endwith
> >>
> >>     this.MICROSOFTWEBBROWSER1 = new ACTIVEX(this)
> >>     with (this.MICROSOFTWEBBROWSER1)
> >>        height = 20.4091
> >>        left = 3.2857
> >>        top = 1.0
> >>        width = 123.0
> >>        l0 = "FNBBBBBBKEGJBBBBQPDOBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBFNBBBBBBBBBBBBBBBBBBBBBBBCBBBBBBPBOBGIBBIEEGNQCCLPHKBJBBDMDPCDHDBJBBBBBBBBBBBBBBFNBBBBBBBCCFBDBBBBBBBBBBNBBBBBBBBBBBBBFHJBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB"
> >>        l0 += "BBBBBBBBBBBBBBBBBCBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB"
> >>        state = l0
> >>        classId = "{8856F961-340A-11D0-A96B-00C04FD705A2}"
> >>     endwith
> >>
> >>
> >>     function form_onOpen()
> >>        form.microsoftwebbrowser1.nativeobject.navigate2("C:\Program Files (x86)\dBASE\dBASE2019\Licenses\dBASE_2019_License.pdf")
> >>        return
> >>
> >> endclass
> >>
> >
>