Help needed with Documentview

Post

Posted
Rating:
#1 (In Topic #321)
Regular
bill-lancaster is in the usergroup ‘Regular’
 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
Online now: No Back to the top

Post

Posted
Rating:
#2
Regular
bill-lancaster is in the usergroup ‘Regular’
 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.
Online now: No Back to the top

Post

Posted
Rating:
#3
Avatar
Guru
cogier is in the usergroup ‘Guru’
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.

Attachment

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.

Code (gambas)

  1. ' Gambas class file
  2.  
  3. hDoc As New PdfDocument ''Requires component 'gb.pdf'
  4. DocumentView1 As DocumentView
  5.  
  6. Public Sub Form_Open()
  7.  
  8. SetUp
  9. Start
  10.  
  11.  
  12. Public Sub Start()
  13.  
  14. Dialog.Filter = ["*.pdf", "PdfFiles"]
  15. If Not Dialog.OpenFile() Then Try hDoc.Open(Dialog.Path)
  16.  
  17. DocumentView1.Count = hDoc.Count  
  18.  
  19.  
  20. Public Sub DocumentView1_Draw(Page As Integer, Width As Integer, Height As Integer)
  21.  
  22. Paint.DrawImage(hDoc[Page + 1].Image, 0, 0, Paint.Width, Paint.Height)
  23.  
  24.  
  25. Public Sub DocumentView1_Zoom()
  26.  
  27. hDoc.Zoom = Last.Zoom
  28.  
  29.  
  30. Public Sub SetUp()
  31.  
  32.   .Height = 800
  33.   .Width = 1000
  34.   .Arrangement = Arrange.Vertical
  35.   .Padding = 5
  36.  
  37. With DocumentView1 = New DocumentView(Me) As "DocumentView1"
  38.   .Expand = True
  39.  
  40.  
  41. Public Sub Form_Resize()
  42.  
  43. DocumentView1.column = 1
  44. DocumentView1.Refresh
  45.  
  46.  
  47.  
Online now: No Back to the top

Post

Posted
Rating:
#4
Regular
bill-lancaster is in the usergroup ‘Regular’
 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
Online now: No Back to the top
1 guest and 0 members have just viewed this.