We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to create PDF from a Windows service?

Platform: WinForms |
Control: PDF

To create PDF from a Windows service:

  1. In the Visual Studio, choose File->New->Project.
  2. In the list of Visual C# project templates, choose Windows Service and name the Project, for example, MyPdfService, and then click ok.
  3. In the solution explorer, rename the service1.cs to PdfService.cs.
  4. PdfService.cs contains two default functions, OnStart() and OnStop(). Write the appropriate codes for these two functions. The following code example shows how to merge a PDF document in the Windows Services.


  1. In the solution explorer, right click the PdfService.cs and choose View Designer. Now, the designer window is opened.
  2. Right Click the Designer window and choose AddInstaller. By default, a component class that contains two installers is added to your project. The component’s name is ProjectInstaller.
  3. In the design view of the ProjectInstaller, choose serviceInstaller1 in the property window, and set the ServiceName as PdfService.
  4. In the design view of the ProjectInstaller, choose ServiceProcessInstaller1. In the property window, set the Account property as LocalSystem.


Installing the service:

  1. Run the Visual Studio Developer Command Prompt as the Administrator.
  2. In the command Prompt window, navigate the folder that contains your project bin file. For example, visual studio 2012\Projects\MyPdfService\bin\Debug.
  3. Then enter the following command: installutil.exe MyPdfService.exe

Now, the service is installed successfully.


Start the Service:

  1. Open administrative tools and choose services. You should see PdfService in the services window.
  2. In the services window, right click the PdfService and select start. Now, the Windows Service is started.


Uninstalling the service:

Enter the following command for the Visual Studio Developer Command Prompt: installutil.exe /u MyPdfService.exe

Now, the service is uninstalled.


Sample Link:


2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile