display file from string

Discussions about GdPicture.NET usage in non managed applications built in vb6, Delphi, vfp, MFC c++ etc...
Post Reply
alikadhem
Posts: 2
Joined: Fri Apr 06, 2012 12:30 am

display file from string

Post by alikadhem » Fri Apr 06, 2012 12:46 am

Dear Sir

We are using your GD viewer as a trial version in order to test it with our product

we want to use the function ( display file from string ) using VB6 but the viewer display the pages empty (blank page)

Please advice

your quick answer will be appreciated
Regards

Ali

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: display file from string

Post by Loïc » Fri Apr 06, 2012 1:31 pm

Hello,

Here a sample:

Code: Select all

Private Function ReadFile(sFile As String) As Byte()
    Dim nFile As Integer

    nFile = FreeFile
    Open sFile For Binary Access Read As #nFile
    If LOF(nFile) > 0 Then
        ReDim ReadFile(0 To LOF(nFile) - 1)
        Get nFile, , ReadFile
    End If
    Close #nFile
End Function

Code: Select all

Private Sub mnOpen_Click()
  Dim fileData() As Byte
  Dim fileDataString As String

 fileData = ReadFile("c:\test.pdf")
 fileDataString = StrConv(fileData, vbUnicode)

  'Call m_GdViewer.DisplayFromByteArray(fileData)
  Call m_GdViewer.DisplayFromString(fileDataString)
End Sub
Kind regards,

Loïc

alikadhem
Posts: 2
Joined: Fri Apr 06, 2012 12:30 am

Re: display file from string

Post by alikadhem » Sat Apr 07, 2012 4:23 pm

Dear Sir

I used the code but the software display the pages blank (empty page)

I m using the (gdpicturedotnet) version 16.0.0.400 with VB6 code

waiting for your kind replay

thank you

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: display file from string

Post by Loïc » Sun Apr 08, 2012 1:13 pm

Hello,

Hard to answer with no more information. Could you provide a way to reproduce your problem ?

The best option is to write a tiny standalone application reproducing the problem and send the app through http://support.gdpicutre.com if you have valid support plan (or if you are in trial period).


kind regards,

Loïc

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest