Help needed with Documentview

Post your Gambas programming questions here.
Post Reply
bill-lancaster
Posts: 195
Joined: Tuesday 26th September 2017 3:17pm
Location: NW England

Help needed with Documentview

Post by bill-lancaster »

Can't see how to open/load a document with this control.
Have downloaded an example from the farm but can't extract it.(No suitable plugin found. Ark does not seem to support this file type).
Any help would be appreciated
bill-lancaster
Posts: 195
Joined: Tuesday 26th September 2017 3:17pm
Location: NW England

Re: Help needed with Documentview

Post by bill-lancaster »

The reason I can't extract the download file is because it is empty. Have downloaded several files from the farm and they are all empty files.
User avatar
cogier
Site Admin
Posts: 1124
Joined: Wednesday 21st September 2016 2:22pm
Location: Guernsey, Channel Islands

Re: Help needed with Documentview

Post by cogier »

Hi Bill,

I don't think the files on the Farm are empty! I have Downloaded the documentView example and put it in a format I hope you can read. Let us know how you get on.
DocumentView.tar.7z
(7.33 KiB) Downloaded 350 times
EDIT (2019-10-15 01:30GMT)
(No suitable plugin found. Ark does not seem to support this file type)
I notice that Ark is discontinued as a distribution, why not try Kubuntu, that will have no trouble opening files on the Farm.

I have taken some of the code from the example program to make a simple example of my own.
Just start a new 'Graphical Application' add the component 'gb.pdf' and run this code.
' Gambas class file

hDoc As New PdfDocument ''Requires component 'gb.pdf'
DocumentView1 As DocumentView

Public Sub Form_Open()

SetUp
Start

End

Public Sub Start()

Dialog.Filter = ["*.pdf", "PdfFiles"]
If Not Dialog.OpenFile() Then Try hDoc.Open(Dialog.Path)

DocumentView1.Count = hDoc.Count  

End

Public Sub DocumentView1_Draw(Page As Integer, Width As Integer, Height As Integer)

Paint.DrawImage(hDoc[Page + 1].Image, 0, 0, Paint.Width, Paint.Height)
  
End

Public Sub DocumentView1_Zoom()
  
hDoc.Zoom = Last.Zoom

End

Public Sub SetUp()

With Me
  .Height = 800
  .Width = 1000
  .Arrangement = Arrange.Vertical
  .Padding = 5
End With

With DocumentView1 = New DocumentView(Me) As "DocumentView1"
  .Expand = True
End With

End

Public Sub Form_Resize()

DocumentView1.column = 1
DocumentView1.Refresh
Wait


End
bill-lancaster
Posts: 195
Joined: Tuesday 26th September 2017 3:17pm
Location: NW England

Re: Help needed with Documentview

Post by bill-lancaster »

Thank you cogier, that file worked fine.
I'm using Kubuntu 18.04 and Ark is the only option that I'm ware of and presumably the error is caused by an empty zip file.
Thanks again
Post Reply