A PDF Reader application built from VFP

Published on by Yousfi Benameur

         

[Post 274]
this is a custom PDF reader based on vfp browser and automated from it exclusively.
this can work with local pdfs (communly called acrobat).I used my acrobat Reader DC (version base 18.2816).
Acrobat is not a friend with all softs because its based on javascript and only some pro versions can be automated.
But the trick here is to use 2 methods (browser automation and shortcuts automation).this does the job easily.
the commands follow can be done from the built interface:
-open a local pdf file
-make search with standard dialog
-go first page,go previous page, go last page,go next page
-fill horizontally the browser window
-apply a zoom from (10-200%...)

*in the first combo can build a reading library.i filtered only web based pdf urls(see the test with xmlhttp responseheader)
 can build/open the yurls.txt file and refresh the combo to update it.
 the yurls.txt is opened here with notepad (present on all windows machines).modify what user wants and save.Its created at th first run of the application.
  these operations are made with the 2 shapes under the combo.

*the second combo makes some automations with shortcuts. Must give the focus to the pdf in browser( i used setfocus+API mouse_event for this)
 go top-go bottom-zoom+,zoom- ,rotate 90° clockWise,Print,save to,next page,previous page,Reader mode,Switch View.

*the 3th combo makes also automations (even if duplicated can inform on methods to do them)
   -Style(thumbnails,bookmarks if exists,none)
   -Fit ,zoom,toolbar(visible or hidden)
 the native toolbar have many buttons (can capture a zone in the pdf area,mail,cloud...)
   -Zoom
   -Scroll or no
   -gotoFirstpage,GotoLastPage ,gotoNextPage,GoToPreviousPage
   -SetLayoutMode
   -GoToPage (any page number if > go to the end).
*change backcolor
*change background photo (to lock screen if inactivity for ex..)
*Launch a diaporama with some web photos
*Hide/show the container commands.
can use the code *2* below to build programmatly yPDFReader.exe as standalone application.
*of course internet must be connected for web access(pdf urls & diaporama)-all urls are custom,can build yours in yurls.txt at start.


Click on code to select [then copy] -click outside to deselect

*1* created on sunday 18 of april 2018
*save mandatory as yPDFReader.prg (to re use it with building exe below)

If !_vfp.StartMode=0
	On Shutdown Quit
Endi
Set Defa To Addbs(Justpath(Sys(16,1)))
set cursor off

