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, June 1, 2018 10:16:46 AM(UTC)
Christopher Thompson

Groups: Tech Support, Administrators
Posts: 60

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

The Example below is a .NET example that utilizes the simplicity of the LEADTOOLS Save to also convert the PDF out as a TifLzw.
At the bottom of this is a working version of the code below in a C# console application.

C#
Code:
static void Main(string[] args)
        {
            //Set License and Key from default location
            string licenseFilePath = @"C:\LEADTOOLS 20\Common\License\LEADTOOLS.LIC";
            string keyFileValue = File.ReadAllText(@"C:\LEADTOOLS 20\Common\License\LEADTOOLS.LIC.KEY");

            RasterSupport.SetLicense(licenseFilePath, keyFileValue);


            string srcFileName = @"C:\Users\cthompson\Desktop\Leadtools.pdf";
            string outputFileName = @"C:\Users\cthompson\Desktop\Leadtools_test.tif";

            RasterCodecs codecs = new RasterCodecs();
            
            codecs.Load(srcFileName);
            
            RasterImage image = codecs.Load(srcFileName, 0, CodecsLoadByteOrder.BgrOrGray, 1, 1);
            
            //Saves out the provided PDF as a Tif LZW
            codecs.Save(image, outputFileName, RasterImageFormat.TifLzw, 8);
            
            Console.ReadLine();
        }



File Attachment(s):
simpleConvertWithLzwCompression_20.zip (313kb) downloaded 175 time(s).
Chris Thompson
Developer Support Engineer
LEAD Technologies, Inc.

LEAD Logo
thanks 1 user thanked Christopher Thompson for this useful post.
redminote on 6/8/2018(UTC)
 

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-2019, Yet Another Forum.NET
This page was generated in 0.071 seconds.