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!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > Sample Code
  New Posts New Posts RSS Feed - Fill out a form with vba
  FAQ FAQ  Forum Search   Register Register  Login Login

Fill out a form with vba

 Post Reply Post Reply
Author
Message
eternity View Drop Down
Beginner
Beginner
Avatar

Joined: 10 Feb 19
Location: italy
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote eternity Quote  Post ReplyReply Direct Link To This Post Topic: Fill out a form with vba
    Posted: 11 Feb 19 at 8:20AM
hello I'm trying to create a code with the DebenuPDFLibrary64Lite1114 in vba to fill out a form and save it.
is it possible with this library?

i have made this code
Private Sub Comando0_Click()
Dim pdf As Object
Dim strmodello As String
Dim file As String

Set pdf = CreateObject("DebenuPDFLibrary64Lite1114.PDFLibrary")

Call pdf.LoadFromFile("C:\pippo\Modello.pdf", "")

pdf.SetNeedAppearances (0)


Call pdf.DeleteFormField(codicefiscale)

Call pdf.SetFormFieldValue(codicefiscale, "dng")


Call pdf.SaveToFile("C:\pippo\stampa.pdf")

Set pdf = Nothing
End Sub
where codicefiscale is the name of the field of the form
then i have the "error 438 propriety or method are not supported form object"

Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 11 Feb 19 at 9:13AM
Hi eternity,

yes... with QuickPDF it's possible to fill out, read and/or save formfields.
To your system environment:
The old vba is 32 bit i think and you're working with the 64-bit-dll ... i don't think this will work ;-)
The other thing: QuickPDF uses unicode strings - so you have to convert the content from the old vba to unicode before using string functions from the library.
Details: DeleteFormField needs the index of a form field - not the name of a form field.
The other thing: A real deletion of a form field and setting a value as next action doesn't make sense ;-)
You should have a look here in the samples-section regarding form fields.
Here's a sample about how to create form fields:
https://www.debenu.com/kb/create-pdf-form-fields-programmatically/

Cheers and welcome here,
Ingo


Cheers,
Ingo

Back to Top
eternity View Drop Down
Beginner
Beginner
Avatar

Joined: 10 Feb 19
Location: italy
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote eternity Quote  Post ReplyReply Direct Link To This Post Posted: 11 Feb 19 at 10:10AM
thanks for the reply,

I'm using access 2013 64 bit what can i do for work QickPDF?
i'm using an existing form.
i have to create form fields? 
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 11 Feb 19 at 8:23PM
if you're using an existing form then i think you want to read the inserted content?
This you can do with QuickPDF.
You can create a new pdf form with QuickPDF, too.
You can create a pdf form...
You can insert and save values into existing pdf form fields...
You can read existing content from pdf form fields...
All this you can do with QuickPDF.
Here are the relevant functionalities:
https://www.debenu.com/docs/pdf_library_reference/FormFields.php

Cheers,
Ingo

Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 11 Feb 19 at 8:39PM
Here there are few first sample steps for your first steps:

How to get a value from a pdf form field:

  try
    QP := TDebenuPDFLibrary1211.Create;
    try
//     QP.UnlockKey('I have inserted my license key here');
       QP.LoadFromFile(FileName, '');
       If QP.EncryptionStatus > 0 Then
          QP.Decrypt;

       ffc := QP.FormFieldCount;
       if ffc > 0 then
          begin
             nresult := QP.FindFormFieldByTitle(FieldName);
             xresult := QP.GetFormFieldValueByTitle(FieldName);
// . . .


How to set values into a pdf form field:

  try
    QP := TDebenuPDFLibrary1211.Create;
    try
//     QP.UnlockKey('I have inserted my license key here');
       QP.LoadFromFile(FileName, '');
       If QP.EncryptionStatus > 0 Then
          QP.Decrypt;

       ffc := QP.FormFieldCount;
       if ffc > 0 then
          begin
            QP.SetNeedAppearances(1);
            QP.SetFormFieldValue( StrToInt(Trim(FieldName)), FieldValue );
            QP.UpdateAppearanceStream( StrToInt(Trim(FieldName)) );
//          QP.FlattenFormField( StrToInt(Trim(FieldName)) );
// . . .


Additionally here you'll find the developer guide.
Inside there's a section 4.10 regarding pdf forms:
http://www.debenu.com/docs/pdf_library_developer_guide/foxit_quick_pdf_library_15_developer_guide.pdf



Cheers,
Ingo

Back to Top
eternity View Drop Down
Beginner
Beginner
Avatar

Joined: 10 Feb 19
Location: italy
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote eternity Quote  Post ReplyReply Direct Link To This Post Posted: 12 Feb 19 at 11:50AM
but i'm using lite version and i don't have license key
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 12 Feb 19 at 4:55PM
so there's only less you can do.
Check out which functionalities i've described are in the lite-version and then play a little bit...

Or you do it the other way and download the normal library and asking for an evaluation key limited for 30 days from here:
https://www.debenu.com/products/development/debenu-pdf-library/trial/




Edited by Ingo - 12 Feb 19 at 4:58PM
Cheers,
Ingo

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store