Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Friday, March 31, 2017 3:36:46 PM(UTC)

Roberto  
Roberto

Groups: Registered, Tech Support, Administrators
Posts: 39

Thanks: 2 times
Was thanked: 3 time(s) in 3 post(s)

LEADTOOLS Imaging SDK offers the RasterCodecs class that handles the majority of I/O operations.

https://www.leadtools.co.../dh/co/rastercodecs.html

Converting from one format to another is a simple matter of loading a file and saving it to the desired format. For this you can leverage the RasterCodecs class's Load and Save methods.

https://www.leadtools.co...o/rastercodecs-load.html

https://www.leadtools.co...o/rastercodecs-save.html

A very simple example of this format conversion routine below:

Code:
using (RasterCodecs codecs = new RasterCodecs())
{
   RasterImage image = codecs.Load(@"input file path");
   codecs.Save(image, @"output file path ", RasterImageFormat.Tif, 24);
}


The output format can be any of our support file formats, see here: https://www.leadtools.co...tedimagefileformats.html

If you are wanting to convert file formats to a Document output, then you would need to utilize the DocumentConverter Class:

https://www.leadtools.co...ument/document-converter

Quote:
The Document Converter SDK can be used to convert raster and document formats alike, making it ideal for any Enterprise Content Management (ECM), document archival, and document normalization solution.

Convert to and from any document or raster image format
Adobe Acrobat PDF and PDF/A
Microsoft Office DOC/DOCX, XLS/XLSX, PPT/PPTX, PST, EML, MSG, and XPS formats
CAD formats such as DXF, DWG, and DWF
TIFF, JPEG, PNG, EXIF, BMP, and hundreds more raster image formats
Plain Text, RTF, HTML, MOBI, ePUB, and more
IBM AFP, MO:DCA, IOCA, and PTOCA


Here is some sample code on how to achieve this in a C# application:

Code:
using (DocumentConverter documentConverter = new DocumentConverter()) 
   { 
      var inFile = Path.Combine(ImagesPath.Path, @"Leadtools.docx"); 
      var outFile = Path.Combine(ImagesPath.Path, @"output.pdf"); 
      var format = DocumentFormat.Pdf; 
      var jobData = DocumentConverterJobs.CreateJobData(inFile, outFile, format); 
      jobData.JobName = "conversion job"; 
      var job = documentConverter.Jobs.CreateJob(jobData); 
      documentConverter.Jobs.RunJob(job); 
   } 
Roberto Rodriguez
Developer Support Engineer
LEAD Technologies, Inc.

LEAD Logo
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2017, Yet Another Forum.NET
This page was generated in 0.119 seconds.