jbaarssen / PdfLibCore

PdfLib CORE is a fast PDF editing and reading library for modern .NET Core applications.
MIT License
110 stars 13 forks source link

MCG0037:InvalidCSharpIdentifierName Struct 'PdfLibCore.Types.FS_RECTF' #19

Open mnxamdev opened 1 year ago

mnxamdev commented 1 year ago

We get this when we're doing release builds for our Xamarin.Forms UWP app.

C:\Program Files (x86)\Microsoft SDKs\UWPNuGetPackages\microsoft.net.native.compiler\2.2.12-rel-31116-00\tools\Microsoft.NetNative.targets(809,5): error : MCG0037: MCG0037:InvalidCSharpIdentifierName Struct 'PdfLibCore.Types.FS_RECTF' in assembly 'Assembly(Name=PdfLibCore, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null, Location=D:\...\ilc\in\PdfLibCore.dll)' has a field with name '<Left>k__BackingField' that is invalid. This could be because the name is obfuscated or the field is auto-implemented by the compiler. Please make sure the field name follows C# identifier conventions.

This might have some insight on how to fix the issue but I'm unclear how it would apply to PdfLibCore: https://developercommunity.visualstudio.com/t/cant-build-release-code-mcg0037invalidcsharpidenti/526363#T-N529127

Thanks!

gwei1234 commented 11 months ago

For Error:segfault at 0 ip sp error 4 ....in libc-2.28.so[7f32c2a4b000+148000]

Environment:linux docker netcore Code: var pdfDocument = new PdfLibCore.PdfDocument(ms); foreach (var page in pdfDocument.Pages) { using (var pdfPage = page) { var pageWidth = (int)(dpiX pdfPage.Size.Width / 72); var pageHeight = (int)(dpiY pdfPage.Size.Height / 72);

                    using (var bitmap = new PdfLibCore.PdfiumBitmap(pageWidth, pageHeight, true))
                    {
                        pdfPage.Render(bitmap, PdfLibCore.Enums.PageOrientations.Normal, PdfLibCore.Enums.RenderingFlags.LcdText);
                        var stream = bitmap.AsBmpStream(dpiX, dpiY);
                        // do other bussiness for save to oss

                        stream.Close();
                    }
                }
            }
            pdfDocument.Close();
gwei1234 commented 11 months ago

![Uploading Snipaste_2023-11-30_18-53-23.jpg…]()