Welcome Guest Search | Active Topics | Sign In | Register

Access to the path 'c:\windows\system32\inetsrv\ denied in EO.PDF Options
KabanaSoft
Posted: Tuesday, October 18, 2016 7:39:27 PM
Rank: Newbie
Groups: Member

Joined: 10/17/2016
Posts: 1
Hello,

I recently purchased a license for your EO.PDF product and am using it to convert HTML to PDF.

Everything works fine when running locally on IIS express, however, when i went to deploy my project live, i am getting the following error when trying to convert the HTML to PDF:

Access to the path 'c:\windows\system32\inetsrv\<documentTitle>' is denied.

Couple of questions:

Is there a way to fix this issue?
Why does EO.PDF need to access the root folder that contains the files necessary to run IIS?
Does EO.PDF require read / write access to a temp folder? If so, can i specify that folder with appropriate permissions?

We are using the following C# code to convert the HTML to PDF that is causing this error:

public static byte[] ConvertAsPdf(string html, string documentTitle = "")
{
var pdfOptions = new EO.Pdf.HtmlToPdfOptions(){
PageSize = new SizeF(8.5f, 11f),
OutputArea = new RectangleF(0.25f, 0.25f, 8f, 10.5f),
MinLoadWaitTime = 2000,
};

var result = EO.Pdf.HtmlToPdf.ConvertHtml(html, documentTitle, pdfOptions);

using (var pdfStream = new MemoryStream())
{
result.PdfDocument.Save(pdfStream);

return pdfStream.ToArray();
}
}

Your prompt help in this matter would be greatly appreciated, thanks!

eo_support
Posted: Wednesday, October 19, 2016 8:22:18 AM
Rank: Administration
Groups: Administration

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

The second argument for ConvertHtml is the result PDF file name. Make sure you pass the full path to that argument. If you do not pass the full path, then it will be assumed to be in the "current" path, which can be your IIS folder.

Alternatively, you can pass a PdfDocument object. For example:

Code: C#
PdfDocument doc = new PdfDocument();
HtmlToPdf.ConvertHtml(html, doc, pdfOptions);
doc.Save(pdfStream);


This way it won't try to save the PDF file to disk at all.

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.