Page 1 of 2 12 LastLast
Results 1 to 15 of 23
  1. #1
    Join Date
    Dec 2004
    Posts
    277

    Unanswered: using Adobe Distiller

    gave up on using PDFill and CutePDF.

    Gave in and bought the full Adobe Professional. So now how do I go about automating the filename in the Save As dialog?

    Anyone have any idea of how i can get all these PDF creations done in the background?

    I really just want to get over this PDF thing so I can get this project running today....

    Thanks

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    filename is realtively easy - set the report title on load to be the name you want it to be
    automating & background not sure if you can...

  3. #3
    Join Date
    Nov 2003
    Posts
    167
    Dack,

    I run pdf reports from Acrobat6. To change the pdf file name, set the caption using vba. My reports are by employee name, so I cycle through the records running the report once for each employee. In the loop in vba I set the caption equal to the employee's name. In the printer options for the report in design view, I specied for Acrobat NOT to prompt for file location, which causes it to go to the My Documents folder. I then had code to immediately move it from my documents to a path I had specified in a form. However, I later removed this because there were strange hangups with certain files (the move would fail and stop the whole process). Now I manually move the file from My Documents to the necessary network path using the "Send To any location" windows powertoy.

    If your report name is standard, simply specify this name in the caption property.

    The background processing is trickier. In print setup you can specify minimized (or hidden if I remember correctly), but my cursor still gets stolen from time to time. When you save changes to the report in design view, the print setting for that particular report are saved and passed to Adobe when the report is printed. There may be some way to tweak adobe into true background printing, but I haven't found it yet.

  4. #4
    Join Date
    Dec 2004
    Posts
    277
    the problem is that the report has to be saved in PDF form by [Reference].pdf
    and the BOL is [Reference]-BOL.pdf

  5. #5
    Join Date
    Nov 2003
    Posts
    167
    I don't understand - what's BOL?

    By [Reference], if you mean a parameter that is one of the fields in the dataset - this is very easy to do using ADO/DAO. Below is an example where a table containing a list of employees (run report once for each employee) contains a column "FullNamePDF" which is the employee name and some other stuff we want in the name. The report takes the parameter of [Employee] so I cycle through them all.

    Public Function SalesRevisedRun() As String
    Dim tst As New ADODB.Recordset

    Set tst = New ADODB.Recordset
    With tst
    .Open "SELECT YourTable.[Employee], YourTable.[Full NamePDF] FROM YourTable", CurrentProject.Connection, adOpenKeyset, adLockOptimistic
    .MoveFirst
    'During diagnostics, enable the stop loop msgbox to avoid cycling through everything.
    Do While Not .EOF 'And MsgBox("Stop Loop?", vbYesNo) = vbNo
    DoCmd.OpenReport "Your Report", acViewPreview, , "[Employee]= " & """" & tst("Employee") & """" & ""
    Reports![Your Report].Caption = Trim(tst("Full NamePDF"))
    DoCmd.PrintOut acPrintAll, , , acHigh, 1, True
    DoCmd.Close acReport, "Your Report"
    tst.MoveNext
    Loop
    .Close
    End With
    End Function

  6. #6
    Join Date
    Dec 2004
    Posts
    277
    I'm alright with Access, kinda average and I only understood a lil bit of that...

    in response to your question, BOL is Bill of Lading, it is another document that gets printed along with the pickupsheet. [Reference#] is the number that we file by

    So with that said I am trying to use Adobe Distiller and create PDFs that will automatically save to the proper folder with the name [Reference#].pdf for the pickupsheet and [Reference#]-BOL.pdf for the Bill of Lading.

    Please help, the 1st is my deadline and this is my last portion of the program to do........

  7. #7
    Join Date
    Nov 2003
    Posts
    167
    This is a report that you're printing to acrobat, right? If this is the case, my understanding is that you want to run the report once for each [reference] and print it to a file called BOL-[reference].pdf, right?

    To do this, you'll need to cycle through each [reference] in the dataset - running BOL-[reference].pdf for each one.

    Give me the parts of my previous post that you didn't understand and I'll clarify.

  8. #8
    Join Date
    Dec 2004
    Posts
    277

    Cool

    ok here is my deal... when setting up a pickup a [Reference#] is being assigned to the shipment, which is the primary key in my table, [Main]

    when in forms!pickupsheet when done filling out the order our user has to print two reports, the first one named "pickupsheet" and the second named "Bill of Lading"

    I am trying to create PDF backups to be stored on the server, to keep them filed correctly I would like for them to be named [Reference#].pdf (for "pickupsheet") and [Reference#]-BOL.pdf (for "Bill of Lading")

    I have Adobe Professional, and I am trying to use Adobe Distiller to create the PDF through VBA and name the reports being saved in VBA.

    So I need help with the code on how to select the printer(Distiller sets up a printer to create the PDF and prints to file) and then without the user doing anything save the created PDF in the proper folder and named properly.

    making sense?

  9. #9
    Join Date
    Nov 2003
    Posts
    167
    Are you needing to print these twice - once to paper and the second time to pdf file?

  10. #10
    Join Date
    Dec 2004
    Posts
    277
    no just print to pdf

  11. #11
    Join Date
    Nov 2003
    Posts
    167
    Okay - that's even less code to write.

    First of all, go to each of these 2 reports in design view, and then to File | Page Setup and the Page tab. Click the "Use Specific Printer" radio button and then the "printer" button. In the next popup click the "Properties" button. On the Adobe PDF Settings tab, make sure only the 3rd and 2nd to last checkboxes are checked (do not send fonts & delete log files). Save each report to keep these settings.

    Now these reports will automatically print a pdf to your My Documents folder.

    From here - go back to my code in the earlier post and substitute your table/field values in.

    Then paste the results into a response.

  12. #12
    Join Date
    Dec 2004
    Posts
    277
    I really thank you for your patience with me but I still am not understanding where it is saving to the name and directory that I am looking for with the code you supplied. This is going to be done each time a new pickup is created, and we are doing 10-20,000 moves a year thats why it's so imporatant that this be automated

    I am trying to learn what the code means as well as get the job done... I don't want to be just pasting code into it not knowing what each part does

    ya know?
    Last edited by DackJaniels; 01-28-05 at 11:28.

  13. #13
    Join Date
    Dec 2004
    Posts
    277
    Does anyone know anything about this subject? called Adobe no help from them

  14. #14
    Join Date
    Nov 2003
    Posts
    167
    Dack,

    The code I provided does not move it from the My Documents folder. to do that you'd need to move it with vba inside your report loop with something like this (where "mynetwork\mypath\" is your preferred path:


    infile = "C:\Documents and Settings\" & Environ("Username") & "\My Documents\"
    outfile = \\MyNetwork\Mypath\"
    'the following creates the pdf file
    DoCmd.PrintOut acPrintAll, , , acHigh, 1, True
    Set fso = CreateObject("Scripting.FileSystemObject")
    If Not fso.FileExists(infile & file) Then
    MsgBox infile & file & " does not exist!", vbExclamation, "Source File Missing"
    ElseIf Not fso.FileExists(outfile & file) Then
    fso.MoveFile (infile & file), outfile
    Else
    MsgBox outfile & file & " already exists!", vbExclamation, "Destination File Exists"
    End If

    As I mentioned, I was not happy with this code because it was kletchy. It would often lock up on files. I later added a 5 second pause function, thinking that the filesystem was trying to move the file before acrobat was finished writing to it. This cured everything but filenames that contained spaces - which would always hang the system up.

  15. #15
    Join Date
    Dec 2004
    Posts
    277
    where and how should I tell it to add that 5 second pause?

    now this will name it by [Reference#]?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •