Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


Silent Print of PDF

Posted on 2009-02-20
Medium Priority
Last Modified: 2012-06-27
I have VS 2005 Professional using VB.NET (VB2005), Adobe Acrobat Professional v8.0 (AAP). OS is Windows XP. I want to create an application that will silently print a pdf to a printer of my choice. I want to use COM objects from AAP. I am having trouble finding examples and also cannot even see the correct reference to set in a relevant VB2005 project. I dont want to use adobe acrobat command line. Please can you help?
Question by:pxj05
  • 3
  • 2
LVL 53

Accepted Solution

Dhaest earned 1500 total points
ID: 23692816
This will print your pdf silently to the standard printer on the pc

Dim p As New System.Diagnostics.ProcessStartInfo()
p.Verb = "print"
p.WindowStyle = ProcessWindowStyle.Hidden
p.FileName = "C:\Test.pdf"
p.UseShellExecute = True

Open in new window


Expert Comment

ID: 23692850
You can use ShellExecute to print a pdf silently.  Unfortunately to change the printer you have to change the default printer.  I posted the printing code on vbforums in the codebank here http://www.vbforums.com/showthread.php?t=508684

Author Comment

ID: 23692891
Thank you for the quick reply. I have tried this when testing with acrobat reader. It did work to a certain extent, but I do need to use com through AAP as I mentioned.

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

LVL 53

Expert Comment

ID: 23704043

Author Comment

ID: 23782410
My apologies to bhmahler and Dhaest for not getting back to you sooner. I have been busy at work on a different issue. Adobe forums seem congested and confusing to navigate and I wish to thank you for your help with sample code and URL pointers. The reason I wish to use com is down to a possibility that the application be run as a service. Although I have no reason to doubt that any of the code I obviously need to test within our environment. Please be patient and I will be back soon.

Author Closing Comment

ID: 31555703
Hi thanks to both of you for answering the question. But I did try both of your solutions in test and found that neither worked silently. A popup window appeared of the parent printing program. I also reinstalled the package and managed to get acrobat.tlb to register and tested com and I came to the same conclusion. With the objects supplied the code caused the parent program to popup briefly. This is not good enough for me but. Your solution did stop the print dialog box from displaying and therefore I award the points to you as you were the first to answer.

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Update 21-May-2015: I temporarily removed the source code to make major changes to the program. Regards, Joe INTRODUCTION This article presents a solution to a question (http://www.experts-exchange.com/Programming/Installation/Q_28396542.html)…
*Adobe Acrobat 9 was used for this article. Particular steps may vary depending on software versions. 1. Create a framework of your form in Word, leaving space where you’d ultimately like the Adobe fields to appear.  (Note: I use the blank lines …
In this first video of the three-part Xpdf series, we introduce and describe Xpdf, a library containing nine command line utilities that perform various functions on PDF files. We show where the library is located and how to download it, discuss its…
In this video, we show how to convert an image-only PDF file into a PDF Searchable Image file, that is, a file with both the image (typically from scanning) and text, which is created in an automated fashion with Optical Character Recognition (OCR) …
Suggested Courses

581 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