PWAVEL Ответов: 0

Не для печати/сохранить страницу как PDF границы таблицы и цвет заголовка, используя необходимые предметы ASPXTOPDF управления


I am trying to print and also save the page as a pdf document. Everything on print and pdf looks fine except the table borders are missing for some tables. I am unable to understand why this is happening.
I am using the Essential Objects(third party) web control ASPXTOPDF in a User Control whose body i have to print as follows

<eo:ASPXToPDF runat="server" ID="ConvertPdf1" OnAfterRender="ConvertPdf1_AfterRender" />
<form>
page body to print</form>

Code behind:-

protected void ConvertPdf1_AfterRender(object sender, EventArgs e)
{
    if (printpdf)
    {
        pdfname= String.Format("Receipt.pdf_{1}", _order.OrdID);
        FolderTosave =ConfigurationManager.AppSettings["FolderTosave"].ToString();

        if (Directory.Exists(FolderTosave))
        {

            pdfname= Path.Combine(FolderTosave , pdfname);

            EO.Pdf.HtmlToPdfResult result = (EO.Pdf.HtmlToPdfResult)ConvertPdf1.Result;                

            result.PdfDocument.Save(pdfname);


        }
    }
}

Does ASPXTOPDF control provides us option to set styles for tables/divs before converting to pdf or print in BeforeRender or AfterRender events.

I am printing the page which contains my UserControl using window.print() Is there any code i am missing ? Or any option or EO control's event where i can set the table borders? I am trying to solve this from last three days. Googled the issue but dint get proper solution.

Any idea or suggestions?
Thanks in advance


Что я уже пробовал:

protected void ConvertPdf1_AfterRender(object sender, EventArgs e)
{
    if (printpdf)
    {
        pdfname= String.Format("Receipt.pdf_{1}", _order.OrdID);
        FolderTosave =ConfigurationManager.AppSettings["FolderTosave"].ToString();

        if (Directory.Exists(FolderTosave))
        {

            pdfname= Path.Combine(FolderTosave , pdfname);

            EO.Pdf.HtmlToPdfResult result = (EO.Pdf.HtmlToPdfResult)ConvertPdf1.Result;                

            result.PdfDocument.Save(pdfname);


        }
    }
}


 @media print {

table { border: 1px solid black; }

div { border: 1px solid black !important; }
}

0 Ответов