PdfSharp.Xps.Rendering.PdfContentWriter.WriteElements C# (CSharp) Méthode

WriteElements() public méthode

Writes all elements of the collection to the content stream.
public WriteElements ( XpsElementCollection elements ) : void
elements XpsElementCollection
Résultat void
    public void WriteElements(XpsElementCollection elements)
    {
      //elements.ForEach(new Action<XpsElement>(writee));
      foreach (XpsElement element in elements)
        WriteElement(element);
    }

Usage Example

Exemple #1
0
        internal void RenderPage(PdfPage page, FixedPage fixedPage)
        {
            this.page = page;

            context = new DocumentRenderingContext(page.Owner);

            //this.page.Width = fixedPage.Width;
            //this.page.Height = fixedPage.Height;

            //this.gsStack = new GraphicsStateStack(this);
            PdfContent content = null;

            //switch (options)
            //{
            //  case XGraphicsPdfPageOptions.Replace:
            //    page.Contents.Elements.Clear();
            //    goto case XGraphicsPdfPageOptions.Append;

            //  case XGraphicsPdfPageOptions.Prepend:
            //    content = page.Contents.PrependContent();
            //    break;

            //  case XGraphicsPdfPageOptions.Append:
            content = page.Contents.AppendContent();
            //    break;
            //}
            page.RenderContent = content;

            writer = new PdfContentWriter(context, this.page);

            //Initialize();

            writer.BeginContent(false);
            writer.WriteElements(fixedPage.Content);
            writer.EndContent();
        }