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 : Thursday, November 13, 2008 1:42:46 PM(UTC)

PPCUBAN  
PPCUBAN

Groups: Registered
Posts: 9


hello.

I have an app that loads a PDF.

here the steps

if (file.Contains(".pdf"))
{
//// set codecs load options
rasterCodecs.Options.Load.XResolution = 150;
rasterCodecs.Options.Load.YResolution = 150;
rasterCodecs.Options.Pdf.Load.XResolution = 150;
rasterCodecs.Options.Pdf.Load.YResolution = 150;
rasterCodecs.Options.Pdf.Load.GraphicsAlpha = 1;
rasterCodecs.Options.Pdf.Load.TextAlpha = 1;

mainImage = rasterCodecs.Load(file,0, Leadtools.Codecs.CodecsLoadByteOrder.BgrOrGray, 1, -1);
//mainImage = rasterCodecs.Load(file);

}

Here is the problem. it worked at the beginning. Then it stopped working for no reason and throws that exception. it's actually frustrating. I haven't changed any line of code in my app.
Any help?

Thank you
 

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 : Thursday, November 13, 2008 1:48:04 PM(UTC)

PPCUBAN  
PPCUBAN

Groups: Registered
Posts: 9


I couldnt edit my post. Im adding some extra notes.

this is my using section.

using Leadtools;
using Leadtools.Codecs;
using Leadtools.WinForms;
using Leadtools.Codecs.Tif;
using Leadtools.Codecs.Cmp;
 
#3 Posted : Friday, November 14, 2008 8:49:19 AM(UTC)

GregR  
GregR

Groups: Registered, Tech Support, Administrators
Posts: 764


What is the file version of Leadtools.dll that you are using?

Which DLLs do you have referenced/copied into your Application directory?

Is this your development machine or deployment machine?
 
#4 Posted : Monday, November 17, 2008 10:31:56 AM(UTC)

PPCUBAN  
PPCUBAN

Groups: Registered
Posts: 9


1. Leadtools.dll version is 15.0.0.0. Runtime Version is v2.0.50727.

2. Leadtools.dll
Leadtools.Codecs.Cmp
Leadtools.Codecs.Fax
Leadtools.Codecs.Tif
Leadtools.ImageProcessing.Color
Leadtools.Winforms
Leadtools.Twain

3. My working environment is
- Windows Vista
- Framework 3.5 SP1
- Visual Studio 2008
This is a development machine.
 
#5 Posted : Tuesday, November 18, 2008 3:43:15 AM(UTC)

GregR  
GregR

Groups: Registered, Tech Support, Administrators
Posts: 764


In the v15/16 .NET libraries, Invalid File Format means one of three things:

1.
The file is actually invalid or there's a problem with the codec.  If you can load the same file in one of our pre-compiled demos that ship with the toolkit, then this is not the case.

2.
You did not call RasterCodecs.StartUp

3.
You are not including as a reference or copying to your EXE's directory the necessary codecs dll for the file format.  These dlls follow the naming convention of Leadtools.Codecs.???.dll (e.g. Leadtools.Codecs.Tif.dll).  To learn which dlls are necessary for a particular file format, please read the help file article "Files to be Included With Your Application" and find the row for the file format in question.

If you have any more questions or problems, please let me know.
 
#6 Posted : Tuesday, November 18, 2008 5:00:42 AM(UTC)

PPCUBAN  
PPCUBAN

Groups: Registered
Posts: 9


Hello.
thank you for your response.

OK. I went to
C:\Program Files\LEAD Technologies\LEADTOOLS 15\Examples\DotNet\CS\PdfCompDemo

I ran the sample. The i tried to open the pdf document we are dealing with. it throw me a different error.
PDF Capability is required.

I remember when i added in my project Leadtools.Codecs.Pdf i started having the same error.

What's next step?

 
#7 Posted : Tuesday, November 18, 2008 5:18:12 AM(UTC)

PPCUBAN  
PPCUBAN

Groups: Registered
Posts: 9


I am gonna send you the whole piece of code.

Just so you know. We are creating a viewer/processor for pdf, tiff and jpeg. These three types of file are those we mainly use in our office. They are save in bulk to an unified processing folder so we iterate thru every file in our folder and depending on the format (file type) we load it differently.

here is the code.


////PDF VERSION
File.SetAttributes(file, FileAttributes.ReadOnly);
File.GetCreationTime(file);
if (file.Contains(".pdf"))
{
//// set codecs load options
rasterCodecs.Options.Load.XResolution = 150;
rasterCodecs.Options.Load.YResolution = 150;
rasterCodecs.Options.Pdf.Load.XResolution = 150;
rasterCodecs.Options.Pdf.Load.YResolution = 150;
rasterCodecs.Options.Pdf.Load.GraphicsAlpha = 1;
rasterCodecs.Options.Pdf.Load.TextAlpha = 1;
//mainImage = rasterCodecs.Load(file,0, Leadtools.Codecs.CodecsLoadByteOrder.BgrOrGray, 1, -1);
mainImage = rasterCodecs.Load(file);
}

////TIFF VERSION
if (file.Contains(".tif") || file.Contains(".tiff"))
mainImage = rasterCodecs.Load(file, 2, 0, 1, -1);

////JPG VERSION
if (file.Contains(".jpg") || file.Contains(".jpeg"))
{
rasterCodecs.Options.Load.XResolution = 300;
rasterCodecs.Options.Load.YResolution = 300;
mainImage = rasterCodecs.Load(file, 8, CodecsLoadByteOrder.BgrOrGray, 1, -1);
}
 
#8 Posted : Tuesday, November 18, 2008 5:37:12 AM(UTC)

GregR  
GregR

Groups: Registered, Tech Support, Administrators
Posts: 764


The other error, PDF Capability Required, means that you need to unlock support for PdfRead.  If you do not have this unlock code, please contact our sales department.
 
#9 Posted : Tuesday, November 18, 2008 6:04:48 AM(UTC)

PPCUBAN  
PPCUBAN

Groups: Registered
Posts: 9


Wow. Well, honestly i thought we had purchased the full license with all the toys since PDF is one of the most used file type in our company.

The funny thing is that i would bet my house and car that last week i worked with PDF files in my system. not to mention that i never used Leadtools.Codecs.Pdf before in those days.

Any possible reason or explanation why this happened please? before i go crazy and start strongly to believe i was taken by Aliens last week and all that happened in a dream :)

 
#10 Posted : Tuesday, November 18, 2008 6:12:54 AM(UTC)

GregR  
GregR

Groups: Registered, Tech Support, Administrators
Posts: 764


You may have purchased the PDF plugin, but you still have to sign licensing agreements in order to get the unlock codes.  When you first install the licensed version of the SDK, it uses a NAG kernel which displays a nag message but doesn't require anything to be unlocked so that you can develop the application and sign the agreements later.  Perhaps you unknowingly started using the NONAG version which requires unlocking.
 
#11 Posted : Tuesday, November 18, 2008 6:42:47 AM(UTC)

PPCUBAN  
PPCUBAN

Groups: Registered
Posts: 9


Ok. our Tech Support department is going to call your sales department to find out about this. i remember we purchased the full package version 1.4 and then we upgraded. That's my recollection.

Aside from that, is there any reasonable explanation to why i was able to see PDF documents before. Now you got me confused. I am 99.9% sure that i tested last week several PDFs.

Thank You
 
#12 Posted : Tuesday, November 18, 2008 6:45:09 AM(UTC)

PPCUBAN  
PPCUBAN

Groups: Registered
Posts: 9


I have another problem related to memory use of the RasterImage and RasterImageViewer object. Where is the best section to post this?

Thank you
 
#13 Posted : Tuesday, November 18, 2008 6:48:24 AM(UTC)

GregR  
GregR

Groups: Registered, Tech Support, Administrators
Posts: 764


 PPCUBAN wrote:Ok. our Tech Support department is going to call
your sales department to find out about this. i remember we purchased
the full package version 1.4 and then we upgraded. That's my
recollection.
Aside from that, is there any reasonable explanation to why i was able
to see PDF documents before. Now you got me confused. I am 99.9% sure that i tested last week several PDFs.

There's only two possible reasons that you used to be able to load PDF
files before (assuming you were always using the same version of the SDK):

1.
You were unlocking support for PdfRead

2.
You were using either the NAG or Evaluation version of Leadtools.dll.

 PPCUBAN wrote:I have another problem related to memory use of
the RasterImage and RasterImageViewer object. Where is the best section to post this?

Either the .NET or the Image Display forums would be appropriate.  As long as you make a new post for new issues, that's all we really care about =).
 
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.283 seconds.