Welcome Guest Search | Active Topics | Sign In | Register

PDF Conversion failed. A generic error occurred in GDI+ Options
poorni
Posted: Thursday, March 23, 2017 2:38:46 PM
Rank: Newbie
Groups: Member

Joined: 5/21/2014
Posts: 5
hi,

I am converting the html file to PDF , got the error "PDF Conversion failed. A generic error occurred in GDI+". how to resolve this?

My Code is

HtmlToPdf.Options.OutputArea = New System.Drawing.RectangleF(0.1F, 0.1F, 8.3F, 10.8F)

HtmlToPdf.ConvertUrl(copyfolderpath + htmlfilename, copyfolderpath + pdffilename)


eo_support
Posted: Thursday, March 23, 2017 3:37:41 PM
Rank: Administration
Groups: Administration

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

This particular error can be very misleading and it can be caused by that your application does not have the permission to write the file. Try to pass a PdfDocument object as the second argument and see if it works:

Code: C#
PdfDocument doc = new PdfDocument();
HtmlToPdf.ConvertUrl(copyfolderpath + htmlfilename, doc);


Please let us know if this is the problem.

Thanks!
poorni
Posted: Thursday, March 23, 2017 4:09:37 PM
Rank: Newbie
Groups: Member

Joined: 5/21/2014
Posts: 5
hi,

Your code is not working.

My code is working for all other files.

It is not working for one particular type of html,

please provide a link to upload the file and let me know the issue. This file conversion was working till yesterday, all of the sudden it is not working.

eo_support
Posted: Thursday, March 23, 2017 7:51:10 PM
Rank: Administration
Groups: Administration

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

In that case you can try to isolate the problem into a test HTML file and send the test file to us. We will then try to run it here and see what we can find. See here for more information on how to send test files to us:

https://www.essentialobjects.com/forum/test_project.aspx

You may also want to try the latest build to see if the latest build already resolves the issue for you.

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.