async void GraphicsPage_Loaded(object sender, RoutedEventArgs e)
 {
     progressRing.IsActive = true;
     CreateDocumentGraphics(word);
     WordUtils.SetDocumentInfo(word, Strings.GraphicsDocumentTitle);
     c1RichTextBox1.Document = new RtfFilter().ConvertToDocument(word.ToRtfText());
     progressRing.IsActive   = false;
 }
 async void TOCPage_Loaded(object sender, RoutedEventArgs e)
 {
     progressRing.IsActive = true;
     CreateDocumentTOC(_doc);
     WordUtils.SetDocumentInfo(_doc, Strings.TableOfContentsDocumentTitle);
     c1RichTextBox1.Document = new RtfFilter().ConvertToDocument(_doc.ToRtfText());
     progressRing.IsActive   = false;
 }
예제 #3
0
        private async void btnRender_Click(object sender, RoutedEventArgs e)
        {
            // document parameters
            _doc.Clear();
            progressRing.IsActive = true;
            _doc.Landscape        = true;
            var sz = _doc.PageSize;
            var rc = new Rect(0, 0, sz.Width - _doc.MainSection.LeftMargin - _doc.MainSection.RightMargin, sz.Height - _doc.MainSection.TopMargin - _doc.MainSection.BottomMargin);

            // draw every UI elements inside the panel in word document.
            await _doc.DrawElement(panel, rc);

            // save document
            WordUtils.SetDocumentInfo(_doc, Strings.RenderUIDocumentTitle);
            WordUtils.Save(_doc);
            progressRing.IsActive = false;
        }