I have a foot border defined with its Thickness as (1,0,1,1) and CornerRadius as (0,0,4,4). The border on PDF always shows the top with very thin line until I set the CornerRadius as (0,0,0,0) or zoom in the PDF file into 800%. Following are the code
Code:
Border footBorder = new Border() {
BorderBrush = Brushes.Green,
BorderThickness = new Thickness(1, 0, 1, 1),// not border on the top
Margin = new Thickness(2,0,2,0),
//SnapsToDevicePixels = true,
UseLayoutRounding = true,
Height = 4,
CornerRadius = new CornerRadius(0, 0, 4, 4)// corner radius only applied to leftbottom and rightbottom
};
if (!string.IsNullOrWhiteSpace(footerNote))
{
TextBlock tbFooter = new TextBlock() {
Text = footerNote,
FontSize = 12,
//Margin = new Thickness(5)
};
footBorder.Child = tbFooter;
footBorder.BorderThickness = new Thickness(1, 1, 1, 1); // border on the top
}
else
{
footBorder.Child = new TextBlock() {
Text = " ",
HorizontalAlignment = HorizontalAlignment.Stretch,
Margin = new Thickness(0), /*Padding = new Thickness(0), Background = Brushes.Gray,*/ //SnapsToDevicePixels = true,
UseLayoutRounding = true,
Height = 4
};
//footBorder.BorderThickness = new Thickness(1, 0, 1, 1); // not border on the top
}
BlockUIContainer footContainer = new BlockUIContainer(footBorder);
section.Blocks.Add(footContainer);
Here is what the foot border looks like in the saved PDF file:
Attachment:
File comment: The foot border in PDF file now
FootBorder.jpg [ 8.04 KiB | Viewed 5619 times ]
. There should not have the light green top line.
Is there any bug in PDFSharp to render the border with CornerRadius set to non-zero?
Thanks!