6

I am using ExpertPdf *HtmlToPdf* library. When I try to AddElement to PdfPage I get an exception: "Could not get conversion result header. Data receive error. Could not receive data. Error code: 109". I have no idea why is that.

Code below:

PdfPage page = doc.Pages.AddNewPage();

HtmlToPdfElement htmlToPdfElement = new HtmlToPdfElement(0,0,0-1,"cos",null);

AddElementResult result = page.AddElement(htmlToPdfElement);
Bug
  • 2,576
  • 2
  • 21
  • 36
Mark
  • 71
  • 1
  • 4
  • Did you include the *.dat file in your build output? Next to the *.dll? If not, check http://stackoverflow.com/questions/12460500/evopdf-library-fails-on-windows-azure-hosted-site/43844040#43844040 for more info. – M. Mimpen May 08 '17 at 13:17
  • Is there any solution? i have same issue – Vishal Parmar Feb 02 '19 at 05:36

2 Answers2

2

If you change application pool identity to user which has admin rights, it solves the problem.

hkutluay
  • 6,794
  • 2
  • 33
  • 53
  • 1
    Could you elaborate on why? This sometimes works for me and sometimes does not. Is this the same behaviour you saw? – The Senator Apr 30 '19 at 15:45
0

I am not sure what the ExpertPdf is, however the error is similar to what is described in troubleshooting guide for EVO HTML to PDF Converter:

The conversion fails with 'Data receive error. Could not receive data. Exception of type 'System.OutOfMemoryException' was thrown', 'Memory allocation error. Try the 64-bit version', 'Data receive error. Could not receive data. Error code: 6', 'Data receive error. Could not receive data. Error code: 0', 'Data receive error. Could not receive data. Error code: 109' error messages or you see the 'Exception code: 0xc0000005' in Windows logs for evointernal.dat process

These error messages can indicate a memory allocation error in converter. In general you can avoid memory allocation issues by running the converter in a 64-bit environment. This is the recommended configuration for EVO HTML to PDF Converter. When you run the converter in ASP.NET you have to set the 'Enable 32-bit' flag of the IIS application pool on false to make sure the converter runs in a 64-bit process. It is also recommended to use the version of the converter optimized for 64-bit environments, which is provided as a separate download on our website. This version should also avoid the memory allocation issues that might occur during the navigation.

Looks like they use the same engine. Hope this helps.

Community
  • 1
  • 1
Herman Kan
  • 2,253
  • 1
  • 25
  • 32