本文整理汇总了C#中Block.InsertLineBreak方法的典型用法代码示例。如果您正苦于以下问题:C# Block.InsertLineBreak方法的具体用法?C# Block.InsertLineBreak怎么用?C# Block.InsertLineBreak使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Block
的用法示例。
在下文中一共展示了Block.InsertLineBreak方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Render
internal override bool Render(UIElement element, PdfRenderContext context)
{
TextBlock textBlock = element as TextBlock;
if (textBlock == null)
{
return false;
}
if (!string.IsNullOrEmpty(textBlock.Text))
{
using (context.drawingSurface.SaveProperties())
{
SetFill(context, textBlock.Foreground, textBlock.ActualWidth, textBlock.ActualHeight);
SetFontFamily(context.drawingSurface, textBlock.FontFamily);
context.drawingSurface.TextProperties.FontSize = textBlock.FontSize;
Block block = new Block();
block.TextProperties.CopyFrom(context.drawingSurface.TextProperties);
block.GraphicProperties.CopyFrom(context.drawingSurface.GraphicProperties);
string[] textLines = textBlock.Text.Split(new string[] { "\r\n", "\r", "\n" }, StringSplitOptions.None);
foreach (string textLine in textLines)
{
block.InsertText(textLine);
block.InsertLineBreak();
}
context.drawingSurface.DrawBlock(block);
}
}
return true;
}
示例2: DrawDescription
private void DrawDescription(double maxWidth)
{
Block block = new Block();
this.SetTextProperties(block, new RgbColor(155, 199, 5), 18, new FontFamily("Segoe UI"));
block.InsertText("Thank you for choosing Telerik RadPdfProcessing!");
editor.DrawBlock(block, new Size(maxWidth, double.PositiveInfinity));
block = new Block();
this.SetTextProperties(block, RgbColors.Black, 25, new FontFamily("Segoe UI"));
block.InsertLineBreak();
this.SetTextProperties(block, RgbColors.Black, 11, new FontFamily("Segoe UI"), true);
block.InsertText("RadPdfProcessing");
this.SetTextProperties(block, RgbColors.Black, 11, new FontFamily("Segoe UI"));
block.InsertText(" is a document processing library that enables your application to import and export files to and from PDF format. The document model is entirely independent from UI and allows you to generate sleek documents with differently formatted text, images, shapes and more.");
editor.DrawBlock(block, new Size(maxWidth, double.PositiveInfinity));
double currentTopOffset = 480;
editor.Position.Translate(ExampleDocumentSizes.DefaultLeftIndent, currentTopOffset);
block = new Block();
this.SetTextProperties(block, RgbColors.Black, 25, new FontFamily("Segoe UI"), true);
block.InsertLineBreak();
this.SetTextProperties(block, RgbColors.Black, 13, new FontFamily("Times New Roman"), true);
block.InsertText("RadPdfProcessing");
this.SetTextProperties(block, RgbColors.Black, 13, new FontFamily("Times New Roman"));
block.InsertText(" was built with performance and stability in mind. The document automation is fast and has a low memory footprint even with large amounts of data.");
editor.DrawBlock(block, new Size(maxWidth, double.PositiveInfinity));
currentTopOffset += ExampleDocumentSizes.DefaultLineHeight * 3;
editor.Position.Translate(ExampleDocumentSizes.DefaultLeftIndent, currentTopOffset);
block = new Block();
this.SetTextProperties(block, RgbColors.Black, 25, new FontFamily("Miriad pro"));
block.InsertLineBreak();
this.SetTextProperties(block, RgbColors.Black, 11, new FontFamily("Miriad pro"), false, true);
block.InsertText("The intuitive API allows you to swiftly generate documents from scratch. Designed with the user in mind, RadPdfProcessing is straightforward and easy to use.");
editor.DrawBlock(block, new Size(maxWidth, double.PositiveInfinity));
block = new Block();
this.SetTextProperties(block, new RgbColor(45, 178, 0), 35, new FontFamily("Segoe Print"));
block.InsertLineBreak();
this.SetTextProperties(block, new RgbColor(45, 178, 0), 12, new FontFamily("Segoe Print"));
block.InsertText("September, 2014");
block.InsertLineBreak();
block.InsertText("by XAML Team");
currentTopOffset += ExampleDocumentSizes.DefaultLineHeight * 2;
editor.DrawBlock(block, new Size(maxWidth, double.PositiveInfinity));
DrawLogo();
}