3

I'm having a very odd issue when attempting to call a method from the Nuget Package IronPDF. Based on the symptoms and the fact that I can't find anyone else on the internet who has encountered this issue, I'm assuming it's not the package's fault.


Basically, whenever I call "HtmlToPdf.RenderHtmlAsPdf()" in a console app, everything works fine, but when I run it as a managed application through Revit 2018 (as an addin), the method freaks out and returns the following System.IO.IOException: enter image description here

System.IO.IOException: 'Can not parse a PDF from an empty byte array.'

To me, it's 100% clear I'm correctly passing it a string in BOTH scenarios & the documentation clearly states that it takes only a string (IronPDF Documentation), but somehow it thinks it's receiving an empty byte array!!!!??? How weird!!!

If you know any reason why running a C# application as managed through an external application would cause strings to be read as byte arrays, please help!

wazz
  • 4,953
  • 5
  • 20
  • 34
  • 1
    I'm getting teh same exception. It works in my ASP.Net Core 2.2 app locally (win10), but when it runs on ECS in a linux container, it thows up. I tried bot this method, and its asynchronous twin. – Jared Sep 24 '19 at 21:29
  • I rolled back to NuGet version 5.2.0, and it's still throwing the same error. I think it's time to switch libraries. – Jared Sep 24 '19 at 22:15
  • if you are running on windows server perhaps unblocking the IronPdf.DLL will help solve this issue (under the file properties dialog) - this solved the same error i had – BigFatBaby Oct 24 '19 at 13:25
  • I have the same issue running a console app on Windows Server 2012R2. Did you find a solution for it? – Arnold Wiersma Apr 28 '21 at 14:32

1 Answers1

1

I don't know anything about Revit addins, but I would guess you are missing some dependencies. I was getting the exact same exception, because when I built my Docker container (running linux), I was missing several.

Iron PDF documents this specific issue here:

https://ironpdf.com/docs/questions/docker-linux/

enter image description here

Jared
  • 360
  • 3
  • 11