Introduction
You can create cool visual
effects using the flow layout API provided by Apitron PDF Kit. One of such
effects is the support border-radius property offered by content elements. This
property can be used to create round-rect borders for text, images and even
annotation objects.
Code sample
static void Main(string[] args)
{
// create
document and its resource manager
ResourceManager manager = new ResourceManager();
FlowDocument doc = new FlowDocument(){Margin = new Thickness(10)};
// add
new text block with roudn-rect border
doc.Add(new TextBlock("The text with round-rect
border")
{
BorderRadius = 5,
Border = new Border(10),
BorderColor = RgbColors.Red,
Padding = new Thickness(5)
});
// save
file
using (Stream stream = File.Create("round-rect.pdf"))
{
doc.Write(stream, manager);
}
}
Resulting image is shown below:
Pic. 1
Text block with round-rect border
|
Conclusion
Flow layout API offered by the Apitron PDF Kit .NET
component can be used to quickly design and generate PDF documents in a way
similar to HTML/CSS approach. It works on multiple platforms including Windows
Phone, Xamarin, MONO. Create mobile, web and desktop PDF processing apps using
this new generation of PDF creation tools.
Downloadable version of this article can be found by the following link [PDF].
Downloadable version of this article can be found by the following link [PDF].
No comments:
Post a Comment