Welcome Guest Search | Active Topics | Sign In | Register

Conversion failed. Failed to initialize conversion (1) Options
ShopSetup
Posted: Monday, January 11, 2016 9:08:44 AM
Rank: Newbie
Groups: Member

Joined: 9/4/2015
Posts: 7
Hello,

I am getting this error when trying to generate a PDF with a header and footer.

Code: C#
EO.Pdf.HtmlToPdfException: Conversion failed. Failed to initialize conversion (1). ---> EO.Internal.qg: Failed to initialize conversion (1).
   at EO.Internal.aip.a(aip A_0, ak9 A_1)
   at EO.Internal.aip.a(abc A_0, Boolean A_1, a44 A_2)
   at EO.Internal.aip.a(abc A_0, a44 A_1)
   --- End of inner exception stack trace ---
   at EO.Internal.aip.a(abc A_0, a44 A_1)
   at EO.Pdf.HtmlToPdfSession..ctor(HtmlToPdfOptions A_0)
   at EO.Pdf.HtmlToPdf.ConvertHtml(String html, PdfDocument doc, HtmlToPdfOptions options)
   at EO.Pdf.HtmlToPdf.ConvertHtml(String html, String pdfFileName, HtmlToPdfOptions options)
   at EO.Pdf.HtmlToPdf.ConvertHtml(String html, String pdfFileName)
   at Generate(dbDataContext db, HttpContext context, Int32 pid)
   at ProcessRequest(HttpContext context)


EO.Base.dll productversion = 15.3.71.0
EO.Pdf.dll productversion = 15.3.71.0

It works on localhost, running Windows 10.
But fails on production running a old Windows Server 2003 R2
eo_support
Posted: Tuesday, January 12, 2016 11:36:05 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,229
Hi,

We are not able to reproduce this problem. You can check your Windows event viewer and see if you see any error there. It is also possible that you have an AntiVirus program on your server that incorrectly kills our child process.

If none of those is the problem, we can take a look of your system to see what we can find if you can make it access to us.

Thanks!
ShopSetup
Posted: Tuesday, January 12, 2016 11:46:57 AM
Rank: Newbie
Groups: Member

Joined: 9/4/2015
Posts: 7
Hi,

I tried looking the Event Viewer, but could not find anything from EO.PDF / EssentialObjects.
Nothing about a terminated process either.

Does the error Conversion failed. Failed to initialize conversion (1) mean that a process EO.PDF created, was terminated?
It it possible to change / configure EO.PDF to log more? Set a location for a .log file or something?

Could it be permission related? If so, where does EO.PDF create the process?


Unfortunately, I cannot give you direct access to the server.
eo_support
Posted: Tuesday, January 12, 2016 12:12:58 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,229
Hi,

Yes. That error message means a child process was created but was immediately terminated (or crashed). The log usually does not help in this case since if our process is killed then it would have no ability/chance to write any log at all.

We tested it here on Windows 2003 R2 and it works fine. So you may want to test it on a different system and see if it works there. If it does work, then you can try to find the difference, and if it does not, then maybe you can arrange to give us access to that test system instead of your production system. Obviously we are not interested in anything on our production system, but usually in order for us to troubleshoot an issue we have to see it first. That's why it would be very helpful if you can give us remote access to any system that demonstrates the problem.

Thanks!
ShopSetup
Posted: Wednesday, January 13, 2016 8:34:50 AM
Rank: Newbie
Groups: Member

Joined: 9/4/2015
Posts: 7
Hi,

Like I mentioned, it works fine locally on my development machine running Windows 10.
However, it fails on the production server running Windows 2003 R2 for some reason.
There is no antivirus software on the server.

I tried adding the following:
Code: C#
EO.Pdf.Runtime.TempFilePath = @"C:\Path-Where-IIS-Can-Write-Files";
EO.Base.Runtime.LogFileName = @"C:\Path-Where-IIS-Can-Write-Files\test.txt";

But nothing get written to the file or folder (that I can see through the FTP). Am I missing something?
Where does EO.Pdf create the process?

My test code that fails
Code: C#
EO.Pdf.Runtime.AddLicense("*key*");
EO.Pdf.Runtime.TempFilePath = @"C:\Path-Where-IIS-Can-Write-Files";
EO.Base.Runtime.LogFileName = @"C:\Path-Where-IIS-Can-Write-Files\test.txt";

EO.Pdf.HtmlToPdf.Options.JpegQualityLevel = 100;
EO.Pdf.HtmlToPdf.Options.PageSize = EO.Pdf.PdfPageSizes.A4;
EO.Pdf.HtmlToPdf.Options.OutputArea = new RectangleF(0f, 0.5f, EO.Pdf.HtmlToPdf.Options.PageSize.Width, EO.Pdf.HtmlToPdf.Options.PageSize.Height - 1.0f);
EO.Pdf.HtmlToPdf.Options.AutoFitX = EO.Pdf.HtmlToPdfAutoFitMode.ScaleToFit;

using (var ms = new MemoryStream())
{
    EO.Pdf.HtmlToPdf.ConvertHtml("<html><head></head><body><h1>Hello!</h1><p>World.</p></body></html>", ms);
    ms.Position = 0;

    Response.ClearHeaders();
    Response.ClearContent();
    Response.Clear();
    Response.ContentType = "application/pdf";
    Response.AddHeader("content-disposition", "attachment;filename=\"PdfTest.pdf\"");
    ms.WriteTo(Response.OutputStream);

    Context.ApplicationInstance.CompleteRequest();
}
eo_support
Posted: Wednesday, January 13, 2016 10:31:58 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,229
Hi,

I do not have anything else to tell you. ConvertHtml will create child process through and run the actual conversion inside that process. If that process is killed by something or crashed, then you will receive this error. We have no way of telling you why this happens -- for example you might have some program on your server that just kills any "unknown" process. You will need to find that part out --- or if you can, you can give us access to the server and we will try to find it out for you. But there is no way for us to tell you what's happening without seeing the problem at all.

Thanks
ShopSetup
Posted: Wednesday, January 13, 2016 11:00:09 AM
Rank: Newbie
Groups: Member

Joined: 9/4/2015
Posts: 7
I cannot give you access to the server due to security reason. But I can give you the URL to the test page which fails for me.

There is no debug version you can provide me with? Which logs and reports a lot more?
eo_support
Posted: Wednesday, January 13, 2016 12:43:17 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,229
Hi,

There is really nothing else we can do unless we can have access to the machine --- and even that we can't even guarantee that we will be able to find out the root cause if it is something abnormal particular to that machine, all we can say is we will be happy to try. We have already told you logs won't help when the process is killed ---- it doesn't have any chance to write any logs.

Thanks


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.