• putting data into a PDF document

    From internet.shopping@foobox.com@21:1/5 to Mal Reeve on Wed Jul 29 08:54:10 2020
    It is interesting to see that someone else is trying to do this and finding it difficult. My client and I only have Acrobat Reader and not the Pro DC version. The latter would cost £182 pa and I am not sure whether that limits the use to a single
    machine. The client may need to take out a number of licences.

    I found an alternative approach although It would not be my preferred way of doing it:

    Dim detailsRec As DAO.Recordset
    Set detailsRec = CurrentDb.OpenRecordset("SELECT WAVDemo.*, Customers.AccountName, Customers.Contact, CompactAddressOnLines(Customers.Address1, Customers.Address2, Customers.Address3, Customers.Town, Customers.County) As theAddress, Customers.
    PostCode, Customers.TelephoneNumber FROM WAVDemo LEFT JOIN Customers ON WAVDemo.CustomerID = Customers.CustomerID")

    FollowHyperLink thePdfFile
    Pause 3

    SendKeys "{TAB}", True
    SendKeys Nz(detailsRec("WAVConverter"), ""), True
    Pause 1
    SendKeys "{TAB}", True
    SendKeys Nz(detailsRec("AccountName"), ""), True
    Pause 1

    SendKeys "{TAB}", True
    SendKeys Nz(detailsRec("Demonstrator"), ""), True
    Pause 1
    SendKeys "{TAB}", True
    SendKeys Nz(detailsRec("Contact"), ""), True
    Pause 1
    SendKeys "{TAB}", True
    Pause 1
    SendKeys "{TAB}", True
    SendKeys Nz(DLookup("emailAddress", "Users", "UserID = " & getCurrentUserID), ""), True
    Pause 1
    SendKeys "{TAB}", True
    SendKeys Nz(detailsRec("theAddress"), "")
    Pause 1
    SendKeys "{TAB}", True
    SendKeys "{TAB}", True
    SendKeys Nz(detailsRec("PostCode"), ""), True
    Pause 1
    SendKeys "{TAB}", True
    SendKeys "{TAB}", True
    Pause 1
    SendKeys Nz(detailsRec("TelephoneNumber"), ""), True
    Pause 1
    SendKeys "^s", True


    Pause is my function to pause for the specified number of seconds. Seems to be necessary to slow the system down!!

    What surprised me that before I installed Acrobat the pdf file opened in Microsoft Edge. Strangely when I had Acrobat and opened the file in that, the tab order of the fields was different!!! How could that be? I would have expected the order to
    specified within the pdf itself.

    Without the full version of Acrobat I do not know the names of the fillable fields.


    Our current use is limited to this and will suffice for now. I would prefer an API where I could access the objects directly

    Jim


    On Wednesday, 29 July 2020 06:57:02 UTC+1, Mal Reeve wrote:
    I have just discovered this approach which I believe would work well.
    It does depend on knowing the field names.
    The sample file it includes has a routine that will get those field name - IF you have the full version of ACROBAT installed.
    While I found a few postings about getting those names with READER DC - none of them worked for me.
    Perhaps dig up an older version of the free Reader software - which would apparently let you export the form data and take a look. (untested)

    Anyway....this page: http://www.excelhero.com/blog/2010/04/excel-acrobat-pdf-form-filler.html

    Shows how to use create an "fdf" file (Form data only).
    It's just a specially formatted text file.
    Once created, you just open it....it grabs the default program (Acrobat or Reader DC) and drops the data into the fields.

    I've done some basic testing with my situation and it's all working well with hard coded field names and data. Now on to use it in a looping function.

    Good luck!
    Mal.



    On Friday, July 24, 2020 at 2:17:25 AM UTC+10, internet...@foobox.com wrote:
    I have a fillable pdf document that I did not create.

    I been asked if I can place data into it from my database.

    Looks as if it should be simple. However I do need to know or be able to name the fields (cells) that will contain the data.

    Does anyone know how I can find out the fields names? Or at least give them names?

    Once I have these I would need to open the pdf - any advice here would be welcome as to which application and then assign values to the named fields.


    Pointers in the direction of how to do this would be welcomed.

    Jim

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)