Public oform
oform=Newobject("YPDFReader")
oform.Show
Read Events
Return
*
Define Class yPDFReader As Form
	Height = 630
	Width = 1044
	ShowWindow = 2
	ShowTips = .T.
	AutoCenter = .T.
	Caption = "PDF Reader"
	Icon=Home(1)+"graphics\icons\writing\books04.ico"
	height0 = .F.
	ycl=0
	Name = "Form1"

	Add Object olecontrol1 As OleControl With ;
		oleclass="shell.explorer.2", ;
		Top = 0, ;
		Left =0, ;
		Height = 576, ;
		Width = 1042, ;
		Anchor = 15, ;
		Name = "Olecontrol1"

	Add Object container1 As ycnt With ;
		Anchor = 768, ;
		Top = 588, ;
		Left = 0, ;
		Width = 1030, ;
		Height = 38, ;
		BackStyle = 1, ;
		BorderWidth = 0, ;
		BackColor = Rgb(223,255,191), ;
		Name = "Container1"

	Add Object shape2 As Shape With ;
		Top = 617+3, ;
		Left = 1029, ;
		Height = 10, ;
		Width = 10, ;
		Anchor = 768, ;
		Curvature = 99, ;
		MousePointer = 15, ;
		ToolTipText = "Hide/show", ;
		BackColor = Rgb(255,0,0), ;
		Name = "Shape2"

     Add Object shape3 As Shape With ;
		Top = 617+3, ;
		Left = 1029-12, ;
		Height = 10, ;
		Width = 10, ;
		Anchor = 768, ;
		Curvature = 99, ;
		MousePointer = 15, ;
		ToolTipText = "Diaporama on/off", ;
		BackColor = Rgb(255,120,200), ;
		Name = "Shape3"
		
	Add Object timer1 As timer with interval=8000,enabled=.f.,name="timer1"	
		
	Procedure shape3.click	
	thisform.ycl=iif(thisform.ycl=0,1,0)
	if thisform.ycl=1
	thisform.timer1.enabled=.t.
	thisform.container1.setall("enabled",.f.)
	thisform.container1.backcolor=rgb(192,192,192)
	else
	thisform.timer1.enabled=.f.
	thisform.container1.setall("enabled",.t.)
	thisform.container1.backcolor= Rgb(223,255,191)
	endi
	
	procedure timer1.timer
	rand(-1)
	thisform.shape3.backcolor=rgb(255*rand(),255*rand(),255*rand())
   thisform.ybkg()	
	endproc
	
	Procedure olecontrol1.Init
	This.silent=.T.
	This.Navigate("about:blank")
	Inke(1)
	Thisform.ybkg()
	Endproc

	Procedure ybkg
	Thisform.olecontrol1.Navigate("about:blank")
	Inke(1)
	Sele ycurs
	Try
		Skip
	Catch
		Locate
	Endtry
	If Empty(ximg)
		Locate
	Endi

	Local m.myvar
	TEXT to m.myvar textmerge noshow
    <img src="<<ximg>>" width="100%" height="100%">
	ENDTEXT
	With Thisform.olecontrol1.Document
		.Open()
		.Write(m.myvar)
		.Close()
	Endwith
	Endproc

	Procedure Init
	Thisform.BackColor=Thisform.container1.BackColor
	Thisform.height0=Thisform.olecontrol1.Height
	Endproc

	Procedure Destroy
	Clea Events
	Endproc

	Procedure Load
	Declare Integer mouse_event In WIN32API Integer,Integer,Integer,Integer,Integer
	Declare Integer SetCursorPos In WIN32API Integer, Integer

	_Screen.WindowState=1
	Create Cursor ycurs (ximg c(200))
	Insert Into ycurs Values("https://i.pinimg.com/originals/40/19/2f/40192f850ce67523593d12a2e0911479.jpg")
	Insert Into ycurs Values("http://www.jetcost.com/blog-voyage/wp-content/uploads/2017/09/Bejaia.jpg")
	Insert Into ycurs Values("http://a141.idata.over-blog.com/600x450/5/07/50/27/images/xxx/oasis-desert-sahara-algerie.jpg")
	Insert Into ycurs Values("http://www.mko-fr.org/voyage/treklibye/galerie/paysage/images/trek_libye_210.jpg")
	Insert Into ycurs Values("https://www.onat.dz/sites/default/files/tamenrasetonat.jpg")
	Insert Into ycurs Values("http://www.hans-photomotion.com/wp-content/uploads/2012/07/desert-paysages-12-1600x697.jpg")
	Insert Into ycurs Values('https://drouotstatic.zonesecure.org/images/perso/zoomsrc/LOT/78/16415/67.jpg')
	Insert Into ycurs Values(' http://www.zeribavoyage.com/wp-content/uploads/2015/09/meharee.jpg')
	Insert Into ycurs Values('http://www.oliviergrunewald.com/photo/gallery/AFRICA/Algeria/AG01_PA01_TAD_0003.jpg')
	Insert Into ycurs Values('http://www.fond-ecran-image.com/photo-algerie/photo-desert-sahara/79.jpg')
	Insert Into ycurs Values('http://www.meteocity.com/medias/gallery/large/world/dz/oasis-algerie.jpg')
	Insert Into ycurs Values('http://ont.dz/wp-content/uploads/2015/04/Algerie-sud03-1024x790.jpg')
	Insert Into ycurs Values('http://ont.dz/wp-content/uploads/2015/04/Algerie-sud-1024x791.jpg')
	Insert Into ycurs Values('https://img.ev.mu/images/articles/960x/874984.jpg')
	Insert Into ycurs Values('https://www.drinkpreneur.com/wp-content/uploads/2016/03/drinkpreneur_6995933-desert-oasis-libya.jpg')
	Insert Into ycurs Values('https://www.populationdata.net/wp-content/uploads/2016/05/Algerie-Sahara-Tadrart-rouge.jpg')

	Locate

	Local m.x
	Rand(-1)
	m.x=Int(10*Rand()+1)
	Sele ycurs
	Go (m.x)
	Endproc

	Procedure shape2.Click
	With Thisform.container1
		.Visible=!.Visible
		If .Visible=.F.
			Thisform.height0=Thisform.olecontrol1.Height
			Thisform.olecontrol1.Height=Thisform.Height-This.Height
		Else
			Thisform.olecontrol1.Height=Thisform.height0
		Endi
	Endwith
	Endproc

