Document View - How do you add documents?

Post

Posted
Rating:
#1 (In Topic #506)
Avatar
Expert
Quincunxian is in the usergroup ‘Expert’
 It will be simple and obvious but for the moment it's eluding me  !

How do you add a document to the view?
I can set  'blank' documents or placeholders for them by setting the count parameter,
but can't find a process to load or add a document.

Cheers - Quin.
I code therefore I am
Online now: No Back to the top

Post

Posted
Rating:
#2
Regular
vuott is in the usergroup ‘Regular’
…beginning with this simple code (you have to activate gb.poppler Component):

Code (gambas)

  1. Private DocumentView1 As DocumentView
  2. Private doc As PdfDocument
  3.  
  4.  
  5. Public Sub Form_Open()
  6.  
  7.   With Me
  8.     .Height = Desktop.H
  9.     .Width = Desktop.W
  10.     .Arrangement = Arrange.Vertical
  11.  
  12.   doc = New PdfDocument("/path/of/document.pdf")
  13.  
  14.   With DocumentView1 = New DocumentView(Me) As "DocumentView1"
  15.     .Column = 1
  16.     .Count = doc.Count
  17.     .Expand = True
  18.  
  19.  
  20.  
  21. Public Sub DocumentView1_Draw(Page As Integer, Width As Integer, Height As Integer)
  22.  
  23.   Paint.DrawImage(doc[Page].Render(0, 0, Width, Height, 0, doc.Resolution * 2), 0, 0, Paint.Width, Paint.Height)
  24.    

Europaeus sum !

<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
Online now: No Back to the top
1 guest and 0 members have just viewed this.