private void CreateSignature(RadFlowDocumentEditor editor)
        {
            Table signatureTable = editor.InsertTable(1, 2);
            signatureTable.Rows[0].Cells[0].Borders = new TableCellBorders(
                new Border(BorderStyle.None),
                new Border(BorderStyle.None),
                new Border(4, BorderStyle.Single, GreenColor),
                new Border(BorderStyle.None));

            // Create paragraph with image
            signatureTable.Rows[0].Cells[0].PreferredWidth = new TableWidthUnit(140);
            Paragraph paragraphWithImage = signatureTable.Rows[0].Cells[0].Blocks.AddParagraph();
            paragraphWithImage.Spacing.SpacingAfter = 0;
            editor.MoveToParagraphStart(paragraphWithImage);
            using (Stream stream = FileHelper.GetSampleResourceStream("TelerikLogoSmall.png"))
            {
                editor.InsertImageInline(stream, "png", new Size(118, 42));
            }

            // Create cell with name and position
            signatureTable.Rows[0].Cells[1].PreferredWidth = new TableWidthUnit(140);
            signatureTable.Rows[0].Cells[1].Padding = new Documents.Primitives.Padding(12, 0, 0, 0);
            Paragraph cellParagraph = signatureTable.Rows[0].Cells[1].Blocks.AddParagraph();
            cellParagraph.Spacing.SpacingAfter = 0;
            editor.MoveToParagraphStart(cellParagraph);
            editor.CharacterFormatting.FontSize.LocalValue = 12;

            editor.InsertText("Jane Doe").FontWeight = FontWeights.Bold;
            editor.InsertParagraph().Spacing.SpacingAfter = 0;
            editor.InsertText("Support Officer");
        }
Пример #2
0
        private RadFlowDocument CreateDocument()
        {
            RadFlowDocument       document = new RadFlowDocument();
            RadFlowDocumentEditor editor   = new RadFlowDocumentEditor(document);

            editor.ParagraphFormatting.TextAlignment.LocalValue = Alignment.Justified;

            Table bodyTable = editor.InsertTable(1, 2);

            Paragraph paragraphWithText = bodyTable.Rows[0].Cells[0].Blocks.AddParagraph();

            editor.MoveToParagraphStart(paragraphWithText);

            editor.InsertLine("Dear Telerik User,");
            editor.InsertLine("We're happy to introduce the Telerik RadWordsProcessing component. High performance library that enables you to read, write and manipulate documents in DOCX, RTF, HTML and plain text format.");

            editor.InsertText("The current beta version comes with full rich-text capabilities including ");
            editor.InsertText("bold, ").FontWeight  = FontWeights.Bold;
            editor.InsertText("italic, ").FontStyle = FontStyles.Italic;
            Run underlined = editor.InsertText("underline,");

            underlined.Underline.Pattern = UnderlinePattern.Dotted;
            underlined.Underline.Color   = new ThemableColor(Colors.Black);
            editor.InsertText(" font sizes and ").FontSize = 20;
            editor.InsertText("colors ").ForegroundColor   = GreenColor;
            editor.InsertLine("as well as text alignment and indentation. Other options include tables, lists, hyperlinks, bookmarks and comments, inline and floating images. Even more sweetness is added by the built-in styles and themes.");

            editor.InsertLine("We hope you'll enjoy RadWordsProcessing as much as we do. Happy coding!");

            editor.InsertParagraph().Spacing.SpacingAfter = 0;
            editor.InsertLine("Regards,");
            editor.InsertHyperlink("Telerik Team ", "http://www.telerik.com", false, "Telerik Site");

            Paragraph paragraphWithImage = bodyTable.Rows[0].Cells[1].Blocks.AddParagraph();

            editor.MoveToParagraphStart(paragraphWithImage);

#if NETCOREAPP
            using (Stream stream = File.OpenRead(SampleDataFolder + "WordsProcessing.jpg"))
            {
                editor.InsertImageInline(stream, "jpg", new Size(470, 261));
            }
#else
            using (Stream stream = File.OpenRead(SampleDataFolder + "WordsProcessing.png"))
            {
                editor.InsertImageInline(stream, "png", new Size(470, 261));
            }
#endif

            return(document);
        }
        private void CreateSignature(RadFlowDocumentEditor editor)
        {
            Table signatureTable = editor.InsertTable(1, 2);

            signatureTable.Rows[0].Cells[0].Borders = new TableCellBorders(
                new Border(BorderStyle.None),
                new Border(BorderStyle.None),
                new Border(4, BorderStyle.Single, greenColor),
                new Border(BorderStyle.None));

            // Create paragraph with image
            signatureTable.Rows[0].Cells[0].PreferredWidth = new TableWidthUnit(140);
            Paragraph paragraphWithImage = signatureTable.Rows[0].Cells[0].Blocks.AddParagraph();

            paragraphWithImage.Spacing.SpacingAfter = 0;
            editor.MoveToParagraphStart(paragraphWithImage);

            using (Stream stream = File.OpenRead(this.sampleDataFolder + "Telerik_logo.png"))
            {
                editor.InsertImageInline(stream, "png", new Size(118, 28));
            }

            // Create cell with name and position
            signatureTable.Rows[0].Cells[1].Padding = new Telerik.Windows.Documents.Primitives.Padding(12, 0, 0, 0);
            Paragraph cellParagraph = signatureTable.Rows[0].Cells[1].Blocks.AddParagraph();

            cellParagraph.Spacing.SpacingAfter = 0;
            editor.MoveToParagraphStart(cellParagraph);
            editor.CharacterFormatting.FontSize.LocalValue = 12;

            editor.InsertText("Jane Doe").FontWeight = FontWeights.Bold;
            editor.InsertParagraph().Spacing.SpacingAfter = 0;
            editor.InsertText("Support Officer");
        }
        private void CreateHeader(RadFlowDocumentEditor editor)
        {
            Header header = editor.Document.Sections.First().Headers.Add();

            editor.MoveToParagraphStart(header.Blocks.AddParagraph());

#if NETCOREAPP
            using (Stream stream = File.OpenRead(this.sampleDataFolder + "Telerik_develop_experiences.jpg"))
            {
                editor.InsertImageInline(stream, "jpg", new Size(660, 237));
            }
#else
            using (Stream stream = File.OpenRead(this.sampleDataFolder + "Telerik_develop_experiences.png"))
            {
                editor.InsertImageInline(stream, "png", new Size(660, 237));
            }
#endif
        }