Enddefine
*
*-- EndDefine: yPDFReader

*
Define Class ycnt As Container
	Anchor = 768
	Top = 588
	Left = 0
	Width = 1020
	Height = 35
	BackStyle = 1
	BorderWidth = 0
	BackColor = Rgb(223,255,191)
	Name = "ycnt"

	Add Object label1 As Label With ;
		WordWrap = .T., ;
		BackStyle = 0, ;
		Caption = "", ;
		Height = 35, ;
		Left = 264, ;
		Top = 1, ;
		Width = 460, ;
		Name = "Label1"

	Add Object combo1 As ComboBox With ;
		Height = 24, ;
		Left = 790, ;
		Top = 0, ;
		Width = 100, ;
		DisplayCount = 13, ;
		Name = "Combo1"

	Add Object combo2 As ComboBox With ;
		Anchor = 768, ;
		Height = 25, ;
		Left = 897, ;
		Top = 0, ;
		Width = 87, ;
		DisplayCount = 12, ;
		Name = "Combo2"

	Add Object image1 As Image With ;
		Picture = Home(1)+"graphics\icons\win95\openfold.ico", ;
		BackStyle = 0, ;
		Height = 32, ;
		Left = 3, ;
		MousePointer = 15, ;
		stretch=0,;
		Top = 1, ;
		Width = 32, ;
		ToolTipText = "Open", ;		
		Name = "Image1"

	Add Object image2 As Image With ;
		Picture = Home(1)+"samples\solution\coverage\covaddin.ico", ;
		Stretch = 0, ;
		BackStyle = 0, ;
		Height = 32, ;
		Left = 46, ;
		MousePointer = 15, ;
		Top = 1, ;
		Width = 32, ;
		ToolTipText = "Search", ;		
		Name = "Image2"

	Add Object image3 As Image With ;
		Picture = Home(1)+"ffc\graphics\previous.bmp", ;
		Stretch = 2, ;
		BackStyle = 0, ;
		Height = 32, ;
		Left = 110, ;
		MousePointer = 15, ;
		Top = 1, ;
		Width = 32, ;
		ToolTipText = "Previous", ;		
		Name = "Image3"

	Add Object image4 As Image With ;
		Picture = Home(1)+"ffc\graphics\next.bmp", ;
		Stretch = 2, ;
		BackStyle = 0, ;
		Height = 32, ;
		Left = 142, ;
		MousePointer = 15, ;
		Top = 1, ;
		Width = 32, ;
		ToolTipText = "Next", ;		
		Name = "Image4"

	Add Object image5 As Image With ;
		Picture = Home(1)+"samples\solution\coverage\colors.bmp", ;
		Stretch = 2, ;
		BackStyle = 0, ;
		Height = 32, ;
		Left = 196, ;
		MousePointer = 15, ;
		Top = 1, ;
		Width = 32, ;
		ToolTipText = "Fit H", ;		
		Name = "Image5"

	Add Object image6 As Image With ;
		Picture = Home(1)+"graphics\bitmaps\outline\plus.bmp", ;
		Stretch = 2, ;
		BackStyle = 0, ;
		Height = 32, ;
		Left = 231, ;
		MousePointer = 15, ;
		Top = 1, ;
		Width = 32, ;
		ToolTipText = "Zooms", ;		
		Name = "Image6"

	Add Object shape1 As Shape With ;
		Top = 6, ;
		Left = 995, ;
		Height = 13, ;
		Width = 13, ;
		Curvature = 99, ;
		MousePointer = 15, ;
		ToolTipText = "Backcolor", ;
		BackColor = Rgb(255,255,0), ;
		Name = "Shape1"

	Add Object shape2 As Shape With ;
		Top = 6, ;
		Left = 1001+15, ;
		Height = 13, ;
		Width = 13, ;
		Curvature = 99, ;
		MousePointer = 15, ;
		ToolTipText = "Web Backgrounds", ;
		BackColor = Rgb(0,255,0), ;
		Name = "Shape2"

	Add Object image7 As Image With ;
		Picture = Home(1)+"ffc\graphics\remall.bmp", ;
		Stretch = 2, ;
		BackStyle = 0, ;
		Height = 32, ;
		Left = 81, ;
		MousePointer = 15, ;
		Top = 1, ;
		Width = 32, ;
		ToolTipText = "First page", ;
		Name = "Image7"

	Add Object ylib As ComboBox With ;
		Height = 25,;
		Left = 711,;
		ToolTipText = "Web library",;
		Top = 1,;
		Width = 73,;
		Name = "ylib"


	Add Object ylibEd As Shape With ;
		Top = 27, ;
		Left = 711, ;
		Height = 10, ;
		Width = 10, ;
		Anchor = 768, ;
		Curvature = 99, ;
		MousePointer = 15, ;
		ToolTipText = "URLs edition", ;
		BackColor = Rgb(255,255,100), ;
		Name = "ylibed"

	Add Object ylibR As Shape With ;
		Top = 27, ;
		Left = 711+12, ;
		Height = 10, ;
		Width = 10, ;
		Anchor = 768, ;
		Curvature = 99, ;
		MousePointer = 15, ;
		ToolTipText = "Refresh combo", ;
		BackColor = Rgb(128,0,64),;
		Name = "ylibR"

	Add Object image8 As Image With ;
		Picture = Home(1)+"ffc\graphics\bottom.bmp", ;
		Stretch = 2, ;
		BackStyle = 0, ;
		Height = 32, ;
		Left = 167, ;
		MousePointer = 15, ;
		Top = 1, ;
		Width = 32, ;
		ToolTipText = "Last Page", ;
		Name = "Image8"

	Procedure ylibEd.Click
	Run/N notepad yurls.txt   &&modify,delete urls..and save
	Endproc

	Procedure ylibR.Click
	If !File("yurls.txt")
		Return .F.
	Endi

	With This.Parent.ylib
		Set Memow To 8192
		Local m.myvar
		m.myvar=Filetostr("yurls.txt")
		.Clear
		For i=1 To Memlines(m.myvar)
			.AddItem(Mline(m.myvar,i))
		Endfor
		.ListIndex=1
		.Style=2
	Endwith
	Endproc

	Procedure ylib.Init
	If !File("yurls.txt")
		Local m.myvar
		TEXT to m.myvar noshow  &&build web pdf library here
