Live Support, Chat, Upload Control and Rich Text Editor
Welcome to Support forums Sign in | Join | Help |Client Center
in Search

HTML to PDF : background-color problem

Last post 03-15-2012, 7:34 AM by Kenneth. 1 replies.
Sort Posts: Previous Next
  •  03-15-2012, 4:45 AM 73460

    HTML to PDF : background-color problem

    Hi,
     
    I try to export html to pdf with the "HTML2PDF" class and I have a problem with backround-color in "li" tags. I f I use te red, yellow,green,... color it's ok. But if I try, for exemple "silver" I have an Adobe Reader error...
    If I try my html code in the test page http://cutesoft.net/example/createPDF.aspx, it works fine !
     
     Here is my code:
     private void ConverToPdf()
        {
            // setup a TextWriter to capture the markup
            TextWriter tw = new StringWriter();
            HtmlTextWriter htw = new HtmlTextWriter(tw);

            htw.Write("<html xmlns='http://www.w3.org/1999/xhtml'><head></head><body style='font-family:Helvetica; font-size:11px;' width:750px;>");

            // render the markup into our surrogate TextWriter  
            p_conteneur_print.RenderControl(htw);


            htw.Write("</body></html>");

            //get the captured markup as a string
            string pageSource = tw.ToString();

            CuteEditor.Convertor.PDF.HTML2PDF html2pdf = new CuteEditor.Convertor.PDF.HTML2PDF(tw.ToString());

            html2pdf.Render();

            string file_name = Session.SessionID + ".pdf";
            string file_path = "temp_pdf/" + file_name;

            html2pdf.Save(Server.MapPath(file_path));
            Response.Redirect(file_path);
        } 
     
     
    Thank you very mutch for your help
     
    Nicolas
  •  03-15-2012, 7:34 AM 73462 in reply to 73460

    Re: HTML to PDF : background-color problem

    Hi nlj,
     
    I can not reproduce this issue on my end with your code. Can you create an example page which can reproduce this issue and post here? So we can check it for you.
     
    Can you post the screenshot to show the full error message? 
     
    Is your site online? If so, can you send me the editor test page url? So we can test on it too.
     
    Regards,
     
    Ken 
View as RSS news feed in XML
Powered by Community Server (Commercial Edition), by Telligent Systems