Пример #5
0
 private void InsertImage(RadFlowDocumentEditor editor)
 {
     #region radwordsprocessing-editing-radflowdocumenteditor_9
     editor.InsertText("Image:");
     using (Stream stream = this.GetResourceStream("Telerik_logo.png"))
     {
         editor.InsertImageInline(stream, "png", new Size(118, 28));
     }
     #endregion
 }
Пример #6
0
        private void InsertImageWithRadFlowDocument(RadFlowDocument document)
        {
            #region radwordsprocessing-model-imageinline_3
            RadFlowDocumentEditor editor = new RadFlowDocumentEditor(document);

            using (Stream stream = this.GetResourceStream("Telerik_logo.png"))
            {
                editor.InsertImageInline(stream, "png", new Size(118, 28));
            }
            #endregion
        }
Пример #7
0
 private void CreateHeader(RadFlowDocumentEditor editor)
 {
     if (this.IncludeHeader)
     {
         Header header = editor.Document.Sections.First().Headers.Add();
         editor.MoveToParagraphStart(header.Blocks.AddParagraph());
         using (Stream stream = FileHelper.GetSampleResourceStream("Telerik_develop_experiences.png"))
         {
             editor.InsertImageInline(stream, "png", new Size(660, 237));
         }
     }
 }
        private void CreateHeader(RadFlowDocumentEditor editor)
        {
            if (this.IncludeHeader)
            {
                Header header = editor.Document.Sections.First().Headers.Add();

                editor.MoveToParagraphStart(header.Blocks.AddParagraph());

                using (Stream stream = this.resourceService.GetResourceStream("telerikLogo.jpg"))
                {
                    editor.InsertImageInline(stream, "png", new Telerik.Documents.Primitives.Size(660, 265));
                }
            }
        }
        private void CreateSignature(RadFlowDocumentEditor editor)
        {
            Table signatureTable = editor.InsertTable(1, 2);

            signatureTable.Rows[0].Cells[0].Borders = new TableCellBorders(
                new Border(BorderStyle.None),
                new Border(BorderStyle.None),
                new Border(4, BorderStyle.Single, GreenColor),
                new Border(BorderStyle.None));

            signatureTable.Rows[0].Cells[0].PreferredWidth = new TableWidthUnit(140);

            Paragraph paragraphWithImage = signatureTable.Rows[0].Cells[0].Blocks.AddParagraph();

            paragraphWithImage.Spacing.SpacingAfter = 0;

            editor.MoveToParagraphStart(paragraphWithImage);

            using (Stream stream = this.resourceService.GetResourceStream("telerikLogo.jpg"))
            {
                editor.InsertImageInline(stream, "png", new Telerik.Documents.Primitives.Size(93, 42));
            }

            signatureTable.Rows[0].Cells[1].PreferredWidth = new TableWidthUnit(140);
            signatureTable.Rows[0].Cells[1].Padding        = new Padding(12, 0, 0, 0);

            Paragraph cellParagraph = signatureTable.Rows[0].Cells[1].Blocks.AddParagraph();

            cellParagraph.Spacing.SpacingAfter = 0;

            editor.MoveToParagraphStart(cellParagraph);
            editor.CharacterFormatting.FontSize.LocalValue = 12;
            editor.InsertText("Jane Doe").FontWeight       = FontWeights.Bold;
            editor.InsertParagraph().Spacing.SpacingAfter = 0;
            editor.InsertText("Support Officer");
        }
 private void CreateHeader(RadFlowDocumentEditor editor)
 {
     if (this.IncludeHeader)
     {
         Header header = editor.Document.Sections.First().Headers.Add();
         editor.MoveToParagraphStart(header.Blocks.AddParagraph());
         using (Stream stream = FileHelper.GetSampleResourceStream("TelerikLogo.png"))
         {
             editor.InsertImageInline(stream, "png", new Size(660, 265));
         }
     }
 }
