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 : Monday, December 4, 2017 10:14:17 AM(UTC)
Duncan Quirk

Groups: Registered, Tech Support, Administrators
Posts: 70

Was thanked: 4 time(s) in 4 post(s)

The LEADTOOLS CloudServices library provides developers with an easy to use interface to convert files to and from any Raster/Document format that the LEADTOOLS SDK supports. The ConversionEngine class provides two methods to convert files -- ConvertToRaster, and ConvertToDocument. The ConvertToRaster method allows conversion to any file format defined in the RasterImageFormat enum, whereas the ConvertToDocument method allows conversion to any file format defined in the DocumentFormat enum.

Both methods return an IEnumerable stream containing either 1 stream if the output format is multi-page or multiple streams if the input file was multi-page and the output format selected is single-page.

Code:

         var inputStream = File.Open(@"leadtools.pdf", FileMode.Open);
         LoadDocumentOptions loadOptions = new LoadDocumentOptions()
         {
            FirstPageNumber = 1,
            LastPageNumber = 1
         };

         ConversionEngine conversionEngine = new ConversionEngine();
         var outputStream = conversionEngine.ConvertToRaster(inputStream, loadOptions, RasterImageFormat.TifJpeg411, null); //Returns an enumerable list of streams
         foreach(var stream in outputStream)
         {
            //Process converted stream
         }



Code:

         var inputStream = File.Open(@"leadtools.pdf", FileMode.Open);
         LoadDocumentOptions loadOptions = new LoadDocumentOptions()
         {
            FirstPageNumber = 1,
            LastPageNumber = 1
         };

         ConversionEngine conversionEngine = new ConversionEngine();
         IOcrEngine engine = OcrEngineManager.CreateEngine(OcrEngineType.LEAD, false);
         engine.Startup(null, null, null, @"path/to/OCR Bin Directory");

         var outPutStream = conversionEngine.ConvertToDocument(inputStream, loadOptions, DocumentFormat.Doc, engine, null);
         foreach (var stream in outputStream)
         {
            //Process converted stream
         }




For reference, all supported file formats can be found on our website here: https://www.leadtools.com/sdk/formats
RasterImageFormat Enum: https://www.leadtools.co...l/rasterimageformat.html
DocumentFormat Enum: https://www.leadtools.co...h/ft/documentformat.html

Edited by user Friday, December 29, 2017 4:23:57 PM(UTC)  | Reason: Not specified

Duncan Quirk
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-2024, Yet Another Forum.NET
This page was generated in 0.049 seconds.