Welcome to LEAD Support Forum Login | Register | Faq  

    LEAD Support Forum
  Resource to find answers and post technical questions about LEAD products.
Search    
   

"Invalid File Format" in web application
Started by billrob458 at 02-03-2006 11:23. Topic has 3 replies.

Print Search « Previous Thread Next Thread »
  02-03-2006, 11:23
billrob458 is not online. Last active: 2/2/2006 11:17:06 PM billrob458

Not Ranked
Joined on 02-02-2006
Posts 1
"Invalid File Format" in web application
Reply Quote
I am trying to open a PDF from inside a web application.  I am using the same code block, same references as my console application to generate an image, but it isn't working.

Any thoughts?  Or what could I do next to debug this problem?

Thanks,

bill

RasterSupport.Unlock(RasterSupportType.Pdf, "<same key code from console application>");
Leadtools.Codecs.RasterCodecs codec = new RasterCodecs();

codec.Options.Pdf.Load.XResolution = 300;
codec.Options.Pdf.Load.YResolution = 300;

string s = @"c:\inetpub\wwwroot\fimanagement\bob.pdf";

IRasterImage image = codec.Load( s );

codec.Save( image, response.BaseStream, RasterImageFormat.Jpeg, 24 );

return;


[ApplicationException: Invalid file format]
   Leadtools.Kernel.ErrorMethods.L_CheckError(Int32 ret)
   Leadtools.Codecs.RasterCodecs.GetInformation(String fileName, Stream stream, Boolean totalPages)
   Leadtools.Codecs.RasterCodecs.Load(LoadParams loadParams)
   Leadtools.Codecs.RasterCodecs.Load(String fileName, Int32 bitsPerPixel, CodecsLoadByteOrder order, Int32 firstPage, Int32 lastPage)
   Leadtools.Codecs.RasterCodecs.Load(String fileName)
   JHA.API.DocGenerator.DocGeneratorAPI.CreateSampleDocumentAsJpg(Guid fiID, String docType, BinaryWriter response, FILineAttributeGroup[] formatGroups) in c:\code\jha\api\docgenerator\docgeneratorapi.cs:909
   JHA.Web.BankManagement.classes.DocFormattingPreviewHandler.ServePreviewPdf(HttpResponse response) in c:\inetpub\wwwroot\fimanagement\classes\docformattingpreviewhandler.cs:50
   JHA.Web.BankManagement.classes.DocFormattingPreviewHandler.ProcessRequest(HttpContext context) in c:\inetpub\wwwroot\fimanagement\classes\docformattingpreviewhandler.cs:30
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute()
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)


   Report 
  02-07-2006, 12:17
Amin is not online. Last active: 10/29/2008 7:59:53 AM Amin



Top 10 Posts
Joined on 06-27-2005
Posts 749
Re: "Invalid File Format" in web application
Reply Quote
Bill,
Does the machine have the PDF engine properly installed? You can check using the CodecsPdfOptions.IsEngineInstalled Property.
Also read about the InitialPath property in the help file.

You could check using other file formats, such as BMP or JPEG. If they also fail, it could be a problem in deploying DLLs or setting the CodecsPath property.
Amin Dodin
LEADTOOLS Technical Support

   Report 
  11-13-2008, 17:45
PPCUBAN is not online. Last active: 11/13/2008 11:41:53 PM PPCUBAN

Top 500 Posts
Joined on 07-08-2008
Posts 10
Re: "Invalid File Format" in web application
Reply Quote
Hello. i am having the same issue and i have the PDF properly installed. When i check CodecsPdfOptions.IsEngineInstalled i returns true.

The weird thing is that i remember it worked for me OK last week. All of a sudden it stopped working and throw this error.

Any help?
   Report 
  11-14-2008, 14:03
GregR is not online. Last active: 1/2/2009 9:03:27 AM GregR



Top 10 Posts
Joined on 05-31-2006
In House
Posts 1,811
Re: "Invalid File Format" in web application
Reply Quote
Is this the same issue you've asked about in http://support.leadtools.com/CS/forums/25011/ShowPost.aspx ?

If so, please ignore this post and just answer the other one.

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?


Greg Ross
LEADTOOLS Technical Support
   Report 
Post
LEAD Support Fo... » Developer » PDF » "Invalid File Format" in web application

Powered by Community Server, by Telligent Systems