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 : Tuesday, May 11, 2021 1:38:46 PM(UTC)
wbradney

Groups: Registered
Posts: 8


I'm testing the evaluation version for converting MODCA documents. The Document Converter sample program works perfectly, but when I use the SDK from my own .NET 4.7.1 project I get two job errors complaining about the missing codec. The library does exist in my project's output bin folder.

Any ideas? My code is essentially this:

Code:

            string licenseFilePath = "LEADTOOLS.LIC";
            string developerKey = System.IO.File.ReadAllText("LEADTOOLS.LIC.KEY");
            RasterSupport.SetLicense(licenseFilePath, developerKey);

            var path = fileInfo.FullName;
            var newPath = @"C:\tmp\modca-pdf\" + serialNumber + ".pdf";
            var newFileInfo = new FileInfo(newPath);

            var converter = new DocumentConverter();
            var rasterCodecs = new RasterCodecs();
            rasterCodecs.Options = DocumentFactory.RasterCodecsTemplate.Options.Clone();
            DocumentFactory.RasterCodecsTemplate = rasterCodecs;
            var documentWriter = new DocumentWriter();
            converter.SetDocumentWriterInstance(documentWriter);
            converter.LoadDocumentOptions = new LoadDocumentOptions();
            converter.Options.JobErrorMode = DocumentConverterJobErrorMode.Continue;
            converter.Options.EnableSvgConversion = true;
            converter.Options.SvgImagesRecognitionMode = DocumentConverterSvgImagesRecognitionMode.Disabled;
            converter.Options.UseThreads = true;
            converter.Diagnostics.EnableTrace = true;

            var jobData = new DocumentConverterJobData
            {
                InputDocumentFileName = path,
                //Document = document,
                InputDocumentFirstPageNumber = 1,
                InputDocumentLastPageNumber = -1,
                DocumentFormat = Leadtools.Document.Writer.DocumentFormat.Pdf,
                RasterImageFormat = RasterImageFormat.Unknown,
                RasterImageBitsPerPixel = 24,
                OutputDocumentFileName = newPath,
                //AnnotationsMode = OutputAnnotationsMode.None,
                //OutputAnnotationsFileName = this.OutputAnnotationsFileName,
                JobName = "blah",
                UserData = null,
            };

            //jobData.InputAnnotationsFileName = this.InputAnnotationsFileName;

            var job = converter.Jobs.CreateJob(jobData);
            converter.Jobs.RunJob(job);
            foreach (var error in job.Errors)
            {
                _log.Error(error.Error, "Conversion error");
            }
 

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, May 11, 2021 4:40:31 PM(UTC)
Marcus Andra

Groups: Registered, Manager, Tech Support, Administrators
Posts: 75

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

Hello,

Thanks for letting us know about this issue. If you are working through a .NET application, for debugging purposes, I would recommend changing your project build Output path to C:\LEADTOOLS21\Bin\Dotnet4\x64. This is the default file path, after installing the LEADTOOLS main SDK, where you can find all of the DLLs for use in a .NET Framework application. This will make it so when you run your application, it will pull any additional DLLs that you may need in your application which you can make note of. It sounds like your application is expecting additional LEADTOOLS DLLs to exist; however, it cannot find them. Doing this however should give you a good indicator on how to proceed.

If this change does not work for you, please let us know so that we may help you debug further.

Screenshot_1.png

Thanks,
Marcus Andra
Developer Support Engineer
LEAD Technologies, Inc.
LEAD Logo
 
#3 Posted : Wednesday, May 12, 2021 9:49:39 AM(UTC)
wbradney

Groups: Registered
Posts: 8


For some reason the AnyCPU build of my solution was getting the wrong native libraries copied to the bin folder (x64 version), whereas the AnyCPU build of the DocumentConverterDemo was getting the right version (x86).
I added x86 and x64 platforms to my solution and they both build and run correctly.
 
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-2021, Yet Another Forum.NET
This page was generated in 0.081 seconds.