---
title: "How to set GdPicture OCR as the default OCR engine?"
canonical_url: "https://www.nutrient.io/guides/document-converter/sharepoint/knowledge-base/set-up-gdpictureocr-as-default-ocr-engine/"
md_url: "https://www.nutrient.io/guides/document-converter/sharepoint/knowledge-base/set-up-gdpictureocr-as-default-ocr-engine.md"
last_updated: "2026-06-09T10:28:13.477Z"
description: "Learn how to set up GdPicture OCR as the default OCR engine with Nutrient Document Converter in SharePoint. Follow step-by-step instructions for seamless setup."
---

# How to set GdPicture OCR as the default OCR engine?

There are two methods to configure GdPicture OCR as the default OCR engine:

1. Modify the Web Service configuration:

   ```csharp

   <!-- The default OCR engine to use. For a list of available OCR engines, see
   the <ocrProcessors> section below. This may require third-party software. -->

   <add key="OCR.Default" value="GdPictureOCR"/>
   ```

2. Specify the desired OCR engine directly in the code:

   ```csharp

   static void Main(string[] args)
   {
       DocumentConverterServiceClient client = null;

       try
       {
           // ** Delete any processed files from a previous run.
           foreach (FileInfo f in new DirectoryInfo(".").GetFiles("*_ocr.pdf"))
               f.Delete();

           // ** Determine the source file and read it into a byte array.
           string sourceFileName = null;
           if (args.Length == 0)
           {
               // ** If nothing is specified, then read the first PDF file from the current folder.
               string[] sourceFiles = Directory.GetFiles(Directory.GetCurrentDirectory(), "*.pdf");
               if (sourceFiles.Length > 0)
                   sourceFileName = sourceFiles[0];
               else
               {
                   Console.WriteLine("Please specify a document to OCR.");
                   Console.ReadKey();
                   return;
               }
           }
           else
               sourceFileName = args[0];

           byte[] sourceFile = File.ReadAllBytes(sourceFileName);

           // ** Open the service and configure the bindings.
           client = OpenService(SERVICE_URL);

           //** Set the absolute minimum open options.
           OpenOptions openOptions = new OpenOptions();
           openOptions.OriginalFileName = Path.GetFileName(sourceFileName);
           openOptions.FileExtension = Path.GetExtension(sourceFileName);

           // ** Set the absolute minimum conversion settings.
           ConversionSettings conversionSettings = new ConversionSettings();

           // ** OCR OCR OCR OCR OCR OCR OCR OCR OCR OCR OCR OCR OCR OCR OCR
           OCRSettings ocr = new OCRSettings();
           ocr.Language = OCRLanguage.English.ToString();
           ocr.OCREngine = "GdPictureOCR";
           conversionSettings.OCRSettings = ocr;
           // ** OCR OCR OCR OCR OCR OCR OCR OCR OCR OCR OCR OCR OCR OCR OCR

           // ** Carry out the conversion.
           Console.WriteLine("Processing file " + sourceFileName + ".");
           byte[] convFile = client.ProcessChanges(sourceFile, openOptions, conversionSettings);

           // ** Write the processed file back to the file system with a PDF extension.
           string destinationFileName = Path.GetFileNameWithoutExtension(sourceFileName) + "_ocr.pdf";
           using (FileStream fs = File.Create(destinationFileName))
           {
               fs.Write(convFile, 0, convFile.Length);
               fs.Close();
           }

           Console.WriteLine("File written to " + destinationFileName);

           // ** Open the generated PDF file in a PDF reader.
           Console.WriteLine("Launching file in PDF Reader");
           Process.Start(destinationFileName);
       }
       catch (FaultException<WebServiceFaultException> ex)
       {
           Console.WriteLine("FaultException occurred: ExceptionType: " +
                               ex.Detail.ExceptionType.ToString());
       }
       catch (Exception ex)
       {
           Console.WriteLine(ex.ToString());
       }
       finally
       {
           CloseService(client);
       }
       Console.ReadKey();
   }

   /// <summary>
   /// Configure the bindings and endpoints and open the service using the specified address.
   /// </summary>
   /// <returns>An instance of the Web Service.</returns>
   public static DocumentConverterServiceClient OpenService(string address)
   {
       DocumentConverterServiceClient client = null;

       try
       {
           BasicHttpBinding binding = new BasicHttpBinding();
           // ** Use standard Windows Security.
           binding.Security.Mode = BasicHttpSecurityMode.TransportCredentialOnly;
           binding.Security.Transport.ClientCredentialType =
                                                           HttpClientCredentialType.Windows;
           // ** Increase the client timeout to deal with (very) long running requests.
           binding.SendTimeout = TimeSpan.FromMinutes(120);
           binding.ReceiveTimeout = TimeSpan.FromMinutes(120);
           // ** Set the maximum document size to 50MB
           binding.MaxReceivedMessageSize = 50 * 1024 * 1024;
           binding.ReaderQuotas.MaxArrayLength = 50 * 1024 * 1024;
           binding.ReaderQuotas.MaxStringContentLength = 50 * 1024 * 1024;

           // ** Specify an identity (or any identity) to get past.net3.5 sp1.
           EndpointIdentity epi = EndpointIdentity.CreateUpnIdentity("unknown");
           EndpointAddress epa = new EndpointAddress(new Uri(address), epi);

           client = new DocumentConverterServiceClient(binding, epa);

           client.Open();

           return client;
       }
       catch (Exception)
       {
           CloseService(client);
           throw;
       }
   }

   /// <summary>
   /// Check if the client is open and then close it.
   /// </summary>
   /// <param name="client">The client to close</param>
   public static void CloseService(DocumentConverterServiceClient client)
   {
       if (client!= null && client.State == CommunicationState.Opened)
           client.Close();
   }
   ```

