[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

pdf printing and providing filename

Posted on 2003-10-27
5
Medium Priority
?
385 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 750 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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…
Suggested Courses

656 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