Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!
![]() |
MS Access(vb6) & DLL Version |
Post Reply ![]() |
Author | |
Howard ![]() Beginner ![]() Joined: 16 Apr 20 Location: Czechia Status: Offline Points: 2 |
![]() ![]() ![]() ![]() ![]() Posted: 16 Apr 20 at 1:37PM |
I need to fill PDF form (SetFormFieldValueByTitle) from MS Access without any additional installation or library registration on the client. It should be possible with DLL version, but I didn't find any tutorial/sample for the DLL & MS Access or vb6. There is header file for vb6 in Trial Version (DebenuPDFLibraryDLL1312.bas), which should work for MS Access too. How to initiate the PDF Library? I found a lot of info about QPF, but need to test the described functionality before buying the full version. Any DLL & Access/vb6 sample will be welcome (found only vb.net in faq). Thanks in advance!
|
|
![]() |
|
Ingo ![]() Moderator Group ![]() ![]() Joined: 29 Oct 05 Status: Offline Points: 3529 |
![]() ![]() ![]() ![]() ![]() |
Hi Howard,
please have a look into the vb-sample below. The heaviest thing is the string handling with unicode. Please have a detailed look into pointers as well. Important at least where the dll should be (you'll know the difference with paths in win32 and win64). If you want to use the dll with vba inside MS Access, Excel, … then the dll has to be in the system32- or syswow64-directory (application directory won’t work). Choosing the dll inside for example a mdb-project via extras -> references won't work 'cause the dll can't be registered without an entry point – so simply copying into system32 or syswow64 … that’s all. Cheers and welcome here, Ingo - - - my vb-sample - the module1.bas-file... Attribute VB_Name = "Module1" Public Declare Function GetPDFfunction1 Lib "QuickPDF.dll" (ByVal Filename As String) As Long Public Declare Function GetPDFfunction2 Lib "QuickPDF.dll" (ByVal Filename As String, ByVal Opt As Long, ByVal sepa As String, ByVal fipa As Long) As Long Public Declare Function GetPDFfunction3 Lib "QuickPDF.dll" (ByVal Filename As String, ByVal FieldName As String) As Long Public Declare Function apiLStrCopyW Lib "kernel32.dll" Alias "lstrcpyW" (ByVal lpString1 As Long, ByVal lpString2 As Long) As Long Public Declare Function apiLStrLenW Lib "kernel32.dll" Alias "lstrlenW" (ByVal lpString As Long) As Long Public Function GetStringFromPtrW(ByVal ptr As Long) As String 'create a matching buffer GetStringFromPtrW = String$(apiLStrLenW(ptr), 0) 'copying the string into the buffer apiLStrCopyW StrPtr(GetStringFromPtrW), ptr End Function now the relevant functions out of my form1.frm-file... Private Sub Command1_Click() Dim bPfad() As Byte Dim sepa() As Byte bPfad = StrConv(Text1.Text, vbUnicode) sepa = StrConv(";", vbUnicode) Text2.Text = GetStringFromPtrW(GetPDFfunction2(bPfad, 2, sepa, 1)) End Sub Private Sub Command2_Click() Dim bPfad() As Byte Dim sepa() As Byte bPfad = StrConv(Text1.Text, vbUnicode) sepa = StrConv(";", vbUnicode) Text2.Text = GetStringFromPtrW(GetPDFfunction2(bPfad, 1, sepa, 1)) End Sub Private Sub Command3_Click() Dim bPfad() As Byte Dim bfield() As Byte bPfad = StrConv(Text1.Text, vbUnicode) bfield = StrConv(Text3.Text, vbUnicode) Text2.Text = GetStringFromPtrW(GetPDFfunction3(bPfad, bfield)) 'Get... End Sub Private Sub option1_Click() Dim bPfad() As Byte Dim sepa() As Byte bPfad = StrConv(Text1.Text, vbUnicode) sepa = StrConv(";", vbUnicode) ' very long string contents will not be supported in a proper way by common edit controls... If Len(GetStringFromPtrW(GetPDFfunction2(bPfad, 3, sepa, 1))) > 2000 Then Text2.Text = Left(GetStringFromPtrW(GetPDFfunction2(bPfad, 3, sepa, 1)), 2000) & "...!!!...aborted because not senseful for a single edit-field...!!!" Else Text2.Text = GetStringFromPtrW(GetPDFfunction2(bPfad, 3, sepa, 1)) End If End Sub Private Sub option2_Click() Dim bPfad() As Byte bPfad = StrConv(Text1.Text, vbUnicode) Text2.Text = GetPDFfunction1(bPfad) End Sub Edited by Ingo - 16 Apr 20 at 3:05PM |
|
Cheers,
Ingo |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store