Click here to Skip to main content
15,912,504 members
Please Sign up or sign in to vote.
1.45/5 (3 votes)
See more:
The error is given below

C#
Could not load file or assembly 'libpdf.DLL' or one of its dependencies. The specified module could not be found.



the code is
C#
public string imagegen()
       {
           using (FileStream file = System.IO.File.OpenRead(@"..\path\Content\PDF\ApplicationForm_10.pdf")) // in file
           {
               var bytes = new byte[file.Length];
               file.Read(bytes, 0, bytes.Length);
               using (var pdf = new LibPdf(bytes))
               {
                   byte[] pngBytes = pdf.GetImage(0, ImageType.PNG); // image type
                   using (var outFile = System.IO.File.Create(@"..\path\Content\PDF\file.png")) // out file
                   {
                       outFile.Write(pngBytes, 0, pngBytes.Length);
                   }
               }
           }

           return "";
       }



i have added the libpdf.DLL in refference


Thanks in advance
Pls help me
Posted
Comments
Richard MacCutchan 16-Dec-15 3:59am    
Make sure that DLL file is in the correct location for your application.
Athul MS 16-Dec-15 4:36am    
reffer in reffrence folder is it correct
Athul MS 16-Dec-15 4:47am    
which way to reffer the libpdf is better,which folder is used for that?
Richard MacCutchan 16-Dec-15 5:18am    
The DLL needs to be in the same directory as your application, or one of the ones in the Windows search path.
Nathan Minier 16-Dec-15 8:39am    
Or you can use Fody.Costura to embed it into your application.

You might also get this message if the class library has a VC++ redistribute-able dependency that is not installed on the host system.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900