---

## Related pages

- [Streamline document conversion in SharePoint](/guides/document-converter/sharepoint/knowledge-base/automatic-document-conversion-workflow-getting-started.md)
- [Configuring Chromium-based HTML-to-Document converter](/guides/document-converter/sharepoint/knowledge-base/configuring-chromium-based-html-to-pdf-converter.md)
- [How to avoid Microsoft Office as a dependency?](/guides/document-converter/sharepoint/knowledge-base/avoiding-microsoft-office-as-dependency.md)
- [How to resolve the issue of Blink binaries (Portable Chromium) no longer being included?](/guides/document-converter/sharepoint/knowledge-base/alternative-options-to-portable-chromium.md)
- [Understanding file check-in and checkout in SharePoint](/guides/document-converter/sharepoint/knowledge-base/are-files-checked-in-out-after-conversion.md)
- [Understanding automatic check-in for SharePoint Online](/guides/document-converter/sharepoint/knowledge-base/automatic-check-in-behaviour-in-sharepoint-online.md)
- [Effortlessly convert SharePoint list items to PDF](/guides/document-converter/sharepoint/knowledge-base/convert-a-list-item-including-all-attachments-to-pdf.md)
- [Converting InfoPath/Nintex form-based list items using Nutrient Document Converter](/guides/document-converter/sharepoint/knowledge-base/converting-infopath-nintex-forms-based-list-items-using-the-muhimbi-pdf-converter.md)
- [Effortless document workflows with SharePoint Designer](/guides/document-converter/sharepoint/knowledge-base/creating-workflows-using-sharepoint-designer-the-muhimbi-pdf-converter.md)
- [What do I get if I subscribe to Document Converter Online?](/guides/document-converter/sharepoint/knowledge-base/difference-between-sharepoint-app-and-power-automate-features.md)
- [How to enable custom scripts in SharePoint Online](/guides/document-converter/sharepoint/knowledge-base/enable-custom-scripts-in-sharepoint-online.md)
- [Elevate App Privileges to Access Advanced Features (Old Version)](/guides/document-converter/sharepoint/knowledge-base/elevate-app-privileges-old-version.md)
- [Deploying real-time watermarking in SharePoint](/guides/document-converter/sharepoint/knowledge-base/enabling-real-time-watermarking-on-modern-view-libraries.md)
- [How to harden and secure the server running the Conversion Service?](/guides/document-converter/sharepoint/knowledge-base/hardening-securing-the-server-that-runs-the-conversion-service.md)
- [How can I request a trial license?](/guides/document-converter/sharepoint/knowledge-base/how-can-i-request-a-trial-license.md)
- [How to specify which InfoPath view(s) to convert?](/guides/document-converter/sharepoint/knowledge-base/how-can-i-specify-which-infopath-view-s-to-convert.md)
- [Optimize Nintex workflows with document conversion](/guides/document-converter/sharepoint/knowledge-base/how-can-i-use-the-pdf-converter-in-combination-with-nintex-workflow.md)
- [Unlock advanced features in SharePoint Document Converter](/guides/document-converter/sharepoint/knowledge-base/how-to-elevate-app-privileges-to-access-advanced-features.md)
- [How does Document Converter handle InfoPath XSN files?](/guides/document-converter/sharepoint/knowledge-base/how-does-the-pdf-converter-deal-with-infopath-xsn-files.md)
- [How well does Document Converter scale and handle high load?](/guides/document-converter/sharepoint/knowledge-base/how-well-does-the-pdf-converter-scale-deal-with-high-load.md)
- [How can I use the GdPicture Conversion Engine globally?](/guides/document-converter/sharepoint/knowledge-base/how-to-use-gdpicture-conversion-engine-globally.md)
- [How to edit the Conversion Service configuration file?](/guides/document-converter/sharepoint/knowledge-base/how-to-edit-the-conversion-service-s-configuration-file.md)
- [Secure document processing for SharePoint Online](/guides/document-converter/sharepoint/knowledge-base/how-does-the-pdf-converter-for-sharepoint-online-deal-with-private-documents.md)
- [Find your SharePoint Online Tenancy ID in minutes](/guides/document-converter/sharepoint/knowledge-base/how-to-determine-your-sharepoint-online-tenancy-id.md)
- [How to resolve the issue of iFrame, Embed, and Object entities being automatically removed?](/guides/document-converter/sharepoint/knowledge-base/iframe-embed-object-entities-are-removed.md)
- [Install Document Converter for SharePoint](/guides/document-converter/sharepoint/knowledge-base/installing-the-pdf-converter-for-sharepoint-online-app.md)
- [Optimize PDFs with advanced OCR features](/guides/document-converter/sharepoint/knowledge-base/ocr-facilities-provided-by-the-pdf-converter.md)
- [Knowledge Base: SharePoint Document Converter](/guides/document-converter/sharepoint/knowledge-base.md)
- [How to install and configure Ghostscript for PDF post-processing](/guides/document-converter/sharepoint/knowledge-base/installing-and-configuring-ghostscript-for-pdf-post-processing.md)
- [Set up document converter for SharePoint workflows](/guides/document-converter/sharepoint/knowledge-base/installing-the-pdf-converter-for-sharepoint-online-workflow-actions.md)
- [Deploying Muhimbi Document Converter in SharePoint 2013](/guides/document-converter/sharepoint/knowledge-base/installing-wsp-in-sharepoint-2013-running-2010-legacy-mode.md)
- [FAQs on SharePoint Online Document Converter](/guides/document-converter/sharepoint/knowledge-base/pdf-converter-for-sharepoint-online-faq.md)
- [Office 2019 Compatibility with Muhimbi Document Converter](/guides/document-converter/sharepoint/knowledge-base/office-2019-compatibility-with-pdf-converter.md)
- [Document Converter in SharePoint Subscription Edition and the stsadm command](/guides/document-converter/sharepoint/knowledge-base/pdf-converter-in-sharepoint-subscription-edition-and-the-stsadm-command.md)
- [or](/guides/document-converter/sharepoint/knowledge-base/print-quality-configuration.md)
- [Effortlessly deploy SharePoint Online apps and extensions](/guides/document-converter/sharepoint/knowledge-base/programmatically-deploy-the-sharepoint-online-app-spfx-extension-and-workflow-actions-to-multiple-site-collections.md)
- [Optimize PDFs: Fast Web Views and font management](/guides/document-converter/sharepoint/knowledge-base/set-pdf-version-enable-fast-web-views-embed-strip-fonts-using-web-services.md)
- [Convert SharePoint Online pages to PDF easily](/guides/document-converter/sharepoint/knowledge-base/sharepoint-online-html-conversion-user-credentials.md)
- [Upgrade to Muhimbi Document Converter for SharePoint](/guides/document-converter/sharepoint/knowledge-base/upgrading-to-pdf-converter-for-sharepoint-online-spfx.md)
- [Optimize PDF viewer preferences effectively](/guides/document-converter/sharepoint/knowledge-base/setting-pdf-viewer-preferences-using-the-web-service.md)
- [Watermark and secure OnOpen in SharePoint Online FAQ](/guides/document-converter/sharepoint/knowledge-base/watermark-secure-onopen-in-sharepoint-online-faq.md)
- [Optimize SharePoint with K2 Workflow Document Converter](/guides/document-converter/sharepoint/knowledge-base/using-pdf-converter-in-combination-with-k2-workflows.md)
- [Streamline PDF conversions in SharePoint Online](/guides/document-converter/sharepoint/knowledge-base/using-the-pdf-converter-for-sharepoint-online-user-interface.md)
- [Using the Document Converter from PowerShell](/guides/document-converter/sharepoint/knowledge-base/using-the-pdf-converter-from-powershell.md)
- [What features have been added to Document Converter over the years?](/guides/document-converter/sharepoint/knowledge-base/what-features-have-been-added-to-the-pdf-converter-over-the-years.md)
- [Convert various file formats to PDF easily](/guides/document-converter/sharepoint/knowledge-base/what-file-formats-types-are-supported-for-conversion.md)
- [Convert documents with SharePoint PDF converter](/guides/document-converter/sharepoint/knowledge-base/what-locations-can-i-convert-documents-to.md)
- [Effortless PDF merging with SharePoint tools](/guides/document-converter/sharepoint/knowledge-base/what-pdf-merging-facilities-are-available.md)
- [Where can I download the latest version of the software?](/guides/document-converter/sharepoint/knowledge-base/where-can-i-download-the-latest-version-of-the-software.md)
- [Where to find details about Document Converter's object model?](/guides/document-converter/sharepoint/knowledge-base/where-can-i-find-details-about-the-pdf-converter-s-object-model.md)

