Closed hounddog22030 closed 2 years ago
fyi... not sure why, but EnableUnixSupport had no effect. going to try to downgrade System.Drawing.Common to 5.0.3
downgrade to system.drawing.common 5.0.3 worked
Hi @hounddog22030,
thank you for bringing this to my attention! PDFtoZPL uses System.Drawing.Common
in version 5.0.3
but I wanted to get rid of libgdiplus
for a long time now anyway.
There is no compelling reason for GDI+ besides being the easiest solution for Windows (and targeting everything else via libgdiplus
).
I am looking into MAUI as a replacement but cannot promise a solution before the end of this year.
Happy holidays and a happy new year!
I am looking into MAUI as a replacement but cannot promise a solution before the end of this year.
I don't know anything about MAUI, but have a small amount of experience with SixLabors. If you wanted me to take a crack @ it with SixLabors, let me know.
Hey @hounddog22030, could you please take a look at 3.0.0-preview? I decided on SkiaSharp as a replacement for GDI+ as it is maintained by Microsoft.
Hope this will help with future .NET versions (6.x and newer).
Hey @hounddog22030, could you please take a look at [3.0.0-preview]
Sorry for the slow response.
We're getting the below exception:
` System.TypeInitializationException: The type initializer for 'PDFtoImage.PdfiumViewer.NativeMethods' threw an exception. ---> System.DllNotFoundException: Unable to load shared library '/var/task/libSkiaSharp.so' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libfontconfig.so.1: cannot open shared object file: No such file or directory
at System.Runtime.InteropServices.NativeLibrary.LoadByName(String libraryName, QCallAssembly callingAssembly, Boolean hasDllImportSearchPathFlag, UInt32 dllImportSearchPathFlag, Boolean throwOnError)
at System.Runtime.InteropServices.NativeLibrary.LoadLibraryByName(String libraryName, Assembly assembly, Nullable'1 searchPath, Boolean throwOnError)
at System.Runtime.InteropServices.NativeLibrary.Load(String libraryName, Assembly assembly, Nullable'1 searchPath)
at PDFtoImage.PdfiumViewer.NativeMethods.LoadNativeLibrary(String path)
at PDFtoImage.PdfiumViewer.NativeMethods..cctor()
--- End of inner exception stack trace ---
at PDFtoImage.PdfiumViewer.NativeMethods.FPDF_InitLibrary()
at PDFtoImage.PdfiumViewer.PdfLibrary..ctor()
at PDFtoImage.PdfiumViewer.PdfLibrary.EnsureLoaded()
at PDFtoImage.PdfiumViewer.PdfFile..ctor(Stream stream, String password)
at PDFtoImage.PdfiumViewer.PdfDocument..ctor(Stream stream, String password)
at PDFtoImage.PdfiumViewer.PdfDocument.Load(Stream stream, String password)
at PDFtoImage.Conversion.ToImages(Stream pdfStream, String password, Int32 dpi, Nullable'1 width, Nullable'1 height, Boolean withAnnotations, Boolean withFormFill)+MoveNext()
at PDFtoZPL.Conversion.ConvertPdf(Stream pdfStream, String password, Int32 dpi, Nullable'1 width, Nullable'1 height, Boolean withAnnotations, Boolean withFormFill)+MoveNext()
at YadaYada.BubbleBoy.WebApi.Controllers.Label.LabelController.GetZpl(Guid orderId) in /codebuild/output/src280698725/src/bbapi/WebApi/Controllers/Label/LabelController.cs:line 106
The type initializer for 'PDFtoImage.PdfiumViewer.NativeMethods' threw an exception. `
Looks like PDFtoImage requires libgdiplus on linux (see bottom of https://www.nuget.org/packages/PDFtoImage/), which really gets back to the root problem.
I have a branch and deployment with the 3.0.0 version of PDFtoZPL all setup so if there's anything else you want me to try, I can now get to it very quickly.
Thanks
Looks like PDFtoImage requires libgdiplus on linux (see bottom of https://www.nuget.org/packages/PDFtoImage/), which really gets back to the root problem.
No, 3.0.0-preview has no dependency on libgdiplus anymore. If you check your exception, you will notice it did not find the new SkiaSharp dependency instead.
System.DllNotFoundException: Unable to load shared library '/var/task/libSkiaSharp.so' or one of its dependencies.
I am wondering why your setup is searching for /var/task/libSkiaSharp.so
. Do you use dotnet publish
with a predefined architecture (e.g. linux-x64)? Otherwise there should be a folder like /var/task/runtimes/linux-x64
.
How does your output directory look like? Is there a libpdfium.so
? Is there a libSkiaSharp.so
? Maybe there is some issue with filename case sensitivity?
Is the PDFtoImage.dll
in /var/task
as well?
No, 3.0.0-preview has no dependency on libgdiplus. If you check your exception, you will notice it did not find the new SkiaSharp dependency. You are correct, sorry.
I am wondering why your setup is searching for
/var/task/libSkiaSharp.so
. Do you usedotnet publish
with a predefined architecture (e.g. linux-x64)? Otherwise there should be a folder like/var/task/runtimes/linux-x64
.
this is our package command:
dotnet lambda package --framework net5.0 --package-type image --configuration $CONFIGURATION --dockerfile ../../Dockerfile --docker-build-working-dir . --docker-host-build-output-dir bin/linux-x64/publish --project-location bbapi/WebApi --image-tag "${ECRURI}:bbapi-${EXEC_ID}"
Which in turn issues:
dotnet publish "C:\Users\17034\source\repos\bbmono\bbapi/WebApi" --output "C:\Users\17034\source\repos\bbmono\bbapi/WebApi\bin\Release\net5.0\publish" --configuration "Release" --framework "net5.0" /p:GenerateRuntimeConfigurationFiles=true --runtime linux-x64 --self-contained false
How does your output directory look like? Is there a
libpdfium.so
? Is there alibSkiaSharp.so
? Maybe there is some issue with filename case sensitivity?
All three are present and have the same casing.
This is the entire dir from building on Windows:
` Volume in drive C is OS Volume Serial Number is A6C6-B46D
Directory of C:\Users\17034\source\repos\bbmono\bbapi\WebApi\bin\Release\net6.0\publish
01/28/2022 04:46 PM
dotnet publish ... --runtime linux-x64
Ok, this causes dotnet to to include the Linux assemblies only. This means that the publish directory shouldn't have a runtimes folder, libpdfium.so
and libSkiaSharp.so
must be in the root folder next to PDFtoZPL.dll
. Your file list looks correct.
I am wondering about your output directory C:\Users\17034\source\repos\bbmono\bbapi\WebApi\bin\Release\net6.0\publish
.
Because your lambda package
command uses an other directory.
dotnet lambda package ... --docker-host-build-output-dir bin/linux-x64/publish
Shouldn't it be --docker-host-build-output-dir bin/Release/net6.0/publish
?
Shouldn't it be
--docker-host-build-output-dir bin/Release/net6.0/publish
?
The docker stuff is all voodoo magic to me, I don't understand it, but I using a pattern shown by AWS to publish/package and we don't have any problems with any of it. Even the PdfToZpl is working correctly using the 5.0 version of System.Drawing.Common.
Our docker file is pretty simple:
` FROM public.ecr.aws/lambda/dotnet:latest AS base
WORKDIR /var/task
COPY "bin/linux-x64/publish" .
`
Can you look up the content of the folder bin/linux-x64/publish
? Is it structured just like C:\Users\17034\source\repos\bbmono\bbapi\WebApi\bin\Release\net6.0\publish
(all 3 files found at its root)?
Maybe the natives libs aren't copied properly in this case.
Can you look up the content of the folder
bin/linux-x64/publish
? Is it structured just likeC:\Users\17034\source\repos\bbmono\bbapi\WebApi\bin\Release\net6.0\publish
(all 3 files found at its root)?Maybe the natives libs aren't copied properly in this case.
Already had that in process....
775 | AWSSDK.CloudFormation.dll 776 | AWSSDK.CognitoIdentity.dll 777 | AWSSDK.CognitoIdentityProvider.dll 778 | AWSSDK.Core.dll 779 | AWSSDK.DynamoDBv2.dll 780 | AWSSDK.EC2.dll 781 | AWSSDK.EventBridge.dll 782 | AWSSDK.Extensions.NETCore.Setup.dll 783 | AWSSDK.Lambda.dll 784 | AWSSDK.RDS.dll 785 | AWSSDK.S3.dll 786 | AWSSDK.SQS.dll 787 | AWSSDK.SecurityToken.dll 788 | Amazon.AspNetCore.Identity.Cognito.dll 789 | Amazon.Extensions.CognitoAuthentication.dll 790 | Amazon.Lambda.APIGatewayEvents.dll 791 | Amazon.Lambda.ApplicationLoadBalancerEvents.dll 792 | Amazon.Lambda.AspNetCoreServer.dll 793 | Amazon.Lambda.CloudWatchEvents.dll 794 | Amazon.Lambda.Core.dll 795 | Amazon.Lambda.Logging.AspNetCore.dll 796 | Amazon.Lambda.S3Events.dll 797 | Amazon.Lambda.SNSEvents.dll 798 | Amazon.Lambda.SQSEvents.dll 799 | Amazon.Lambda.Serialization.Json.dll 800 | Amazon.Lambda.Serialization.SystemTextJson.dll 801 | Amazon.Lambda.TestUtilities.dll 802 | Auth0.AuthenticationApi.dll 803 | Auth0.Core.dll 804 | Azure.Core.dll 805 | Azure.Identity.dll 806 | Base36.NetStandard.dll 807 | Castle.Core.dll 808 | DotLiquid.dll 809 | DotNetConfig.dll 810 | FluentAssertions.dll 811 | FluentValidation.AspNetCore.dll 812 | FluentValidation.DependencyInjectionExtensions.dll 813 | FluentValidation.dll 814 | JWT.dll 815 | JetBrains.Annotations.dll 816 | Microsoft.AspNetCore.Authentication.JwtBearer.dll 817 | Microsoft.AspNetCore.JsonPatch.dll 818 | Microsoft.AspNetCore.Mvc.NewtonsoftJson.dll 819 | Microsoft.AspNetCore.TestHost.dll 820 | Microsoft.Azure.KeyVault.Core.dll 821 | Microsoft.Azure.Storage.Blob.dll 822 | Microsoft.Azure.Storage.Common.dll 823 | Microsoft.Bcl.AsyncInterfaces.dll 824 | Microsoft.Data.SqlClient.dll 825 | Microsoft.DiaSymReader.PortablePdb.dll 826 | Microsoft.DiaSymReader.dll 827 | Microsoft.DotNet.PlatformAbstractions.dll 828 | Microsoft.EntityFrameworkCore.Abstractions.dll 829 | Microsoft.EntityFrameworkCore.InMemory.dll 830 | Microsoft.EntityFrameworkCore.Relational.dll 831 | Microsoft.EntityFrameworkCore.SqlServer.dll 832 | Microsoft.EntityFrameworkCore.dll 833 | Microsoft.Extensions.DependencyModel.dll 834 | Microsoft.Identity.Client.Extensions.Msal.dll 835 | Microsoft.Identity.Client.dll 836 | Microsoft.IdentityModel.JsonWebTokens.dll 837 | Microsoft.IdentityModel.Logging.dll 838 | Microsoft.IdentityModel.Protocols.OpenIdConnect.dll 839 | Microsoft.IdentityModel.Protocols.dll 840 | Microsoft.IdentityModel.Tokens.dll 841 | Microsoft.Win32.SystemEvents.dll 842 | Moq.dll 843 | NJsonSchema.CodeGeneration.CSharp.dll 844 | NJsonSchema.CodeGeneration.dll 845 | NJsonSchema.Yaml.dll 846 | NJsonSchema.dll 847 | NSwag.Annotations.dll 848 | NSwag.AspNetCore.dll 849 | NSwag.CodeGeneration.CSharp.dll 850 | NSwag.CodeGeneration.dll 851 | NSwag.Core.Yaml.dll 852 | NSwag.Core.dll 853 | NSwag.Generation.AspNetCore.dll 854 | NSwag.Generation.dll 855 | Namotion.Reflection.dll 856 | Newtonsoft.Json.Bson.dll 857 | Newtonsoft.Json.dll 858 | NuGet.Common.dll 859 | NuGet.Configuration.dll 860 | NuGet.Frameworks.dll 861 | NuGet.Packaging.dll 862 | NuGet.Versioning.dll 863 | PDFtoImage.dll 864 | PDFtoZPL.dll 865 | PredicateBuilder.dll 866 | QRCoder.dll 867 | SixLabors.Core.dll 868 | SixLabors.Fonts.dll 869 | SixLabors.ImageSharp.Drawing.dll 870 | SixLabors.ImageSharp.dll 871 | SkiaSharp.dll 872 | SleetLib.dll 873 | System.CodeDom.dll 874 | System.Configuration.ConfigurationManager.dll 875 | System.Drawing.Common.dll 876 | System.IO.Pipelines.dll 877 | System.IdentityModel.Tokens.Jwt.dll 878 | System.Management.dll 879 | System.Runtime.Caching.dll 880 | System.Security.Cryptography.ProtectedData.dll 881 | System.Security.Permissions.dll 882 | System.Windows.Extensions.dll 883 | Telerik.DataSource.dll 884 | Web.Support.dll 885 | Web.Support.pdb 886 | YadaYada.Aces.dll 887 | YadaYada.Aces.pdb 888 | YadaYada.Advertising.Entity.dll 889 | YadaYada.Advertising.Entity.pdb 890 | YadaYada.Amazon.Data.dll 891 | YadaYada.Amazon.Data.pdb 892 | YadaYada.Amazon.Entity.dll 893 | YadaYada.Amazon.Entity.pdb 894 | YadaYada.Amazon.Mws.Runtime.dll 895 | YadaYada.Amazon.Mws.Runtime.pdb 896 | YadaYada.Amazon.Mws.dll 897 | YadaYada.Amazon.Mws.pdb 898 | YadaYada.AutoCare.Vcdb.Data.dll 899 | YadaYada.AutoCare.Vcdb.Data.pdb 900 | YadaYada.AutoCare.Vcdb.Entity.dll 901 | YadaYada.AutoCare.Vcdb.Entity.pdb 902 | YadaYada.AutoParts.Data.dll 903 | YadaYada.AutoParts.Data.pdb 904 | YadaYada.AutoParts.Entity.dll 905 | YadaYada.AutoParts.Entity.pdb 906 | YadaYada.Bisque.Annotations.dll 907 | YadaYada.Bisque.Aws.dll 908 | YadaYada.BubbleBoy.Data.dll 909 | YadaYada.BubbleBoy.Data.pdb 910 | YadaYada.BubbleBoy.Imaging.dll 911 | YadaYada.BubbleBoy.Imaging.pdb 912 | YadaYada.BubbleBoy.Support.dll 913 | YadaYada.BubbleBoy.Support.pdb 914 | YadaYada.BubbleBoy.WebApi 915 | YadaYada.BubbleBoy.WebApi.Client.dll 916 | YadaYada.BubbleBoy.WebApi.Client.pdb 917 | YadaYada.BubbleBoy.WebApi.deps.json 918 | YadaYada.BubbleBoy.WebApi.dll 919 | YadaYada.BubbleBoy.WebApi.pdb 920 | YadaYada.BubbleBoy.WebApi.runtimeconfig.json 921 | YadaYada.Data.Library.dll 922 | YadaYada.Data.Library.dll.config 923 | YadaYada.Data.Library.pdb 924 | YadaYada.Ebay.Data.dll 925 | YadaYada.Ebay.Data.pdb 926 | YadaYada.Ebay.Entity.dll 927 | YadaYada.Ebay.Entity.pdb 928 | YadaYada.Entity.Annotations.dll 929 | YadaYada.Entity.Annotations.pdb 930 | YadaYada.Entity.Library.dll 931 | YadaYada.Entity.Library.pdb 932 | YadaYada.Imaging2.dll 933 | YadaYada.Imaging2.pdb 934 | YadaYada.LabelMaker.Configuration.dll 935 | YadaYada.LabelMaker.Configuration.pdb 936 | YadaYada.LabelMaker.Data.dll 937 | YadaYada.LabelMaker.Data.pdb 938 | YadaYada.LabelMaker.Library.dll 939 | YadaYada.LabelMaker.Library.pdb 940 | YadaYada.LabelMaker.RestClient.dll 941 | YadaYada.LabelMaker.RestClient.pdb 942 | YadaYada.Lambda.dll 943 | YadaYada.Lambda.pdb 944 | YadaYada.Library.Client.dll 945 | YadaYada.Library.Client.pdb 946 | YadaYada.Library.Extensions.dll 947 | YadaYada.Library.Extensions.pdb 948 | YadaYada.Marketplace.Data.dll 949 | YadaYada.Marketplace.Data.pdb 950 | YadaYada.Marketplace.Entity.dll 951 | YadaYada.Marketplace.Entity.pdb 952 | YadaYada.Metadata.Data.dll 953 | YadaYada.Metadata.Data.pdb 954 | YadaYada.Metadata.Entity.dll 955 | YadaYada.Metadata.Entity.pdb 956 | YadaYada.Orders.Data.dll 957 | YadaYada.Orders.Data.pdb 958 | YadaYada.Orders.Entity.dll 959 | YadaYada.Orders.Entity.pdb 960 | YadaYada.Printing.dll 961 | YadaYada.Printing.pdb 962 | YadaYada.Security.Entity.dll 963 | YadaYada.Security.Entity.pdb 964 | YadaYada.Security.dll 965 | YadaYada.Security.pdb 966 | YadaYada.Shipping.Data.dll 967 | YadaYada.Shipping.Data.pdb 968 | YadaYada.Shipping.Entity.dll 969 | YadaYada.Shipping.Entity.pdb 970 | YadaYada.Tenancy.Data.dll 971 | YadaYada.Tenancy.Data.pdb 972 | YadaYada.Tenancy.Entity.dll 973 | YadaYada.Tenancy.Entity.pdb 974 | YadaYada.TestUtilities.dll 975 | YadaYada.TestUtilities.pdb 976 | YadaYada.Upc.Entity.dll 977 | YadaYada.Upc.Entity.pdb 978 | YadaYada.Walmart.Data.dll 979 | YadaYada.Walmart.Data.pdb 980 | YadaYada.Walmart.Entity.dll 981 | YadaYada.Walmart.Entity.pdb 982 | YadaYada.Web.dll 983 | YadaYada.Web.pdb 984 | YamlDotNet.dll 985 | appsettings.Development.WithAuthentication.json 986 | appsettings.Development.json 987 | appsettings.json 988 | aws-lambda-tools-defaults.json 989 | it 990 | libSkiaSharp.so 991 | libpdfium.so 992 | refs 993 | runtime.osx.10.10-x64.CoreCompat.System.Drawing.dll 994 | runtimeconfig.template.json 995 | 996 | [Container] 2022/01/28 22:48:48 Phase complete: BUILD State: SUCCEEDED
`
Sorry for following this false trail, @hounddog22030. I just double checked the exception above and noticed the following error:
libfontconfig.so.1: cannot open shared object file: No such file or directory
This is a dependency needed by SkiaSharp which might not be included in the lightweight AWS lambda container.
You can change the dockerfile to install this missing dependency:
FROM public.ecr.aws/lambda/dotnet:latest AS base
WORKDIR /var/task
COPY "bin/linux-x64/publish" .
RUN apt-get update && apt-get install -y libfontconfig1
I should add this to the NuGet readme. Other containers like the Linux agents on Azure Pipelines have this dependency out-of-the-box. That's why I am hesitant to include it into the NuGet package.
Got it working with the below
`FROM public.ecr.aws/lambda/dotnet:latest AS base
WORKDIR /var/task
COPY "bin/linux-x64/publish" .
RUN yum install -y amazon-linux-extras RUN amazon-linux-extras install epel -y RUN yum -y install fontconfig freetype ` Can I assume that 3.0.0-preview will not be updated? If so, I am going to roll this to production.
Thanks!
Hey @hounddog22030, glad to hear you got the docker container running!
If you have some time for further testing left, could you please take a look at 3.0.0-preview2? This release has no dependency to libfontconfig.so.1
and you shouldn't need the packages fontconfig
and freetype
anymore.
I will build a stable PDFtoZPL 3.0.0 release once SkiaSharp 2.88 is finalized.
Seems to still work... here's the publish dir from the CodeBuild log:
ls bbapi/WebApi/bin/linux-x64/publish 775 | AWSSDK.CloudFormation.dll 776 | AWSSDK.CognitoIdentity.dll 777 | AWSSDK.CognitoIdentityProvider.dll 778 | AWSSDK.Core.dll 779 | AWSSDK.DynamoDBv2.dll 780 | AWSSDK.EC2.dll 781 | AWSSDK.EventBridge.dll 782 | AWSSDK.Extensions.NETCore.Setup.dll 783 | AWSSDK.Lambda.dll 784 | AWSSDK.RDS.dll 785 | AWSSDK.S3.dll 786 | AWSSDK.SQS.dll 787 | AWSSDK.SecurityToken.dll 788 | Amazon.AspNetCore.Identity.Cognito.dll 789 | Amazon.Extensions.CognitoAuthentication.dll 790 | Amazon.Lambda.APIGatewayEvents.dll 791 | Amazon.Lambda.ApplicationLoadBalancerEvents.dll 792 | Amazon.Lambda.AspNetCoreServer.dll 793 | Amazon.Lambda.CloudWatchEvents.dll 794 | Amazon.Lambda.Core.dll 795 | Amazon.Lambda.Logging.AspNetCore.dll 796 | Amazon.Lambda.S3Events.dll 797 | Amazon.Lambda.SNSEvents.dll 798 | Amazon.Lambda.SQSEvents.dll 799 | Amazon.Lambda.Serialization.Json.dll 800 | Amazon.Lambda.Serialization.SystemTextJson.dll 801 | Amazon.Lambda.TestUtilities.dll 802 | Auth0.AuthenticationApi.dll 803 | Auth0.Core.dll 804 | Azure.Core.dll 805 | Azure.Identity.dll 806 | Base36.NetStandard.dll 807 | Castle.Core.dll 808 | DotLiquid.dll 809 | DotNetConfig.dll 810 | FluentAssertions.dll 811 | FluentValidation.AspNetCore.dll 812 | FluentValidation.DependencyInjectionExtensions.dll 813 | FluentValidation.dll 814 | JWT.dll 815 | JetBrains.Annotations.dll 816 | Microsoft.AspNetCore.Authentication.JwtBearer.dll 817 | Microsoft.AspNetCore.JsonPatch.dll 818 | Microsoft.AspNetCore.Mvc.NewtonsoftJson.dll 819 | Microsoft.AspNetCore.TestHost.dll 820 | Microsoft.Azure.KeyVault.Core.dll 821 | Microsoft.Azure.Storage.Blob.dll 822 | Microsoft.Azure.Storage.Common.dll 823 | Microsoft.Bcl.AsyncInterfaces.dll 824 | Microsoft.Data.SqlClient.dll 825 | Microsoft.DiaSymReader.PortablePdb.dll 826 | Microsoft.DiaSymReader.dll 827 | Microsoft.DotNet.PlatformAbstractions.dll 828 | Microsoft.EntityFrameworkCore.Abstractions.dll 829 | Microsoft.EntityFrameworkCore.InMemory.dll 830 | Microsoft.EntityFrameworkCore.Relational.dll 831 | Microsoft.EntityFrameworkCore.SqlServer.dll 832 | Microsoft.EntityFrameworkCore.dll 833 | Microsoft.Extensions.DependencyModel.dll 834 | Microsoft.Identity.Client.Extensions.Msal.dll 835 | Microsoft.Identity.Client.dll 836 | Microsoft.IdentityModel.JsonWebTokens.dll 837 | Microsoft.IdentityModel.Logging.dll 838 | Microsoft.IdentityModel.Protocols.OpenIdConnect.dll 839 | Microsoft.IdentityModel.Protocols.dll 840 | Microsoft.IdentityModel.Tokens.dll 841 | Microsoft.Win32.SystemEvents.dll 842 | Moq.dll 843 | NJsonSchema.CodeGeneration.CSharp.dll 844 | NJsonSchema.CodeGeneration.dll 845 | NJsonSchema.Yaml.dll 846 | NJsonSchema.dll 847 | NSwag.Annotations.dll 848 | NSwag.AspNetCore.dll 849 | NSwag.CodeGeneration.CSharp.dll 850 | NSwag.CodeGeneration.dll 851 | NSwag.Core.Yaml.dll 852 | NSwag.Core.dll 853 | NSwag.Generation.AspNetCore.dll 854 | NSwag.Generation.dll 855 | Namotion.Reflection.dll 856 | Newtonsoft.Json.Bson.dll 857 | Newtonsoft.Json.dll 858 | NuGet.Common.dll 859 | NuGet.Configuration.dll 860 | NuGet.Frameworks.dll 861 | NuGet.Packaging.dll 862 | NuGet.Versioning.dll 863 | PDFtoImage.dll 864 | PDFtoZPL.dll 865 | PredicateBuilder.dll 866 | QRCoder.dll 867 | SixLabors.Core.dll 868 | SixLabors.Fonts.dll 869 | SixLabors.ImageSharp.Drawing.dll 870 | SixLabors.ImageSharp.dll 871 | SkiaSharp.dll 872 | SleetLib.dll 873 | System.CodeDom.dll 874 | System.Configuration.ConfigurationManager.dll 875 | System.Drawing.Common.dll 876 | System.IO.Pipelines.dll 877 | System.IdentityModel.Tokens.Jwt.dll 878 | System.Management.dll 879 | System.Runtime.Caching.dll 880 | System.Security.Cryptography.ProtectedData.dll 881 | System.Security.Permissions.dll 882 | System.Windows.Extensions.dll 883 | Telerik.DataSource.dll 884 | Web.Support.dll 885 | Web.Support.pdb 886 | YadaYada.Aces.dll 887 | YadaYada.Aces.pdb 888 | YadaYada.Advertising.Entity.dll 889 | YadaYada.Advertising.Entity.pdb 890 | YadaYada.Amazon.Data.dll 891 | YadaYada.Amazon.Data.pdb 892 | YadaYada.Amazon.Entity.dll 893 | YadaYada.Amazon.Entity.pdb 894 | YadaYada.Amazon.Mws.Runtime.dll 895 | YadaYada.Amazon.Mws.Runtime.pdb 896 | YadaYada.Amazon.Mws.dll 897 | YadaYada.Amazon.Mws.pdb 898 | YadaYada.AutoCare.Vcdb.Data.dll 899 | YadaYada.AutoCare.Vcdb.Data.pdb 900 | YadaYada.AutoCare.Vcdb.Entity.dll 901 | YadaYada.AutoCare.Vcdb.Entity.pdb 902 | YadaYada.AutoParts.Data.dll 903 | YadaYada.AutoParts.Data.pdb 904 | YadaYada.AutoParts.Entity.dll 905 | YadaYada.AutoParts.Entity.pdb 906 | YadaYada.Bisque.Annotations.dll 907 | YadaYada.Bisque.Aws.dll 908 | YadaYada.BubbleBoy.Data.dll 909 | YadaYada.BubbleBoy.Data.pdb 910 | YadaYada.BubbleBoy.Imaging.dll 911 | YadaYada.BubbleBoy.Imaging.pdb 912 | YadaYada.BubbleBoy.Support.dll 913 | YadaYada.BubbleBoy.Support.pdb 914 | YadaYada.BubbleBoy.WebApi 915 | YadaYada.BubbleBoy.WebApi.Client.dll 916 | YadaYada.BubbleBoy.WebApi.Client.pdb 917 | YadaYada.BubbleBoy.WebApi.deps.json 918 | YadaYada.BubbleBoy.WebApi.dll 919 | YadaYada.BubbleBoy.WebApi.pdb 920 | YadaYada.BubbleBoy.WebApi.runtimeconfig.json 921 | YadaYada.Data.Library.dll 922 | YadaYada.Data.Library.dll.config 923 | YadaYada.Data.Library.pdb 924 | YadaYada.Ebay.Data.dll 925 | YadaYada.Ebay.Data.pdb 926 | YadaYada.Ebay.Entity.dll 927 | YadaYada.Ebay.Entity.pdb 928 | YadaYada.Entity.Annotations.dll 929 | YadaYada.Entity.Annotations.pdb 930 | YadaYada.Entity.Library.dll 931 | YadaYada.Entity.Library.pdb 932 | YadaYada.Imaging2.dll 933 | YadaYada.Imaging2.pdb 934 | YadaYada.LabelMaker.Configuration.dll 935 | YadaYada.LabelMaker.Configuration.pdb 936 | YadaYada.LabelMaker.Data.dll 937 | YadaYada.LabelMaker.Data.pdb 938 | YadaYada.LabelMaker.Library.dll 939 | YadaYada.LabelMaker.Library.pdb 940 | YadaYada.LabelMaker.RestClient.dll 941 | YadaYada.LabelMaker.RestClient.pdb 942 | YadaYada.Lambda.dll 943 | YadaYada.Lambda.pdb 944 | YadaYada.Library.Client.dll 945 | YadaYada.Library.Client.pdb 946 | YadaYada.Library.Extensions.dll 947 | YadaYada.Library.Extensions.pdb 948 | YadaYada.Marketplace.Data.dll 949 | YadaYada.Marketplace.Data.pdb 950 | YadaYada.Marketplace.Entity.dll 951 | YadaYada.Marketplace.Entity.pdb 952 | YadaYada.Metadata.Data.dll 953 | YadaYada.Metadata.Data.pdb 954 | YadaYada.Metadata.Entity.dll 955 | YadaYada.Metadata.Entity.pdb 956 | YadaYada.Orders.Data.dll 957 | YadaYada.Orders.Data.pdb 958 | YadaYada.Orders.Entity.dll 959 | YadaYada.Orders.Entity.pdb 960 | YadaYada.Printing.dll 961 | YadaYada.Printing.pdb 962 | YadaYada.Security.Entity.dll 963 | YadaYada.Security.Entity.pdb 964 | YadaYada.Security.dll 965 | YadaYada.Security.pdb 966 | YadaYada.Shipping.Data.dll 967 | YadaYada.Shipping.Data.pdb 968 | YadaYada.Shipping.Entity.dll 969 | YadaYada.Shipping.Entity.pdb 970 | YadaYada.Tenancy.Data.dll 971 | YadaYada.Tenancy.Data.pdb 972 | YadaYada.Tenancy.Entity.dll 973 | YadaYada.Tenancy.Entity.pdb 974 | YadaYada.TestUtilities.dll 975 | YadaYada.TestUtilities.pdb 976 | YadaYada.Upc.Entity.dll 977 | YadaYada.Upc.Entity.pdb 978 | YadaYada.Walmart.Data.dll 979 | YadaYada.Walmart.Data.pdb 980 | YadaYada.Walmart.Entity.dll 981 | YadaYada.Walmart.Entity.pdb 982 | YadaYada.Web.dll 983 | YadaYada.Web.pdb 984 | YamlDotNet.dll 985 | appsettings.Development.WithAuthentication.json 986 | appsettings.Development.json 987 | appsettings.json 988 | aws-lambda-tools-defaults.json 989 | it 990 | libSkiaSharp.so 991 | libpdfium.so 992 | refs 993 | runtime.osx.10.10-x64.CoreCompat.System.Drawing.dll 994 | runtimeconfig.template.json
Great! Thanks for helping in getting rid of System.Drawing.Common
! 😄
Great! Thanks for helping in getting rid of
System.Drawing.Common
! 😄
Thanks for getting rid of it! 😄
Hi. I updated to 3.2.2 from 3.0.0-preview3 and I am receiving the below error.
This is running on AWS Lambda linux arm64
I have examined the publish output, libpdfium.so
is present in the zip (from the subdirectory linux-arm64
- same size at least).
There is no GLIBC
Thoughts?
The type initializer for 'PDFtoImage.PdfiumViewer.NativeMethods' threw an exception.","status":500,"detail":"System.TypeInitializationException: The type initializer for 'PDFtoImage.PdfiumViewer.NativeMethods' threw an exception.
---> System.DllNotFoundException: Unable to load shared library '/var/task/libpdfium.so' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: /lib64/libm.so.6: version `GLIBC_2.27' not found (required by /var/task/libpdfium.so)
at System.Runtime.InteropServices.NativeLibrary.LoadByName(String libraryName, QCallAssembly callingAssembly, Boolean hasDllImportSearchPathFlag, UInt32 dllImportSearchPathFlag, Boolean throwOnError)
at System.Runtime.InteropServices.NativeLibrary.LoadLibraryByName(String libraryName, Assembly assembly, Nullable`1 searchPath, Boolean throwOnError)
at System.Runtime.InteropServices.NativeLibrary.Load(String libraryName, Assembly assembly, Nullable`1 searchPath)
at PDFtoImage.PdfiumViewer.NativeMethods.LoadLibrary(String path, String runtimeIdentifier, String pdfiumLibName)
at PDFtoImage.PdfiumViewer.NativeMethods.LoadNativeLibraryNetCore(String path)
at PDFtoImage.PdfiumViewer.NativeMethods..cctor()
--- End of inner exception stack trace ---
at PDFtoImage.PdfiumViewer.NativeMethods.FPDF_InitLibrary()
at PDFtoImage.PdfiumViewer.PdfLibrary.EnsureLoaded()
at PDFtoImage.PdfiumViewer.PdfFile..ctor(Stream stream, String password, Boolean disposeStream)
at PDFtoImage.PdfiumViewer.PdfDocument..ctor(Stream stream, String password, Boolean disposeStream)
at PDFtoImage.PdfiumViewer.PdfDocument.Load(Stream stream, String password, Boolean disposeStream)
at PDFtoImage.Conversion.ToImages(Stream pdfStream, Boolean leaveOpen, String password, Int32 dpi, Nullable`1 width, Nullable`1 height, Boolean withAnnotations, Boolean withFormFill)+MoveNext()
at PDFtoZPL.Conversion.ConvertPdf(Stream pdfStream, Boolean leaveOpen, String password, Int32 dpi, Nullable`1 width, Nullable`1 height, Boolean withAnnotations, Boolean withFormFill, BitmapEncodingKind encodingKind, Boolean graphicFieldOnly)+MoveNext()
at Api.Controllers.Label.LabelController.GetZpl(Guid orderId)
FYI: Converting back from AWS Lambda arm64 to linux-x64 seems to be a workaround....
Thoughts?
Thanks
Hi @hounddog22030,
PDFtoZPL 3.0.0-preview3 did not include Linux AArch64/arm64 binaries for libpdfium.so but PDFtoZPL 3.2.2 does. How did preview3 work on AWS Lambda Linux arm64 in the first place?
Anyway, searching the internet it looks like AWS Lambda ships with Glibc 2.26 but pdfium needs Glibc 2.27.
Best option is to wait for Amazon to update their distribution, I guess. I don't unterstand why x64 is working and arm64 is not, though.
Hi. I updated to 3.2.2 from 3.0.0-preview3 and I am receiving the below error.
Sorry, I should have said "I updated to 3.2.2 from 3.0.0-preview3 AND switched from x64 to arm64". Btw, not my typical way of doing things, I had another integration crash out on me and figured if it's already broken, I can't break it more.
Thanks for that link. Maybe the x64 AWS Lambda image is newer than the arm64?
We're getting errors using this on AWS Lambda (Linux based).
The error is because of System.Drawing: https://docs.microsoft.com/en-us/dotnet/core/compatibility/core-libraries/6.0/system-drawing-common-windows-only
There seems to be some workarounds, like installing libgdiplus into the docker container (https://aws.amazon.com/blogs/developer/net-5-aws-lambda-support-with-container-images/) and EnableUnixSupport in the runtimeconfig.
Are there any hopes or plans for this library to follow some of the recommendations as outlined in https://docs.microsoft.com/en-us/dotnet/core/compatibility/core-libraries/6.0/system-drawing-common-windows-only ?