1. Acrobat Pdf Javascript
  2. Adobe Pdf Printing Blank
  3. Adobe Pdf Javascript Tutorial
  4. Pdf Javascript Tutorial
28 May 2013CPOL


This tip is merely to show a way in which you can launch Adobe and send a PDF straight to the printer in one fail swoop without using a third party solution (PdfSharp/iTextSharp..etc..).


After reviewing some of Adobe's documentation on command line switches, I was able to throw together a bit of code that would send a PDF straight to the printer without any user interaction. Attempting to send a post script straight to the printer can get nasty/complicated so this is meant to be an easy solution on how to take a newly created PDF/existing PDF from your app and send it directly to the printer.

You can tie Acrobat JavaScript code to a specific PDF document. Improved printing control. And Adobe Reader. Through JavaScript extensions. Print PDF directly from JavaScript. Or the adobe plugin. – Rahly Oct 11 '15 at 3:43. Silent print an embedded PDF. Oct 02, 2014  Hello all, I finally managed to get my silent print JavaScript to work but I cant figure out how to get rid of the annoying security prompt 'This. Start your free trial to print to PDF using Adobe Acrobat DC. With Acrobat DC, printing to PDF really is that simple. Just select Print to create a PDF.

The Code Explained

The code below is used in a console application. I know it could be easily incorporated into any GUI based desktop application as well.


  1. Print all PDFs from a defined directory:
  2. Simply print the PDF file:


I am going to make an assumption that the basics of using the Process class are understood.

  1. proc.StartInfo.FileName
  2. The value should be the absolute path to your Adobe Reader instance (should work with Acrobat as well). As far as I can tell in my research, most of the current versions of Adobe Reader should support the command line switches

  3. proc.StartInfo.Arguments
  4. These are your command line switches to be applied to Adobe Reader:

    • /p <filename> => means open and go straight to print dialog
    • /h => open adobe reader as a minimized window
  5. KillAdobe('AcroRd32');
  6. Occasionally in my usage of this code, Adobe Reader likes to stick around for whatever reason. I guess it appears proc.Close() does not have any affect on the reader, my thinking is that this is due to it trying to close in the middle of printing a file..however my brute force way to make sure the reader doesn't linger is to kill it.


So you grab all the processes that start with your process name (in our case AcroRdr32) and call the .Kill method for the process.

Code in its Entirety

Points of Interest

This is my first article/tip on CodeProject so I appreciate any feedback on how to improve this.


  • 05/27/2013 - Published article.
  • 05/27/2013 - Fixed minor code sample issue.

You sometimes see a warning when you open a PDF. The warningcomes in many forms (three are shown below).

The warning is asking whether you trust the people whosent you the PDF or the site in which the PDF is displayed. Thewarning appears because the PDF content can potentially harm yourcomputer. For example, the warning is displayed for PDFs that cantransfer or run programs and macros. It does not necessarily mean thatthe PDF is harmful.

Some product features assign trust through their own Preferences panel. For example, the Trust Manager includes for managing URL access, and Multimedia Trust (Legacy) has options for playing embedded multimedia. For features affected when enhanced security is enabled, you can selectively allow restricted actions by using a method described in Bypass enhanced security restrictions.


To open Preferences, choose Edit > Preferences (Windows) or Acrobat / Adobe Acrobat Reader > Preferences (Mac OS).


If youtrust the PDF or the company or individual who sent it, click theOptions, Allow, or Play button. (The buttons vary depending on thewarning.) You can now view the PDF.

If you don't trust the PDF or don't know who created it or where it came from, don't click the Options, Allow, or Play button. Acrobat and Adobe Acrobat Reader continues to block the suspicious content or actions. To hide the warning, click the Close or Cancel button. If you click any of the blocked content, the warning reappears.

If the warning does not contain an Options, Allow, or Playbutton, your administrator has disabled this feature. You cannotchoose to trust or allow this content. Click the Close or Cancelbutton to hide the warning. You can view the PDF, but you cannotaccess any of the blocked content. Contact your administrator for moreinformation.


For a full list of articles about security, see Overviewof security in Acrobat and PDF content.

Security warnings can be displayed in the following situations:

Blacklisted JavaScript

JavaScript is a computer language in widespread use. JavaScript code can be vulnerable to attacks, and JavaScript can be used to open websites. Adobe regularly updates the blacklist with known JavaScript vulnerabilities. If a PDF tries to access blacklisted JavaScript, you see a message in the yellow document bar, at the top.

For administrators:

  • For instructions on how to manage JavaScript execution, see the article JavaScripts in PDFs as a security risk

  • For more information about the situations that trigger JavaScript warnings and blacklisted JavaScript, see www.adobe.com/go/acroappsecurity.

Security settings updates

Adobe periodically distributes certificates for security purposes. These downloads help ensure that digitally signed PDFs from trusted sources maintain their trusted status. If you receive an update from an unknown source, verify that it is from a web address that you trust before proceeding. Updates from untrusted websites can create vulnerabilities on your computer.

Accessing stream objects (XObjects)

Acrobat Pdf Javascript

Acrobat and Reader display a warning when a PDF attempts to access external content identified as a stream object. For example, a URL might point to an external image. The silent transmission of data can pose a security risk as Acrobat and Reader communicate with an external source.

Inserting data into PDFs and forms

A warning appears when an untrusted source attempts to add data to a PDF form. Although this data-injection feature can streamline workflows in your organization, it can also be used to add malicious data into a PDF.

Silent printing

Adobe Pdf Printing Blank

Silent printing is printing to a file or printer without your confirmation. It is a potential security risk because a malicious file can silently print multiple times to your printer, wasting printer resources. It can also prevent other documents from printing by keeping the printer busy.

Contact your system administrator to determine when to allow silent printing.

Web links

In addition to visible web links in a PDF document, form fields can contain hidden JavaScript that open a page in a browser or silently request data from the Internet.


Acrobat and Reader X, 9.3, and 8.2 enable enhanced security by default. Adobe recommends that you enable enhanced security if it is not already enabled, and bypass restrictions only for trusted content.

More like this

Adobe Pdf Javascript Tutorial

Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Pdf Javascript Tutorial

Legal Notices Online Privacy Policy