Print Page | Close Window

GetFormField data

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=2841
Printed Date: 30 Jan 26 at 9:10AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: GetFormField data
Posted By: Laiskam
Subject: GetFormField data
Date Posted: 03 Mar 14 at 2:06PM
I have an Access 2007 project, I want to get some data from a Form Pdf file.
 
When the function "DPLGetFormFieldCaption" or "DPLGetFormFieldValue" run, the Access application will shutdown with no any error message.
 
P.s. The function "DPLFormFieldCount" can return the count of fields correctly.
 
Code list:
 
Dim iInstanceID As Long
Dim iFieldsCount As Long
Dim iOpenStatus As Long
Dim strCaption As String
Dim iIndex As Long
Dim iErrorCode As Integer
 

iInstanceID = DPLCreateLibrary()
If DPLUnlockKey(iInstanceID, QP_LicenseKey) = 1 Then

      
    iOpenStatus = DPLLoadFromFile(iInstanceID, strFileName, "")
   
   
   
    iFieldsCount = DPLFormFieldCount(iInstanceID)
    
    iIndex = iFieldsCount
   
    strCaption = DPLGetFormFieldValue(iInstanceID, iIndex)
    DPLReleaseLibrary (iInstanceID)
   
Else
    MsgBox "Error"
End If



Replies:
Posted By: Ingo
Date Posted: 04 Mar 14 at 7:41AM
Hi!
 
I don't have a real solution but to give you an idea...
I've made same experiences with ms access 2007 (older ms access versions work fine!).
It should have to do about how to handle the string values.
The QuickPDF-function returns with a widestring...
 
Cheers and welcome here,
Ingo
 


-------------
Cheers,
Ingo



Posted By: AndrewC
Date Posted: 04 Mar 14 at 8:21AM

Hello,

Out of interest can you try calling 

"DPLGetFormFieldCaptionA" or "DPLGetFormFieldValueA" and see if is still crashes.

Andrew.


Posted By: Laiskam
Date Posted: 16 Mar 14 at 7:46PM
This time, I try to use C++ code to do this , but I cant get the value that I need. Only a blank string be returned when the "DPLGetFormFieldCaption" work. The function "DPLFormFieldCount" can work correctly and return a int.
 
 
       int iInstanceID;
        int iOpenStatus;
        int iFieldsCount;
        wchar_t* strCaption;
        iInstanceID = DPLCreateLibrary();
         if (DPLUnlockKey(iInstanceID, L"XXXXXXXXXXXXXX") == 1)
         {
               iOpenStatus = DPLLoadFromFile(iInstanceID, L"E:\\a.pdf", L"");
                iFieldsCount = DPLFormFieldCount(iInstanceID);
                 strCaption = DPLGetFormFieldCaption(iInstanceID,4);

                 ShowMessage(strCaption);
                 ShowMessage(IntToStr(iFieldsCount));
  }
  DPLReleaseLibrary(iInstanceID);
Thanks!


Posted By: AndrewC
Date Posted: 17 Mar 14 at 6:31AM
Laiskam,

Can you please send us the A.PDF so we can test it in C# / Delphi to make sure it is possible to process this file correctly.

Or you can try adding the code into a custom script in the Debenu Quick PDF library Demo program.

Andrew.



Posted By: Laiskam
Date Posted: 17 Mar 14 at 8:12AM
Thanks Andrew,
 
 
This issue had solved with C++. I make a stupid mistake. I should use the function "GetFormFieldTitle" , not "GetFormfieldCaption", because the caption of field is blank.
 
But it cant work correctly with VBA.
 
 
 
 
 
 



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk