Free Support Forum - aspose.com

Borders only visible with a zoom

Hello,

I was trying to add a bottom border to a cell which is not the last cell of my tab. And when the next row has no border I can’t see my border if I don’t zoom.
If I create a cell with a top border it’s ok, I think that maybe it’s
because the cell under my cell with bottom border has no border itself
that it doesn’t work.

I created this sample code for you to see the problem.

var doc = new Pdf();

var section = new Section();

//create table and lines
var t1 = new Table() { ColumnWidths = “260” };
var r1 = new Row(t1) { BackgroundColor = new Color(0, 0, 255) };
var c1 = new Cell(r1) ;
c1.Border = new BorderInfo(System.Convert.ToInt16(BorderSide.Bottom), 0.5f, new Color(255, 0, 0));
c1.Paragraphs.Add(new Text(“a red bottom border is applied on this cell -> you can’t see it if you don’t zoom”));
r1.Cells.Add(c1);
t1.Rows.Add(r1);

var r2 = new Row(t1) { BackgroundColor = new Color(0, 255, 0) }; ;
var c2 = new Cell(r2) ;
r2.Cells.Add(c2);
c2.Paragraphs.Add(new Text(“no borders applied on this cell”));
t1.Rows.Add(r2);

var r3 = new Row(t1) { BackgroundColor = new Color(0, 0, 255) }; ;
var c3 = new Cell(r3);
r3.Cells.Add(c3);
c3.Border = new BorderInfo(System.Convert.ToInt16(BorderSide.Top), 0.5f, new Color(255, 0, 0));
c3.Paragraphs.Add(new Text(“a red top border is applied on this cell -> you can see it”));
t1.Rows.Add(r3);

section.Paragraphs.Add(t1);
doc.Sections.Add(section);

const string file = @“D:/AsposeSampleBorder.pdf”;
doc.Save(file);


Thanks in advance for the help.


Hi Anouck,

I have managed to reproduce this issue and its been logged in our issue tracking system as PDFNEWNET-30747. We will further look into the details of this issue and will keep you updated on the status of correction. Please be patient and spare us little time. We apologize for this inconvenience.

Hi Anouck,


Thanks for your patience.

We have further investigated this issue and as per our observations, in order to resolve the above stated issue, please try using following code snippet.

[C#]

Document doc = new
Document();<o:p></o:p>

Page page = doc.Pages.Add();

//create table and lines

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

t1.ColumnWidths = "260";

Aspose.Pdf.Row r1 = new Aspose.Pdf.Row();

r1.BackgroundColor = System.Drawing.Color.Blue;

Aspose.Pdf.Cell c1 = new Aspose.Pdf.Cell();

c1.Border = new Aspose.Pdf.BorderInfo(Aspose.Pdf.BorderSide.Bottom, 0.5f, System.Drawing.Color.Red);

c1.Paragraphs.Add(new TextFragment("a red bottom border is applied on this cell -> you can't see it if you don't zoom"));

r1.Cells.Add(c1);

t1.Rows.Add(r1);

Aspose.Pdf.Row r2 = new Aspose.Pdf.Row();

r2.BackgroundColor = System.Drawing.Color.Green;

Aspose.Pdf.Cell c2 = new Aspose.Pdf.Cell();

r2.Cells.Add(c2);

c2.Paragraphs.Add(new TextFragment("no borders applied on this cell"));

t1.Rows.Add(r2);

Aspose.Pdf.Row r3 = new Aspose.Pdf.Row();

r3.BackgroundColor = System.Drawing.Color.Blue;

Aspose.Pdf.Cell c3 = new Aspose.Pdf.Cell();

r3.Cells.Add(c3);

c3.Border = new Aspose.Pdf.BorderInfo(Aspose.Pdf.BorderSide.Top, 0.5f, System.Drawing.Color.Red);

c3.Paragraphs.Add(new TextFragment("a red top border is applied on this cell -> you can see it"));

t1.Rows.Add(r3);

page.Paragraphs.Add(t1);

doc.Save(“c:/pdftest/Border_Cell_Issue.pdf”);

The issues you have found earlier (filed as PDFNEWNET-30747) have been fixed in Aspose.Pdf for .NET 7.8.0update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.