http://tamelaht.a.t.f.unblog.fr/files/2007/08/raishamidou.pdf
http://tamelaht.unblog.fr/files/2007/08/lesjuifsalgriens.pdf
http://tamelaht.unblog.fr/files/2007/08/abdelkader.pdf
https://www.algerie-ancienne.com/livres/224_ouvrages_algérie.pdf
https://www.ebooksgratuits.com/pdf/verne_cinq_semaines_en_ballon.pdf
http://beq.ebooksgratuits.com/vents-xpdf/Verne-etoile.pdf
https://www.ebooksgratuits.com/pdf/hugo_napoleon_le_petit.pdf
https://beq.ebooksgratuits.com/vents-xpdf/Verne-tour-monde.pdf
https://beq.ebooksgratuits.com/vents-xpdf/Verne-Robur.pdf
http://www.therapie-familiale.org/outils/aide_acrobat_reader.pdf
https://www.liftmaster.com/catalogresourcesv3/en-us/shared/files/tucmanuals/acrojs.pdf
		ENDTEXT
		Strtofile(m.myvar,"yurls.txt")
	Endi
	Set Memow To 8192
	Local m.myvar
	m.myvar=Filetostr("yurls.txt")
	With This
		For i=1 To Memlines(m.myvar)
			.AddItem(Mline(m.myvar,i))
		Endfor
		.ListIndex=1
		.Style=2
	Endwith
	Endproc

	Procedure ylib.Click
	If Empty(This.Value)
		Return .F.
	Endi
