I use Pechkin to convert my page to pdf, every time I try to convert, the page that generated is always login page. But, when I open the page directly it opened Normally. this is my code that i used to convert to pdf:
var client = new WebClient();
String url = Request.Url.AbsoluteUri;
string urlMap = new Uri(HttpContext.Current.Request.Url.AbsoluteUri).OriginalString;
string urll = urlMap.Substring(0, urlMap.LastIndexOf("/"));
string urlpdf = urll+"/PrintPdf.aspx?No=" + txtNo.Text + "&VoyNo=" + txtVoyage.Text + "";
Response.Redirect(urlpdf);
var pechkin = Factory.Create(new GlobalConfig());
var pdf = pechkin.Convert(new ObjectConfig()
.SetLoadImages(true).SetZoomFactor(1.5)
.SetPrintBackground(true)
.SetScreenMediaType(true)
.SetCreateExternalLinks(true)
.SetIntelligentShrinking(true).SetCreateInternalLinks(true)
.SetPageUri(urlpdf));
Response.Clear();
Response.ClearContent();
Response.ClearHeaders();
Response.ContentType = "application/pdf";
Response.AddHeader("Content-Disposition", string.Format("attachment;filename=test.pdf; size={0}", pdf.Length));
Response.BinaryWrite(pdf);
Response.Flush();
Response.End();