PDFtoZPL icon indicating copy to clipboard operation
PDFtoZPL copied to clipboard

Unable to load DLL 'pdfium' or one of its dependencies: The specified procedure could not be found. (0x8007007F)

Open KlausBenislavskis opened this issue 1 year ago • 3 comments

Question

Is there a way to run this library on .net 8 windows nano server? I am getting this error

   at PDFtoImage.Internals.NativeMethods.FPDF_InitLibrary()
   at PDFtoImage.Internals.PdfLibrary.EnsureLoaded()
   at PDFtoImage.Internals.PdfFile..ctor(Stream stream, String password, Boolean disposeStream)
   at PDFtoImage.Internals.PdfDocument.Load(Stream stream, String password, Boolean disposeStream)
   at System.Threading.Tasks.Task`1.InnerInvoke()
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location ---
   at PDFtoImage.Conversion.ToImagesAsync(Stream pdfStream, Boolean leaveOpen, String password, RenderOptions options, CancellationToken cancellationToken)+MoveNext()
   at PDFtoZPL.Conversion.ConvertPdfAsync(Stream pdfStream, Boolean leaveOpen, String password, PdfOptions pdfOptions, ZplOptions zplOptions, CancellationToken cancellationToken)+MoveNext()
   at PDFtoZPL.Conversion.ConvertPdfAsync(Stream pdfStream, Boolean leaveOpen, String password, PdfOptions pdfOptions, ZplOptions zplOptions, CancellationToken cancellationToken)+MoveNext()
   at PDFtoZPL.Conversion.ConvertPdfAsync(Byte[] pdfAsByteArray, String password, PdfOptions pdfOptions, ZplOptions zplOptions, CancellationToken cancellationToken)+MoveNext()
   at PDFtoZPL.Conversion.ConvertPdfAsync(Byte[] pdfAsByteArray, String password, PdfOptions pdfOptions, ZplOptions zplOptions, CancellationToken cancellationToken)+MoveNext()
   at PDFtoZPL.Conversion.ConvertPdfAsync(String pdfAsBase64String, String password, PdfOptions pdfOptions, ZplOptions zplOptions, CancellationToken cancellationToken)+MoveNext()
   at PDFtoZPL.Conversion.ConvertPdfAsync(String pdfAsBase64String, String password, PdfOptions pdfOptions, ZplOptions zplOptions, CancellationToken cancellationToken)+MoveNext()

KlausBenislavskis avatar Jul 02 '24 11:07 KlausBenislavskis

Hi @KlausBenislavskis,

thanks for opening this issue! It should work because the GitHub workflow runs on windows-2019 and windows-2022 which are Windows Nano Server, I think. Or are they Windows Server Core?

I'll test this locally and I will get back to you.

sungaila avatar Jul 02 '24 12:07 sungaila

So I've been testing this and can confirm that this library is running on Windows Server Core, but NOT on Windows Nano Server.

I'm looking into a way to get this working ...

sungaila avatar Jul 03 '24 10:07 sungaila

The pdfium binaries are not linked against onecore and as such cannot be used in Nano Server directly. See chapter Reverse Forwarders.

pdfium.dll depends on the following dlls to work:

  • KERNEL32.dll
  • ADVAPI32.dll
  • GDI32.dll
  • USER32.dll

If you still wish to use this library, you will have to install the Reverse Forwarders in your Nano Server first.

sungaila avatar Jul 03 '24 11:07 sungaila

Please let me know if installing those reverse forwarders helped and reopen this issue.

sungaila avatar Jul 17 '24 09:07 sungaila