The code block annotation is internally placed inside a table
, which has the black table border. So in order to remove this border, we should get the parent table of our code block and set its Borders to empty borders:
// find the annotation start of the first code block.
CodeAnnotationRangeStart codeRangeStart =
Table table = codeRangeStart.GetParentOfType<Table>();
Code blocks stretch by default to 100% of the width of the section they are placed in. If you are working in Paged layout mode
and you wish to change the PageMargin
of the sections you could use the ChangeSectionActualPageMargin method:
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin
, a suite of polished and feature-rich components for the Xamarin framework, which allow
you to write beautiful native mobile apps using a single shared C# codebase.