Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iTextSharp and Xamarin

I'm trying to use iTextSharp dll in an Xamarin App, but I´m not able to compile because I´ve received this error:

Error       Exception while loading assemblies: System.IO.FileNotFoundException: Could not load assembly 'System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Perhaps it doesn't exist in the Mono for Android profile?
File name: 'System.Drawing.dll'
   at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve(AssemblyNameReference reference, ReaderParameters parameters)
   at Xamarin.Android.Tasks.ResolveAssemblies.AddAssemblyReferences(DirectoryAssemblyResolver resolver, ICollection`1 assemblies, AssemblyDefinition assembly, Boolean topLevel)
   at Xamarin.Android.Tasks.ResolveAssemblies.Execute(DirectoryAssemblyResolver resolver)   App2.Android    C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets   1399    2
like image 431
Piero Zito Avatar asked Jul 05 '26 15:07

Piero Zito


1 Answers

You need to use Xamarin Port.

Xam.iTextSharpLGPL ( Install-Package Xam.iTextSharpLGPL)

You can download package from NuGet https://www.nuget.org/packages/Xam.iTextSharpLGPL/

like image 62
GauravKP Avatar answered Jul 09 '26 15:07

GauravKP



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!