Hi, Need help regarding UI of aspose.pdf

Last post 01-04-2012, 5:50 AM by Snow_White. 4 replies.
Sort Posts: Previous Next
  •  12-28-2011, 6:09 AM 351900

    Hi, Need help regarding UI of aspose.pdf .NET

    I have created a table with following code

    Aspose.Pdf.Table tblMainHeader = new Aspose.Pdf.Table();

    tblMainHeader.IsFitToPage = true;

    tblMainHeader.ColumnWidths = ("550");

    Aspose.Pdf.Row rDoc = tblMainHeader.Rows.Add();

    rDoc.DefaultCellTextInfo.BackgroundColor = new Aspose.Pdf.Color("Green");

    rDoc.DefaultCellTextInfo.Color = new Aspose.Pdf.Color("White");

    Aspose.Pdf.Cell clblDocHeader = rDoc.Cells.Add("Documents");

    clblDocHeader.DefaultCellTextInfo.FontSize = 12;

    Aspose.Pdf.Table tblDocData = new Aspose.Pdf.Table();

    tblDocData.IsBroken = false;

    tblDocData.IsFitToPage = true;

    tblDocData.DefaultCellBorder = new Aspose.Pdf.BorderInfo((int)Aspose.Pdf.BorderSide.All, 0.1F);

    tblDocData.ColumnWidths = ("90 250 40 80 90");

    DataTable dtDocuments = RiskMaintBL.GetDocumentsPDF(Request["RiskId"]);

    Aspose.Pdf.Row rDocHeader = tblDocData.Rows.Add();

    rDocHeader.DefaultCellTextInfo.BackgroundColor = new Aspose.Pdf.Color("#99CC00");

    rDocHeader.DefaultCellTextInfo.Color = new Aspose.Pdf.Color("White");

    Aspose.Pdf.Cell c1header = rDocHeader.Cells.Add("Status");

    Aspose.Pdf.Cell c2header = rDocHeader.Cells.Add("Document Name");

    Aspose.Pdf.Cell c3header = rDocHeader.Cells.Add("Control Name");

    Aspose.Pdf.Cell c4header = rDocHeader.Cells.Add("Added By");

    Aspose.Pdf.Cell c5header = rDocHeader.Cells.Add("Added On");

    rDocHeader.DefaultCellTextInfo.FontSize = 8;

    rDocHeader.DefaultCellTextInfo.IsTrueTypeFontBold = true;

    int i;

    for (i = 0; i <= dtDocuments.Rows.Count - 1; i++)

    {

    Aspose.Pdf.Row r11 = tblDocData.Rows.Add();

    r11.DefaultCellTextInfo.FontSize = 8;

    r11.DefaultRowCellPadding = new MarginInfo();

    r11.DefaultRowCellPadding.Left = 2F;

    r11.DefaultRowCellPadding.Right = 2F;

    r11.DefaultRowCellPadding.Top = 2F;

    r11.DefaultRowCellPadding.Bottom = 2F;

    int j;

    for (j = 0; j <= dtDocuments.Columns.Count - 1; j++)

    {

    Aspose.Pdf.Cell clbl = r11.Cells.Add((dtDocuments.Rows[i][j]).ToString());

    }

    }

    sec1.Paragraphs.Add(tblMainHeader);

    sec1.Paragraphs.Add(tblDocData);

    If you notice PDF output, the third column header text is wrapped, and color is also coming in both rows, but for others, the background color is not coming in both rows.

    Also, we can see a small white line between the border line and the color of table header text. How can that be fixed?

     

    Filed under: .net3.5;aspose.pdf
     
  •  12-28-2011, 7:37 PM 351985 in reply to 351900

    Re: Hi, Need help regarding UI of aspose.pdf

    Hi,

    It seems, your problem is related to Aspose.Pdf and not Aspose.Cells.

    So, I am moving your thread to appropriate forum. Aspose.Pdf support team will help you asap.

    Many Thanks and Kind Regards,

    Shakeel Faiz
    Support Developer
    Aspose Sialkot Team
    Contact Us
    Aspose - The .NET and Java Component Publisher

    Keep in touch! We're on Twitter and Facebook
     
  •  12-29-2011, 4:39 AM 352050 in reply to 351985

    Re: Hi, Need help regarding UI of aspose.pdf

    Thanks.
     
  •  01-02-2012, 2:44 AM 352423 in reply to 352050

    Re: Hi, Need help regarding UI of aspose.pdf

    Hi,

    Thank you for sharing the template file.

    I am able to reproduce your mentioned issue regarding wrapping after an initial test using the latest version of Aspose.Pdf for .NET v6.5. The issue has been registered in our issue tracking system with issue id: PDFNEWNET-33104 for rectification. However, I think you can resolve this issue by managing the column widths of the columns and avoiding the text wrapping. Also, I am unable to reproduce your other issue regarding “Small White Line” with the latest version of Aspose.Pdf for .NET. As you are using an older version of Aspose.Pdf for .NET, I would suggest you to download and try the latest version and if you still face any issue, please share your generated PDF file with us to show the issue.

    Sorry for the inconvenience,


    Nausherwan Aslam
    Support Developer,
    Aspose Sialkot Team
    Contact Us
     
  •  01-04-2012, 5:50 AM 352964 in reply to 352423

    Re: Hi, Need help regarding UI of aspose.pdf

    Thanks Aslam.

    I cannot change the column width, as there are many other columns in the table. This column will look huge and others squeezed. It shall be really helpful if you can provide me a fix for this.

    Thanks.

     
View as RSS news feed in XML