Planet PDF Forum Planet PDF Forum
  New Posts New Posts RSS Feed - returning full name from save as
  FAQ FAQ  Forum Search   Register Register  Login Login

Hi, welcome to the Foxit Planet PDF Forum. If you have PDF or Adobe Acrobat questions then the right place to ask them is here, in this forum.

returning full name from save as

 Post Reply Post Reply Page  12>
Author
statman View Drop Down
New Member
New Member
Avatar

Joined: 20 Apr 2014
Location: Sellersburg
Points: 7
Post Options Post Options   Quote statman Quote  Post ReplyReply Direct Link To This Post Topic: returning full name from save as
    Posted: 20 Apr 2014 at 2:24am
I have been working on a MS Access program that creates a PDF from a template and fills certain fields from an Access Program. I am trying to retrieve the full file path name back to a field in Access. I have provided the code I have pieced together. If you can help I would appreciate it.

Private Sub cmdPDF_Click()

Dim acroApp As Object
Dim acroDoc As Object
Dim pdfDoc As Object
Dim jso As Object
Dim PDSaveIncremental As Variant


Me.File_Name.Visible = True
Me.File_Name.SetFocus
DoCmd.RunCommand acCmdCopy

'Fillable PDF filename and location
strFile = CurrentProject.Path & "\" & "BuildingTemplate.pdf"

'Check for the PDF
If Dir(strFile) = "" Then
    MsgBox "This demo requires the PDF form BuldingTemplate.pdf.", vbInformation, "Missing PDF"
    
Else

    'Create Acrobat object
    Set acroApp = CreateObject("AcroExch.App")
    Set acroDoc = CreateObject("AcroExch.AVDoc")
    
    'Open PDF form
    If acroDoc.Open(strFile, "") Then
        Set pdfDoc = acroDoc.GetPDDoc()
    
        'Added by theDBguy
        '8/25/2013
        'Form fields
        Set jso = pdfDoc.getJSObject
        jso.getfield("Location").Value = Me.Title.Value
        jso.getfield("Permit_Number").Value = Me.Permit_Number.Value
       
    MsgBox "Please use Ctrl V to place file in save as box."
        'Save changes to the PDF document
        jso.app.execMenuItem "SaveAs"
     

                            
        'Close the PDF; the True parameter prevents the Save As dialog from showing
        acroDoc.Close (True)
       
        'View the PDF file
       
       
    End If

    Set acroApp = Nothing
    Set acroDoc = Nothing
    Set pdfDoc = Nothing

End If

End Sub

Excuse the sloppy script I have been trying everything.
Ken
Back to Top
aandi View Drop Down
Senior Member
Senior Member


Joined: 07 Jul 2011
Points: 18358
Post Options Post Options   Quote aandi Quote  Post ReplyReply Direct Link To This Post Posted: 20 Apr 2014 at 8:47am
Look through the methods of the doc object in the JavaScript API Reference, there are several that are relevant. You will have to convert a DI Path (device independent path) to a regular Windows path.
Back to Top
statman View Drop Down
New Member
New Member
Avatar

Joined: 20 Apr 2014
Location: Sellersburg
Points: 7
Post Options Post Options   Quote statman Quote  Post ReplyReply Direct Link To This Post Posted: 20 Apr 2014 at 1:35pm
I appreciate your quick reply. Could you supply me with an example. Other words could you help me with the solution.
Ken
Back to Top
aandi View Drop Down
Senior Member
Senior Member


Joined: 07 Jul 2011
Points: 18358
Post Options Post Options   Quote aandi Quote  Post ReplyReply Direct Link To This Post Posted: 20 Apr 2014 at 2:21pm
Are you having trouble finding the relevant methods in the JavaScript API document?
Back to Top
statman View Drop Down
New Member
New Member
Avatar

Joined: 20 Apr 2014
Location: Sellersburg
Points: 7
Post Options Post Options   Quote statman Quote  Post ReplyReply Direct Link To This Post Posted: 20 Apr 2014 at 3:19pm
I am so out of my league on this. I am a Municipal works director for a small community in Indiana and have been writing a access program for my building commissioner. We are using the PDF for onsite inspections. I have found the way to fill the pdf from the access fields but have spent the last 6 months trying to save as from a field from access as the file name that is why the copy field is in the script but would really like to use a field to create the file name and return the full path back to a field so it can be referenced within access using a hyperlink. If you can help me with this last tweek it would be so appreciative. Once the program is done I intend to make this a freeware for other building departments like mine who don't have the money or IT departments to help aid in this task.
Ken
Back to Top
aandi View Drop Down
Senior Member
Senior Member


Joined: 07 Jul 2011
Points: 18358
Post Options Post Options   Quote aandi Quote  Post ReplyReply Direct Link To This Post Posted: 20 Apr 2014 at 7:17pm
That's great but you still need to write the code. Are you saying that you aren't even looking in the JavaScript API? This is the most basic tool you need. Let us know if you need help getting it.
Back to Top
statman View Drop Down
New Member
New Member
Avatar

Joined: 20 Apr 2014
Location: Sellersburg
Points: 7
Post Options Post Options   Quote statman Quote  Post ReplyReply Direct Link To This Post Posted: 20 Apr 2014 at 9:14pm
yes I do not understand how to reference the save as dialogue box to return the file path. I also am not looking in the JavaScript API because I don't understand what I am looking for.
Ken
Back to Top
aandi View Drop Down
Senior Member
Senior Member


Joined: 07 Jul 2011
Points: 18358
Post Options Post Options   Quote aandi Quote  Post ReplyReply Direct Link To This Post Posted: 20 Apr 2014 at 10:08pm
I'd encourage you to start looking at the API, because often the method or property names do tell you what they do. If we only read the API when we knew what we were looking for, we'd never need to read it! All JavaScript programmers should be turning to the API document, first, last and many times between. There really are some very obvious properties for the doc object.

NB the jso object you get is the doc object of the current document, so its methods are available to you. You already use one, getField (not sure why getfield works, names are supposed to be case sensitive).


Edited by aandi - 20 Apr 2014 at 10:09pm
Back to Top
statman View Drop Down
New Member
New Member
Avatar

Joined: 20 Apr 2014
Location: Sellersburg
Points: 7
Post Options Post Options   Quote statman Quote  Post ReplyReply Direct Link To This Post Posted: 21 Apr 2014 at 12:22am
If your willing I will start the research. Any good websites to educate me on the API and jso objects
Ken
Back to Top
aandi View Drop Down
Senior Member
Senior Member


Joined: 07 Jul 2011
Points: 18358
Post Options Post Options   Quote aandi Quote  Post ReplyReply Direct Link To This Post Posted: 21 Apr 2014 at 12:32am
There are, but do you have the JavaScript API? I can't tell from your replies.
Back to Top
statman View Drop Down
New Member
New Member
Avatar

Joined: 20 Apr 2014
Location: Sellersburg
Points: 7
Post Options Post Options   Quote statman Quote  Post ReplyReply Direct Link To This Post Posted: 21 Apr 2014 at 1:08am
no
Ken
Back to Top
 Post Reply Post Reply Page  12>
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.10
Copyright ©2001-2017 Web Wiz Ltd.

This page was generated in 0.051 seconds.