General discussion

Locked

Want to print pdf's from Access form

By carl ·
I want to be able to store a pdf file name in an access database and be able to print it out from the access form, is this possible (if not why not?).

I want to be able to store the reference document with an access based analysis sheet, and be able to print out the original document as required for delivery with analysis print out. Storing the file name and then printing from the form seems an nice easy way to do it to allow the whole process to be easy adn quick. So any suggestions apprciated

This conversation is currently closed to new comments.

6 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

by HAL 9000 Moderator In reply to Want to print pdf's from ...

Well while it may be a nice simple way Access is a DB program that doesn't support PDF format files let alone printing them.

The best that you could possibly do is to make a list of your various PDF files and list them in Access but even if you create a link to the original files you'll still need to open Adobe Reader to be able to actually view/print these out that would be the very minimum requirement that you would need.

Access just doesn't support the PDF format.

Col

Collapse -

by HAL 9000 Moderator In reply to

Sorry I didn't realize that this one was in Programing.

What you'll need to do is write a macro in Access to link to the original PDF files and when you select one PDF file it will have to open it just like you would in a manual setting. It should be relatively easy to just link to the file and get a PDF to execute when the file is selected.

Of course you'll need either local access to the PDF files or access through a Mapped Drive/Folder where they are stored and Adobe Reader installed on every computer.

Collapse -

by bschaettle In reply to Want to print pdf's from ...

This VBA code will print a PDF document whose fullpath is passed in as the argument. The "/P" command line option tells Acrobat to print. The user will only see the "select printer" dialog. There may be an Acrobat reader command-line option to print to the default printer so that the printer dialog box doesn't even open, but I don't know what it is.


Sub Print_PDF(sDocumentFullPath as string)
Dim sAcrobatReaderExe As String ' full path to the Acrobat reader executable
sAcrobatReaderExe = "C:\Program Files\Adobe\Acrobat 6.0\Reader\AcroRd32.exe"
RetVal = Shell(sAcrobatReaderExe & " /P " & Chr(34) & sDocumentFullPath & Chr(34), 0)
End Sub

Collapse -

Works for fdf too

by david.moss In reply to

I note this code snippet works for fdf files too. Just send the sub the fdf fullname instead of a pdf. That means you can generate fdf files inside access and print them to a standard pdf format. Neat.

DM

Collapse -

by Jacky Howe In reply to Want to print pdf's from ...

Try using PrimoPDF as your default printer. It should convert your report to PDF.

Collapse -

by Gary_W In reply to Want to print pdf's from ...

Assuming your pdf files already exist and you just want to print them, look into the free pdfp.exe utility. It basically talks to adobe reader via DDE calls and will shoot a document to the default printer. See it and other free cool utilities here:

http://www.esnips.com/web/PDFTools

Thanks to "chicks" for making his tools available!


Gary

Back to Web Development Forum
6 total posts (Page 1 of 1)  

Related Discussions

Related Forums