Rank: Newbie Groups: Member
Joined: 10/21/2016 Posts: 3
|
Hi,
We have just updated to your latest version of the EO.PDF library, we upgraded from 5.0.64.2 to 2017.13.1. The previous version where removed from the project, and the new version installed via a NuGet package “EO.Pdf.17.1.3.0.nupkg”, during my regression testing I have found that HtmlToPdfSession has an issue loading the site into the session to obtain the cookie, hence when I load the HTML from the site to be converted to PDF, the resulting HTML is for the error that user is not authenticated.
Test Environment: Windows 10 1607 Build 14393.953 IIS 10.0
C# Code sample:
Dictionary<string, string> dict = new Dictionary<string, string>() { {"username", oXmlApp.SelectSingleNode("//Dispatch_Email/_admin/username").WithDefault(string.Empty)}, {"password", oXmlApp.SelectSingleNode("//Dispatch_Email/_admin/password").WithDefault(string.Empty)}, {"estar", "Login"}, {"isams", "permission"} };
// Set up credentials to bypass Admin login System.Net.CookieCollection myCookies = new System.Net.CookieCollection(); using (HtmlToPdfSession session = HtmlToPdfSession.Create()) { //Load the log in page session.LoadUrl(secureURL + "_admin/");
foreach (KeyValuePair<string, string> kvp in dict) { session.Fill(kvp.Key, kvp.Value); }
session.Submit("submit");
myCookies = session.GetCookies(); //<-- return null and no exception } EO.Pdf.HtmlToPdf.Options.Cookies = myCookies;
Login form:
<form action="default.aspx?isams=permission" method="post" id="frm_main" autocomplete="off"> <input type="hidden" name="estar" value="Login"> <span>username</span> <br> <input tabindex="1" type="text" id="txt_user" name="username" maxlength="50"> <br> <span>password</span> <br> <input tabindex="2" type="password" name="password" maxlength="50"> <div class="loginbuttons"> <input tabindex="3" alt="submit login" name="submit" title="submit login" type="image" src="images/btn_login.png"> </div> </form>
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
Hi,
We have confirmed this to be an issue. This will be fixed in our next build. We will reply again as soon as the new build is posted.
Thanks!
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
Hi,
This is just to let you know that we have posted a new build that should resolve this issue. You can download the new build from our download page. Please take a look and let us know how it goes.
Thanks!
|