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, August 14, 2017 12:49:48 PM(UTC)
Viral Patel

Groups: Registered
Posts: 3


Hello,

I have a requirement of converting the image files like jpg, jpeg, png bmp etc.. to a single pdf file. Will i be able to use Lead tools for same? If yes can you please guide me to some examples?

Thanks!
 

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.

#2 Posted : Tuesday, August 15, 2017 3:02:01 PM(UTC)
Duncan Quirk

Groups: Registered, Tech Support, Administrators
Posts: 31

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

Hello,

Thank you for posting your question on the LEADTOOLS Technical Forums.

Yes, using LEADTOOLS you can convert from the formats that you mentioned to PDF. A full list of the file formats that LEADTOOLS supports can be found here: https://www.leadtools.com/sdk/formats

If you have not yet downloaded the evaluation version of LEADTOOLS, it can be downloaded from here: https://www.leadtools.com/downloads
The evaluation will unlock all functionality of the SDK for sixty days. Included in the download are sample projects that you can use as a reference.
Specifically, I would recommend that you look at the Main Demo, which can be found in the following installation directory:
C:\LEADTOOLS 19\Examples\DotNet\CS\MainDemo

Converting from one file format to another can be done with as little as three lines of code. For example, this code snippet will allow you to convert an input file to PDF in C#
Code:

            var codecs = new RasterCodecs();
            var image = codecs.Load(@"C:\path\to\file");
            codecs.Save(image, @"C:\path\to\outPutFile.pdf", RasterImageFormat.RasPdf, 0);


Our documentation about the RasterCodecs class can be found here: https://www.leadtools.co.../dh/co/rastercodecs.html

Thanks,
Duncan Quirk
Developer Support Engineer
LEAD Technologies, Inc.

LEAD Logo
 
#3 Posted : Tuesday, August 15, 2017 3:28:39 PM(UTC)
Viral Patel

Groups: Registered
Posts: 3


Hello,

I am using this code and i get Error as "CMP Codec is needed to use this feature"

RasterCodecs codecs = new RasterCodecs();
var stopWatch = new Stopwatch();
stopWatch.Start();
RasterImage image = codecs.Load(@"C:\Viral\.NET Projects\Code\MergePDFDocument\MergePDFDocument\MergePDFDocument\bin\Debug\PDF_Documents\T05_JB70722.jpg");
codecs.Save(image, @"C:\Viral\.NET Projects\Code\MergePDFDocument\MergePDFDocument\MergePDFDocument\bin\Debug\OutputFiles\LeadoutPutFile.pdf", RasterImageFormat.RasPdf, 0);
stopWatch.Stop();
MessageBox.Show("Successfully Merged,TimeTaken :" + stopWatch.Elapsed.Milliseconds.ToString() + " seconds");

I have referenced these 3 dlls is there any other dll that i might need to reference?

using Leadtools;
using Leadtools.Codecs;
using Leadtools.Codecs.Cmp;

Also Will i be able to load multiple images at one time, lets say an array of images and then convert same to pdf?

Thanks for your help!
 
#4 Posted : Tuesday, August 15, 2017 3:43:25 PM(UTC)
Duncan Quirk

Groups: Registered, Tech Support, Administrators
Posts: 31

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

Hello,

The error you are getting indicates that you are missing one or more codecs filter. Information about what codecs filters are needed for what file format can be referenced in our documentation here: https://www.leadtools.co...n.html#fileformatsupport

For instance, if you are writing to RasPdf, you will need the following DLLs referenced:
Leadtools.Pdf.dll*
Leadtools.ColorConversion.dll
Leadtools.Codecs.Fax.dll

You can also set the build path for your project to the LEADTOOLS bin directory you are referencing the DLLs from. This will allow the codecs to automatically pull in what codecs filters are needed without having to reference each one. I would suggest that you try this and see if you are able to convert the file.
Duncan Quirk
Developer Support Engineer
LEAD Technologies, Inc.

LEAD Logo
 
#5 Posted : Tuesday, August 15, 2017 4:00:02 PM(UTC)
Viral Patel

Groups: Registered
Posts: 3


Hello,

Thanks for your prompt reply. I added the references you mentioned and still i get the same issue. ""CMP Codec is needed to use this feature"

I am using all this references:

using Leadtools;
using Leadtools.Pdf;
using Leadtools.Codecs;
using Leadtools.Codecs.Cmp;
using Leadtools.ColorConversion;
using Leadtools.Codecs.Fax;

Error seems on the line RasterImage image = codecs.Load(@"C:\Viral\.NET Projects\Code\MergePDFDocument\MergePDFDocument\MergePDFDocument\bin\Debug\PDF_Documents\T05_JB70722.jpg");

Thanks!

 
#6 Posted : Wednesday, August 16, 2017 12:44:16 PM(UTC)
Duncan Quirk

Groups: Registered, Tech Support, Administrators
Posts: 31

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

Hello,

Have you tried setting the build path for your project to the LEADTOOLS bin directory that you are referencing the dlls from? Setting this path will allow the codecs to automatically pull in the filters it needs. If after do this you project is able to run without issue, then that would indicate that there is an additional DLL that needs to be referenced.

Also, make sure that you are setting your license in your application. This can be done in C# as follows:
RasterSupport.SetLicense(@"C:\LEADTOOLS 19\Common\License\LEADTOOLS.LIC", System.IO.File.ReadAllText(@"C:\LEADTOOLS 19\Common\License\LEADTOOLS.LIC.KEY"));

Thanks,
Duncan Quirk
Developer Support Engineer
LEAD Technologies, Inc.

LEAD Logo
 
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.304 seconds.