Solved

pdf printing and providing filename

Posted on 2003-10-27
5
383 Views
Last Modified: 2010-05-01
Hello,

    I'm creating an application that needs the possiblity to generate PDF-files automatically without
    user interference.
    * Using "printing to the PDF-printer" doesn't allow my program to choose the new file/path so the user
       must deside every time.
    * Using the Acrobat Destiller works, but not for EXCEL files + I read somewhere that this is only for old
       versions of the Adobe PDF-writer.
    * I've allready tried some third-party software to, but nothing is sufficiant enough...

    can anyone help me with a link to a web-page or some example code on how to print to a pdf-file wich
    must be possible from Word/Excel (through automation) and must require NO user input.

thanx.
Bart
0
Comment
Question by:BartVergote
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 7

Expert Comment

by:_agj_
ID: 9625854
0
 
LVL 44

Accepted Solution

by:
bruintje earned 250 total points
ID: 9626154
title : print a PDF using the Acrobat Reader
source : http://www.planetpdf.com/mainpage.asp?WebPageID=90

description:
-----------
Option Explicit ' Force variable declaration
' Author : Karl De Abrew
' Company : A Round Table Solution
' Date : 30 November, 1998
' Description:
' This vb method uses the VB printer object and a command line call sourced from the Acrobat Developer FAQ to print a single PDF silently
' This method / function should be extended to suit the requirements
' of an organisation

Sub PrintAPDFUsingTheFreeAcrobatReader()

Dim strCommandLine As String
Dim strPrinterName As String
Dim strDriverName As String
Dim strPortName As String
Dim strFileNameToPrint As String

strFileNameToPrint = "c:\temp\filetoprint.pdf"

strPrinterName = Printer.DeviceName
strDriverName = Printer.DriverName
strPortName = Printer.Port

' Perform some error checking here
strCommandLine = "c:\acrobat3\reader\AcroRd32.exe /t """ + _
strFileNameToPrint + """ """ + _
strPrinterName + """ """ + _
strDriverName + """ """ + _
strPortName + """" 

If (Shell(strCommandLine, vbHide) <> 0)Then
MsgBox "Job has been sent to the printer using the command " + strCommandLine
End If
End Sub
-----------

hope this helps a bit
0
 
LVL 8

Expert Comment

by:ampapa
ID: 9633131
Do you have the full version of Acrobat? or are you just using Distiller?
0
 
LVL 1

Author Comment

by:BartVergote
ID: 9633728
I Use a full version of Acrobat.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question