#1
Posted
:
Friday, June 1, 2018 10:11:46 AM(UTC)
Groups: Registered, Tech Support, Administrators
Posts: 89
Was thanked: 4 time(s) in 4 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();
}
Chris Thompson
Developer Support Engineer
LEAD Technologies, Inc.
1 user thanked Christopher for this useful post.
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.