XtremeDocumentStudio .NET
Next-generation multi-format document-processing component suite for .NET developers
Compatibility
Visual Studio 2010/2012/2013/2015

XtremeDocumentStudio .NET - Document Converter

Learn to use XtremeDocumentStudio .NET’s Document Converter.
By Mohamed Safan

The DocumentConverter component included in XtremeDocumentStudio is a powerful component to convert your documents from one file format to another. It provides easy to use APIs to convert documents in your applications. It also provides extensive options for customizing the output being generated based on input and output format specific features.

Input formats: PDF, DOCX, DOC, RTF, XLSX, XLS, ODS, TXT, XPS, BMP, JPG, PNG, EMF, WMF, TIF, TIFF.

Output formats: PDF, DOCX, RTF, TXT, HTML, BMP, JPG, PNG, TIF, TIFF.

Add references to the following DLLs in your application to include document conversion capability

Below code snippet shows how you can convert the documents from one file format to another.

Scenario 1: Converting DOCX to PDF

// Activate XtremeDocumentStudio .NET license
Framework.ActivateLicense("your-license-key");
 
// Get DocumentConverter instance
DocumentConverter documentConverter = new DocumentConverter();
// Convert DOCX to PDF 
documentConverter.ConvertToFile("input.docx", "output.pdf");

Scenario 2: Converting PDF to formatted flow-based DOCX document

// Activate XtremeDocumentStudio .NET license
Framework.ActivateLicense("your-license-key");
 
// Get DocumentConverter instance
DocumentConverter documentConverter = new DocumentConverter();
// convert PDF to DOCX 
documentConverter.ConvertToFile("input.pdf", "output.docx");

Scenario 3: Converting multiple images to single PDF document

// Activate XtremeDocumentStudio .NET license
Framework.ActivateLicense("your-license-key");
 
// Get DocumentConverter instance
DocumentConverter documentConverter = new DocumentConverter();
 
// List of file to be converted.
List inputfiles = new List()
{
    "1.bmp", "2.png",
    "3.jpg", "4.jpeg",
    "5.emf", "6.wmf",
    "7.tif", "8.tiff"
};
 
// File name for resulting file
string baseFileName = "Converted";
 
// Convert to
string outputFileFormat = "pdf";


// convert list of images to single PDF document
documentConverter.ConvertToFile(inputfiles, outputFileFormat, Environment.CurrentDirectory,
    baseFileName, ConversionMode.ConvertToSingleFile);

Scenario 4: Converting multiple files to single multipage TIFF file

// Activate XtremeDocumentStudio .NET license
Framework.ActivateLicense("your-license-key");
 
// Get DocumentConverter instance
DocumentConverter documentConverter = new DocumentConverter();
 
// List of file to be converted.
List inputfiles = new List()
{
    "1.pdf", "2.docx",
    "3.doc", "4.png",
    "5.bmp", "6.jpeg",
    "7.txt", "8.xps"
};
 
// File name for resulting file
string baseFileName = "Converted";
 
// Convert to
string outputFileFormat = "tiff";
 
// Additional parameters to create multipage tiff file
TIFFEncoderSettings tiffEncoderSettings = new TIFFEncoderSettings()
{
    MultiPage = true
};
 
// convert list of documents to single multipage TIFF document
documentConverter.ConvertToFile(inputfiles, outputFileFormat, Environment.CurrentDirectory,
    baseFileName, ConversionMode.ConvertToSingleFile, tiffEncoderSettings);

Scenario 5: Creating a PDF Portfolio

// Activate XtremeDocumentStudio .NET license
Framework.ActivateLicense("your-license-key");
 
// Get DocumentConverter instance
DocumentConverter documentConverter = new DocumentConverter();
 
// List of file to be converted.
List inputfiles = new List()
{
    "1.pdf", "2.docx",
    "3.doc", "4.png",
    "5.bmp", "6.jpeg",
    "7.txt", "8.xps"
};
 
// File name for resulting file
string baseFileName = "Converted";
 
// Convert to
string outputFileFormat = "pdf";
 
// Additional parameters to create PDF Portfolio
PDFEncoderSettings pdfEncoderSettings = new PDFEncoderSettings()
{
    PDFPortfolioSettings = new PDFPortfolioSettings()
    {
        PortfolioCreationMode = PortfolioCreationMode.OnlyWhenAttachmentsExist,
        PortfolioLayoutMode = PortfolioLayoutMode.Tile
    }
};
 
// convert list of documents to PDF portfolio
documentConverter.ConvertToFile(inputfiles, outputFileFormat, Environment.CurrentDirectory,
    baseFileName, ConversionMode.ConvertFirstFileAndAttachRestAsOriginal, pdfEncoderSettings);

Scenario 6: Converting images and scanned PDFs to searchable PDF document with OCR

Refer “Gnostice.XtremeDigitizationEngine.dll” in your project Copy all the files and folders from “\XtremeDocumentStudio Ultimate\Bin\XDE” to “bin” directory of your project.

// Activate XtremeDocumentStudio .NET license
Framework.ActivateLicense("your-license-key");
 
// Get DocumentConverter instance
DocumentConverter documentConverter = new DocumentConverter();
 
// List of file to be converted.
List inputfiles = new List() { "1.png", "2.pdf" };
 
// File name for resulting file
string baseFileName = "Converted";
 
// Convert to
string outputFileFormat = "pdf";
 
// Additional parameters perform OCR
documentConverter.Preferences.DigitizerSettings.DigitizationMode = DigitizationMode.AllImages;
documentConverter.Preferences.DigitizerSettings.ImageEnhancementSettings.ImageEnhancementMode =
    ImageEnhancementMode.AUTO;

// Language you need to recognize
documentConverter.Preferences.DigitizerSettings.OCRSettings.DocumentLanguage = "eng+deu+fra";
documentConverter.Preferences.DigitizerSettings.RecognizeElementTypes =
    RecognizeElementTypes.TEXT;
 
// convert list of documents to searchable PDF
documentConverter.ConvertToFile(inputfiles, outputFileFormat, Environment.CurrentDirectory,
    baseFileName, ConversionMode.ConvertToSeperateFiles);

---o0O0o---

Our .NET Developer Tools
XtremeDocumentStudio .NET

Multi-format document-processing component suite for .NET developers.

PDFOne .NET

A .NET PDF component suite to create, edit, view, print, reorganize, encrypt, annotate, and bookmark PDF documents in .NET applications.

Our Delphi/C++Builder developer tools
XtremeDocumentStudio Delphi

Multi-format document-processing component suite for Delphi/C++Builder developers, covering both VCL and FireMonkey platforms.

eDocEngine VCL

A Delphi/C++Builder component suite for creating documents in over 20 formats and also export reports from popular Delphi reporting tools.

PDFtoolkit VCL

A Delphi/C++Builder component suite to edit, enhance, view, print, merge, split, encrypt, annotate, and bookmark PDF documents.

Our Java developer tools
XtremeDocumentStudio (for Java)

Multi-format document-processing component suite for Java developers.

PDFOne (for Java)

A Java PDF component suite to create, edit, view, print, reorganize, encrypt, annotate, bookmark PDF documents in Java applications.

Our Platform-Agnostic Cloud and On-Premises APIs
StarDocs

Cloud-hosted and On-Premises REST-based document-processing and document-viewing APIs

Privacy | Legal | Feedback | Newsletter | Blog | Resellers © 2002-2017 Gnostice Information Technologies Private Limited. All rights reserved.