locked
itextsharp component and session values RRS feed

  • Question

  • User1000638852 posted

    I am trying to implement a pdf export using the free ITextSharp library. I am using a request and response to get the content of an aspx page then produce the pdf with the response's html through a streamreader. The problem I am having is that there is security on the page using session values, so when I call the page for the pdf generation, somehow the session values are lost and the ITextSharp object ends up trying to produce a pdf of the login page which is where a user would land if they have not entered their credentials.

    HELP, please. I am lost. If I cannot do this with ITextSharp can someone suggest another PDF generator for HTML which will not be affected by my login/session security issues. Please, help.

    Monday, May 17, 2010 5:25 PM

Answers

  • User2010474417 posted

    Hi,

    You are correct i was also faced the same problem.For that i'm using print option.

    Check this link ,

    http://forums.asp.net/t/1546173.aspx


    Regards,

    Rajkumar M.


    Please remember to click “Mark as Answer” on the post that helps you, it will help other(s) to get there answer.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, May 18, 2010 12:31 AM
  • User-457597647 posted

    I use ABCpdf for converting HTML and active server pages to PDF.

    It handles authentication methods built into HTTP, but ASP.NET forms based authentication needs a different approach. Because it's under your programmatic control a component can't authenticate itself - you have to authenticate the component!

    You'll need to allow the component to pass in a username and password to your page, possibly encoded in the URL, and then have that page call the FormsAuthentication.Authenticate code.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, May 24, 2010 12:57 AM

All replies

  • User2010474417 posted

    Hi,

    You are correct i was also faced the same problem.For that i'm using print option.

    Check this link ,

    http://forums.asp.net/t/1546173.aspx


    Regards,

    Rajkumar M.


    Please remember to click “Mark as Answer” on the post that helps you, it will help other(s) to get there answer.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, May 18, 2010 12:31 AM
  • User-457597647 posted

    I use ABCpdf for converting HTML and active server pages to PDF.

    It handles authentication methods built into HTTP, but ASP.NET forms based authentication needs a different approach. Because it's under your programmatic control a component can't authenticate itself - you have to authenticate the component!

    You'll need to allow the component to pass in a username and password to your page, possibly encoded in the URL, and then have that page call the FormsAuthentication.Authenticate code.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, May 24, 2010 12:57 AM