How to call pdfprintcom.exe COM from 64bit C# source code to print PDF file?

This article is for PDFPrint SDK product, about how to call PDFPrint SDK from 64bit EXE application, PDFPrint SDK product can be downloaded from following web page,

The following two web pages will show to you how to register pdfprintcom.exe COM interface into your system,

Step 1. Please launch a CMD window by administrator privilege first,

Click Start, in the Start Search box, type command. A list of of matches will appear above. Right-click Command Prompt in Programs list, and then click Run as administrator. You will likely be prompted for an administrator confirmation, or a password. Type your password or click Continue.

Run following command line in this CMD window to register pdfprintcom.exe into your system,

pdfprintcom.exe /regserver

Step 2. Run “Microsoft Visual Studio 2010” application, create a blank WindowsFormsApplication, insert “pdfprintcom” into this test project,


You will see a new reference of “pdfprintcom” appear at left panel,


This is the sample C# source code,

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Windows.Forms;

using pdfprintcom;


namespace WindowsFormsApplication1


    public partial class Form1 : Form


        public Form1()





        private void button1_Click(object sender, EventArgs e)


            pdfprintcom.pdfprint pdfPrintObj = new pdfprintcom.pdfprint();

            pdfPrintObj.com_PDFPrint("pdfprint -printer \"docPrint\" D:\\temp\\5.pdf");





okay, you are no problem to call pdfprintcom.exe COM interface from 64bit C# project now.



The following is a message which come from a customer about the PDFPrint SDK DLL C# project,


I have followed the steps as you mentioned in the mail and also in the below article link, but still it's giving error with 64 bit system same like the PDFPrint SDK.


PDFPrint SDK Download Link:

I ran the sample C# application which was inside the PDFPrint SDK folder in a 64 bit system and it throws an error like below which means it doesn't support 64 bit system.

System.BadImageFormatException was unhandled
Message=An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
at WindowsApplication1.Form1.VeryPDF_PDFPrint(String CommandLine)
at WindowsApplication1.Form1.PrintDoc(String FullDocumentName, String PrinterName) in C:\Users\Downloads\pdfprint_sdk_COM\C#\WindowsApplication1\Form1.cs:line 36
at WindowsApplication1.Form1.button1_Click(Object sender, EventArgs e) in C:\Users\Downloads\pdfprint_sdk_COM\C#\WindowsApplication1\Form1.cs:line 43
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.
UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at WindowsApplication1.Program.Main() in C:\Users\Downloads\pdfprint_sdk_COM\C#\WindowsApplication1\Program.cs:line 17
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()

Please try once from you end in a 64 bit system and let me know whether it really works?



That sample C# test project (C#_DLL) is for 32bit only, it is call the PDFPrintSDK.DLL file directly on 32bit Windows system. We have created a new package to you, the new package is contain a “C#_COM” test project to show you how to call PDFPrint COM interface from 64bit C# application.

The new package is contain a "C#_COM" folder, please unzip this package to a folder, open "pdfprint_sdk\C#_COM\WindowsFormsApplication1\WindowsFormsApplication1.sln" project in "Microsoft Visual Studio 2010", you will able to compile and run it on 64bit system properly.

Please notice, you need run following command line in CMD window by Administrator privilege to register PDFPrint COM first,

pdfprintcom.exe /regserver

If you don’t know how to register pdfprintcom.exe, please refer to details at following web page,

pdfprintsdk.dll is a Windows 32bit DLL Library, it can be called from 32bit EXE application.

pdfprintcom.exe is a Windows Out-of-Process Component, it will call all functions included in pdfprintsdk.dll, it is based on pdfprintsdk.dll library, so you MUST put pdfprintsdk.dll and pdfprintcom.exe files into same folder.

How To Register and Unregister an Out-of-Process COM Component (ActiveX EXE),

If you encounter any problem when you call pdfprint COM on 64bit system, please feel free contact us via our Support Center, we are glad to assist you asap.

VN:F [1.9.20_1166]
Rating: 10.0/10 (2 votes cast)
VN:F [1.9.20_1166]
Rating: 0 (from 0 votes)
How to call pdfprintcom.exe COM from 64bit C# source code to print PDF file?, 10.0 out of 10 based on 2 ratings

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *

Verify Code   If you cannot see the CheckCode image,please refresh the page again!