Пример #11
0
        private RadFlowDocument CreateDocument()
        {
            RadFlowDocument document = new RadFlowDocument();
            RadFlowDocumentEditor editor = new RadFlowDocumentEditor(document);
            editor.ParagraphFormatting.TextAlignment.LocalValue = Alignment.Justified;

            Table bodyTable = editor.InsertTable(1, 2);

            Paragraph paragraphWithText = bodyTable.Rows[0].Cells[0].Blocks.AddParagraph();
            editor.MoveToParagraphStart(paragraphWithText);

            editor.InsertLine("Dear Telerik User,");
            editor.InsertLine("We're happy to introduce the new Telerik RadWordsProcessing component for WPF. High performance library that enables you to read, write and manipulate documents in DOCX, RTF, HTML and plain text format.");

            editor.InsertText("The current beta version comes with full rich-text capabilities including ");
            editor.InsertText("bold, ").FontWeight = FontWeights.Bold;
            editor.InsertText("italic, ").FontStyle = FontStyles.Italic;
            Run underlined = editor.InsertText("underline,");
            underlined.Underline.Pattern = UnderlinePattern.Dotted;
            underlined.Underline.Color = new ThemableColor(Colors.Black);
            editor.InsertText(" font sizes and ").FontSize = 20;
            editor.InsertText("colors ").ForegroundColor = GreenColor;
            editor.InsertLine("as well as text alignment and indentation. Other options include tables, lists, hyperlinks, bookmarks and comments, inline and floating images. Even more sweetness is added by the built-in styles and themes.");

            editor.InsertLine("We hope you'll enjoy RadWordsProcessing as much as we do. Happy coding!");

            editor.InsertParagraph().Spacing.SpacingAfter = 0;
            editor.InsertLine("Regards,");
            editor.InsertHyperlink("Telerik Team ", "http://www.telerik.com", false, "Telerik Site");

            Paragraph paragraphWithImage = bodyTable.Rows[0].Cells[1].Blocks.AddParagraph();
            editor.MoveToParagraphStart(paragraphWithImage);

            using (Stream stream = FileHelper.GetSampleResourceStream("WordsProcessing.png"))
            {
                editor.InsertImageInline(stream, "png", new Size(470, 261));
            }

            return document;
        }