Silent Print of PDF

Posted on 2009-02-20
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
    LVL 53

    Accepted Solution

    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

    LVL 8

    Expert Comment

    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

    Author Comment

    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.
    LVL 53

    Expert Comment


    Author Comment

    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

    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.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Training Course: Adobe Photoshop CC 2015

    Photoshop has become the standard in image manipulation among professional photographers and graphic designers. This course covers exam objectives for the Adobe Certified Associate (ACA) certification.

    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 (…
    *Adobe Acrobat 9 was used for this article.  Particular steps may vary depending on software versions. Adobe Acrobat has many, many variables that my be utilized to customize your forms for clarity and ease of use. The Form Editing Tool will be y…
    In this second video of the Xpdf series, we discuss and demonstrate the PDFimages utility, which, in a single command, is able to extract all the images from a PDF file and save each one in a separate image file (PBM, PPM, or JPG). Download and inst…
    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) …

    737 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

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now