*
*test if the web contents are PDF type otherwise return (can be htm|html but fill with adds...)
	Local loRequest
	Try
		m.loRequest = Createobject('MsXml2.XmlHttp')
		m.loRequest.Open("GET",This.Value,.F.)
		m.loRequest.Send()
		m.xtext=m.loRequest.getResponseHeader("Content-Type")
		Wait Window xtext   Timeout 1
		If !Lower(m.xtext)=="application/pdf"
			m.loRequest=Null
			Messagebox("URL is not pdf extension...cancelling",16+4096,'Error',1300)
			Return .F.
		Else
			m.loRequest=Null
		Endi
	Catch
		Wait Window "An error occured!" Timeout 2
	Endtry
*
	This.Parent.label1.Caption=""
	Thisform.olecontrol1.Navigate(Allt(This.Value))
	This.Parent.label1.Caption=Proper(Allt(This.Value))
	Endproc
	Procedure Init
	With This
		.Left=(Thisform.Width-.Width)/2
	Endwith
	Endproc

	Procedure combo1.Click
	Thisform.olecontrol1.SetFocus
	#Define MOUSEEVENTF_LEFTDOWN     0x0002  &&The left button is down.
	#Define MOUSEEVENTF_LEFTUP       0x0004  &&The left button is up.

	x=Thisform.Left+Thisform.olecontrol1.Left+Thisform.olecontrol1.Width-40
	Y=Thisform.Top+Thisform.olecontrol1.Top+120
	=SetCursorPos(x,Y)
	=Inkey(0.2)
	mouse_event(MOUSEEVENTF_LEFTDOWN +MOUSEEVENTF_LEFTUP,x,Y,0,0) && left mouse down+up

	Local oshell
	oshell=Newobject("wscript.shell")

	Do Case
	Case This.Value=1
		oshell.sendkeys("^{home}")

	Case This.Value=2
		oshell.sendkeys("^{end}")

	Case This.Value=3
		oshell.sendkeys('^ "Plus"')

	Case This.Value=4
		oshell.sendkeys("^{!}")

	Case This.Value=5
		oshell.sendkeys("^{+}")

	Case This.Value=6
		oshell.sendkeys("^{p}")

	Case This.Value=7
		oshell.sendkeys("^{S}")  &&MAJ CTRL S

	Case This.Value=8
		oshell.sendkeys("{Right}")  && right arrow

	Case This.Value=9
		oshell.sendkeys("{Left}")   && left arrow

	Case This.Value=10
		oshell.sendkeys("^{h}")
