Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim pdf As PDFViewer
Dim activepage,totalpages As Int=0
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
'Activity.LoadLayout("Layout1")
Log("CopyFile()")
If Not(File.Exists(File.DirRootExternal, "hm.pdf")) Then
Log("test.pdf does not exist at DirRootExternal")
File.Copy(File.DirAssets, "hm.pdf", File.DirRootExternal, "hm.pdf")
Log("hm.pdf copied")
End If
pdf.init
Activity.AddView(pdf,0,0,-1,-1)
pdf.getpdf2(File.Combine(File.DirRootExternal,"hm.pdf"),"")
If pdf.isValid Then
Log("pagecount:"&pdf.GetPageCount)
pdf.scrollToPage(0)
totalpages=pdf.GetPageCount
pdf.zoom(1.0)
Sleep(0)
pdf.scrollToPage(4)
activepage = 4
Activity.Title = activepage & " - " & totalpages
'pdf.zoom(19.0)
End If
End Sub