Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User32.dll dependency on linux #6

Open
AlexSchuetz opened this issue Nov 17, 2020 · 4 comments
Open

User32.dll dependency on linux #6

AlexSchuetz opened this issue Nov 17, 2020 · 4 comments

Comments

@AlexSchuetz
Copy link

AlexSchuetz commented Nov 17, 2020

Running our project on linux we get the following error:

PdfTemplating.XslFO.XslFORenderException: Error occurred while rendering the XslFO into Pdf File output. --->
PdfTemplating.XslFO.XslFORenderException: System.DllNotFoundException: Unable to load shared library 'User32.dll' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable:
libUser32.dll: cannot open shared object file: No such file or directory
   at Fonet.Pdf.Gdi.LibWrapper.GetDC(IntPtr hWnd)
   at Fonet.Pdf.Gdi.GdiDeviceContent..ctor()
   at Fonet.Render.Pdf.FontSetup.AddSystemFonts(FontType fontType)
   at Fonet.Render.Pdf.FontSetup..ctor(FontInfo fontInfo, FontType proxyFontType)
   at Fonet.Render.Pdf.PdfRenderer.SetupFontInfo(FontInfo fontInfo)
   at Fonet.StreamRenderer.StartRenderer()
   at Fonet.Fo.FOTreeBuilder.Parse(XmlReader reader)
   at PdfTemplating.XslFO.Fonet.CustomExtensions.XslFOFonetHelper.<>c__DisplayClass3_0.<Render>b__2(Object sender, FonetEventArgs eventArgs)
   at Fonet.FonetDriver.FireFonetError(String message)
   at Fonet.Fo.FOTreeBuilder.Parse(XmlReader reader)
   at Fonet.FonetDriver.Render(XmlReader inputReader, Stream outputStream)
   at PdfTemplating.XslFO.Fonet.CustomExtensions.XslFOFonetHelper.Render(XDocument xXslFODoc, Stream outputStream, XslFORenderOptions options)
   at PdfTemplating.XslFO.Fonet.CustomExtensions.XslFONetXDocumentCustomExtensions.RenderXslFOToPdf(XDocument xXslFODoc, XslFORenderOptions options)
@AlexSchuetz
Copy link
Author

Obviously the following dlls are required:

  • User32.dll
  • gdi32.dll

I think both of them are windows-only dlls. These dependencies should be replaced or at least be listed in the dependencies of the nuget package.

@cajuncoding
Copy link
Owner

@AlexSchuetz sorry for the delayed response. I will have to look more closely into this, but you may be correct. I have never tried executing the FO.Net (cloned from original CodePlex) in a Linux deployment. Though the code does compile and run fine as .Net core port....

I'll leave this issue open until I have time to further look into this. But, that is why I've shifted to using a PDF as a Service approach using true Apache FOP via AzureFunctions deployment....

A ready to deploy project is here: https://github.com/cajuncoding/ApacheFOP.Serverless

And a Branch of this project PdfTemplating.XslFO that implements a new use case leveraging the ApacheFOP.Serverless is located here:
https://github.com/cajuncoding/PdfTemplating.XslFO/tree/feature/iniial_support_for_apache_fop_serverless_rendering

@AlexSchuetz
Copy link
Author

I'll have a look at the serviceaproach, thank's.

Meanwhile my collegue lokked into this and found out, that wine comes with a user32 and gdi32 implementation. Do you have any ideas on how to use these?

@cajuncoding
Copy link
Owner

cajuncoding commented Dec 5, 2020

@AlexSchuetz unfortunately I'm not familiar with the use of wine, but that is interesting. If you make any progress on that, I'd love to hear about it.

I generally have always used .Net, and still am with my current client whereby we will likely deploy the ApacheFOP.Serverless for in January/Feb when they prioritize for us to replace existing legacy Crystal Reports based PDF reports...

I'll try to find time to push a Nuget update with dependencies updated soon -- Thanks for the Feedback!

Good Luck!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants