Hello,
I detected the problem and yes is a security problem, in development is random in a farm always fails, this is SharePoint with Windows Auth.
HtmlToPdf.Options.PageSize = EO.Pdf.PdfPageSizes.A4;
HtmlToPdf.Options.PreserveHighResImages = false;
HtmlToPdf.Options.JpegQualityLevel = 90;
HtmlToPdf.Options.GeneratePageImages = true;
HtmlToPdf.Options.MinLoadWaitTime = 5000;
HtmlToPdf.Options.PageSize = new System.Drawing.SizeF(PdfPageSizes.A4.Height, PdfPageSizes.A4.Width);
HtmlToPdf.Options.VisibleElementIds = "panelanalisis";
HtmlToPdf.Options.AutoFitX = HtmlToPdfAutoFitMode.ShrinkToFit;
HtmlToPdf.Options.AutoFitY = HtmlToPdfAutoFitMode.None;
HtmlToPdf.Options.OutputArea = new RectangleF(0.25f, 0.25f, 10.75f, 8.0f);
string cBaseURL = Request.Url.Scheme + "://" + Request.Url.Authority + Request.ApplicationPath.TrimEnd('/') + "/";
HtmlToPdf.Options.BaseUrl = cBaseURL.ToLower();
string cURLFile = SPContext.Current.Site.Url + "/" + SPContext.Current.File.Url + "?" + this.Page.Request.QueryString.ToString();
HtmlToPdfResult oResultHtmlToPdf = HtmlToPdf.ConvertUrl(cURLFile.ToLower(), pdfStream);//SPContext.Current.Site.Url + this.Page.Request.RawUrl, pdfStream);
pdfStream.Position = 0;
byte[] contents = ReadFully(pdfStream);
System.Exception: EO.Pdf.HtmlToPdfException: Failed to convert Url 'http://qaapp.fractus.cl/sites/acco/pages/analisiscuenta.aspx?cuentaid=3951&periodo=08052015&divisionid=28&form=26&tipocuenta=activo+corriente&desc=cajas&acccid=440'.(401:The requested resource requires user authentication. This is an error returned by the Web server, not by the HTML to PDF converter. Please try to visit the same Url with your browser to verify whether the Url is valid.)
at EO.Pdf.Internal.c8.a(String A_0, Boolean A_1)
at EO.Pdf.Internal.c8.b(HtmlToPdfOptions A_0, String A_1, Boolean A_2)
at EO.Pdf.Internal.c8.a(br A_0) at EO.Pdf.Internal.lm.c.a(Byte[] A_0)
at EO.Pdf.Internal.a.b(BinaryReader A_0)
at EO.Pdf.Internal.lm.a(a A_0)
at EO.Pdf.HtmlToPdfSession.a(a A_0)
at EO.Pdf.HtmlToPdf.ConvertUrl(String url, PdfDocument doc, HtmlToPdfOptions options)
at EO.Pdf.HtmlToPdf.ConvertUrl(String url, Stream stream, HtmlToPdfOptions options)
at EO.Pdf.HtmlToPdf.ConvertUrl(String url, Stream stream)
at Fractus.ACCC.wpFormularios.wpFormulariosUserControl.btnAprobar_Click(Object sender, EventArgs e)
at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Fractus - Developer & Consulting