*wait window "Issue ESC to siop reader mode" nowait

	Case This.Value=11
		oshell.sendkeys("^{l}")

	Endcase
	DoEvent
	oshel=Null
	Endproc

	Procedure combo1.Init
	With This
		.AddItem("Go Top")
		.AddItem("Go Bottom")
		.AddItem("zoom+")
		.AddItem("zoom-")
		.AddItem("Rotate 90° clockwise")
		.AddItem("Print")
		.AddItem("Save to")
		.AddItem("Next page")
		.AddItem("Previous page")
		.AddItem("Reader mode")
		.AddItem("switch View")
		.ListIndex=1
		.Value=1
		.Style=2
	Endwith
	Endproc

	Procedure combo2.Init
	With This
		.AddItem("Thumbnails")
		.AddItem("Fit")
		.AddItem("zoom")
		.AddItem("Toolbar")
		.AddItem("no scroll")
		.AddItem("gotoFirstpage")
		.AddItem("gotoLastPage")
		.AddItem("gotoNextPage")
		.AddItem("gotoPreviousPage")
		.AddItem("setLayoutMode")
		.AddItem("Go to page")
		.ListIndex=1
		.Style=2
		.Value=1
	Endwith

	Endproc

	Procedure combo2.Click
	If !Vartype(Thisform.olecontrol1.Object.Document)="O"
		Return .F.
	Endi
	Local m.x
	Try
		Do Case
		Case This.Value=1
			m.x=Inputbox("thumbnails(1)-Bookmarks(2)-none(3)","","3")  &&can be Fit,FitH,FitV,FitB,FitBH,FitBV  (1-6)
			If !Inlist(m.x,"1","2","3" )
				m.x="3"
			Endi
			Local m.y
			Do Case
			Case m.x="1"
				m.y="thumnails"
			Case m.x="2"
				m.y="bookmarks"
			Case m.x="3"
				m.y="none"
			Endcase
			Thisform.olecontrol1.Object.Document.setPageMode(m.y)

		Case This.Value=2
			m.x=Inputbox("fit(1)-fith(2)","","1")
			If !Inlist(m.x,"1","2")
				m.x="1"
			Endi
			Local m.y
			Do Case
			Case m.x="1"
				m.y="fit"
			Case m.x="2"
				m.y="fith"
			Endcase
			Thisform.olecontrol1.Object.Document.SetView(m.y)

		Case This.Value=3
			m.x=Inputbox("zoom 10-200%","","100")
			If Empty(m.x) Or Val(m.x)=0
				Return .F.
			Endi
			m.y=Int(Val(m.x))
			Thisform.olecontrol1.Object.Document.setZoom(m.y)   && 0-200....

		Case This.Value=4
			m.x=Inputbox("none(1)-toolbar(2)","","1")
			If !Inlist(m.x,"1","2")
				Return .F.
			Endi
			Do Case
			Case m.x="1"
				Thisform.olecontrol1.Object.Document.setShowToolbar(.F.)
			Otherwise
				Thisform.olecontrol1.Object.Document.setShowToolbar(.T.)
			Endcase

		Case This.Value=5
			m.x=Inputbox("none(1)-scrollbar(2)","","1")
			If !Inlist(m.x,"1","2")
				Return .F.
			Endi
			Do Case
			Case m.x="1"
				Thisform.olecontrol1.Object.Document.setShowScrollbars(.F.)
			Otherwise
				Thisform.olecontrol1.Object.Document.setShowScrollbars(.T.)
			Endcase

		Case This.Value=6
			Thisform.olecontrol1.Object.Document.gotofirstPage()
		Case This.Value=7
			Thisform.olecontrol1.Object.Document.gotoLastPage()
		Case This.Value=8
			Thisform.olecontrol1.Object.Document.gotoNextPage()
		Case This.Value=9
			Thisform.olecontrol1.Object.Document.gotoPreviousPage()

		Case This.Value=10
			m.x=Inputbox("Onecolumn(1)-twoColumLeft(2)-twoColumnRight(3)","","1")
			If !Inlist(m.x,"1","2","3")
				Return .F.
			Endi
			Do Case
			Case m.x="1"
				Thisform.olecontrol1.Object.Document.setLayoutMode("OneColumn")
			Case m.x="2"
				Thisform.olecontrol1.Object.Document.setLayoutMode("TwoColumnLeft") &&	TwoColumnLeft — use two-column continuous mode with the first page on the left
			Case m.x="3"
				Thisform.olecontrol1.Object.Document.setLayoutMode("TwoColumnRight") &&TwoColumnRight — use two-column continuous mode with the first page on the right
			Endcase

		Case This.Value=11
			m.x=Inputbox("Page number:","","1")
			m.x=Int(Val(m.x))
			If m.x=0
				Return .F.
			Endi

			Try
				Thisform.olecontrol1.Object.Document.setCurrentPage(m.x)
			Catch
				Messagebox("the page"+Trans(m.x)+" dont exists",0+32+4096,'',1300)
			Endtry

		Endcase
	Catch
		Messagebox("error")
	Endtry
	Endproc

	Procedure image1.Click
	This.Parent.label1.Caption=""
	Local m.x
	m.x=Getfile('pdf')
	If Empty(m.x)
		Return .F.
	Endi

	m.x="file:///"+m.x
	Thisform.olecontrol1.Navigate(m.x)
	This.Parent.label1.Caption=Proper(m.x)
	Endproc


	Procedure image2.Click
	Thisform.olecontrol1.SetFocus
	Local oshell
	oshell=Newobject("wscript.shell")
	oshell.sendkeys("^{f}")
	oshell=Null
	Endproc

	Procedure image3.Click
	Thisform.olecontrol1.SetFocus
	Try
		Thisform.olecontrol1.Object.Document.gotoPreviousPage()
	Catch
	Endtry
	Endproc

	Procedure image4.Click
	Thisform.olecontrol1.SetFocus
	Try
		Thisform.olecontrol1.Object.Document.gotoNextPage()
	Catch
	Endtry
	Endproc

	Procedure image5.Click
	Thisform.olecontrol1.SetFocus
	Try
		Thisform.olecontrol1.Object.Document.SetView("FitH")
	Catch
	Endtry
	Endproc

	Procedure image6.Click
	Thisform.olecontrol1.SetFocus
	Local m.x
	m.x=Inputbox("zoom 10-200%","","100")
	If Empty(m.x) Or Val(m.x)=0
		Return .F.
	Endi
	m.y=Int(Val(m.x))
	Try
		Thisform.olecontrol1.Object.Document.setZoom(m.y)   && 0-200....
	Catch
	Endtry
	Endproc

	Procedure shape1.Click
	Local m.x
	m.x=Getcolor()
	If m.x=-1
		Return .F.
	Endi
	With Thisform
		.BackColor=m.x
		.container1.BackColor=.BackColor
	Endwith
	Endproc

	Procedure shape2.Click
	Thisform.ybkg()
	Endproc

	Procedure image7.Click
	Thisform.olecontrol1.SetFocus
	Try
		Thisform.olecontrol1.Object.Document.gotofirstPage()
	Catch
	Endtry
	Endproc

	Procedure image8.Click

	Thisform.olecontrol1.SetFocus
	Try
		Thisform.olecontrol1.Object.Document.gotoLastPage()
	Catch
	Endtry
	Endproc

Enddefine
*
*-- EndDefine: ycnt


Click on code to select [then copy] -click outside to deselect


*2* created on sunday 18 of april 2018
*this builds a project, add files +informations and compile into standalone executable yPDFReader.exe .
*yPDFReader.prg above must be present here.save this code as ybuildexe.prg

close  all
set defa to addbs(justpath(sys(16,1)))
set safe off
text to m.myvar noshow
screen=off
resource=off
safe=off
endtext
strtofile(m.myvar,"config.fpw")

BUILD PROJECT yproj FROM   yPDFreader.prg,config.fpw recompile

* can achieve some modification in current project here
MODI PROJECT YPROJ NOWAIT
WITH _VFP.ACTIVEPROJECT
.debug=.f.
.encrypted=.t.
.icon=Home(1)+"graphics\icons\writing\books04.ico"
.VersionCopyRight="Yousfi Benameur El Bayadh Algeria - 22 of april 2018"
.Versionproduct="yPDFReader.exe"
.VersionComments="Free of use"
.VersionNumber="1.0.0"
**can add all info in vfp menu/project/infomations dialog box as made manually
.close()
endwith

BUILD EXE yPDFReader FROM yproj recompile
dele file yproj*.*
run/n  yPDFReader.exe


if want to start new yurls.txt simply delete it and it rebuilds itself in the code
if want to start new yurls.txt simply delete it and it rebuilds itself in the code
if want to start new yurls.txt simply delete it and it rebuilds itself in the code
if want to start new yurls.txt simply delete it and it rebuilds itself in the code
if want to start new yurls.txt simply delete it and it rebuilds itself in the code
if want to start new yurls.txt simply delete it and it rebuilds itself in the code
if want to start new yurls.txt simply delete it and it rebuilds itself in the code
if want to start new yurls.txt simply delete it and it rebuilds itself in the code

if want to start new yurls.txt simply delete it and it rebuilds itself in the code

A PDF Reader application  built from VFP

                     

Yousfi Benameur


Important:All Codes above are tested on VFP9SP2 & windows 10 pro 64 bits version 1709(fall creator) & IE11 emulation. Navigator: firefox - screen:32 pouces.

To be informed of the latest articles, subscribe:
Comment on this post