Source/NFX/Media/PDF/PdfWriter.cs
/// <summary>
/// Writes PDF document into file stream
/// </summary>
/// <param name="document">PDF document</param>
Writes PDF document into file stream
Writes PDF document into file stream
public void Write(PdfDocument document)
    {
      Write(document.Meta);
      document.Trailer.AddObjectOffset(m_Stream.Position);
      Write(document.Root);
      document.Trailer.AddObjectOffset(m_Stream.Position);
      Write(document.Info);
      document.Trailer.AddObjectOffset(m_Stream.Position);
      Write(document.Outlines);
      foreach (var font in document.Fonts)
      {
        document.Trailer.AddObjectOffset(m_Stream.Position);
        Write(font);
      }
      document.Trailer.AddObjectOffset(m_Stream.Position);
      Write(document.PageTree);
      foreach (var page in document.Pages)
      {
        document.Trailer.AddObjectOffset(m_Stream.Position);
        Write(page);
        foreach (var element in page.Elements)
        {
          document.Trailer.AddObjectOffset(m_Stream.Position);
          element.Write(this);
          var image = element as ImageElement;
          if (image != null)
          {
            document.Trailer.AddObjectOffset(m_Stream.Position);
            WriteXObject(image);
          }
        }
      }
      document.Trailer.XRefOffset = m_Stream.Position;
      Write(document.Trailer);
    }
public void Write ( PdfDocument document ) { Write ( document . Meta ) ; document . Trailer . AddObjectOffset ( m_Stream . Position ) ; Write ( document . Root ) ; document . Trailer . AddObjectOffset ( m_Stream . Position ) ; Write ( document . Info ) ; document . Trailer . AddObjectOffset ( m_Stream . Position ) ; Write ( document . Outlines ) ; foreach ( var font in document . Fonts ) { document . Trailer . AddObjectOffset ( m_Stream . Position ) ; Write ( font ) ; } document . Trailer . AddObjectOffset ( m_Stream . Position ) ; Write ( document . PageTree ) ; foreach ( var page in document . Pages ) { document . Trailer . AddObjectOffset ( m_Stream . Position ) ; Write ( page ) ; foreach ( var element in page . Elements ) { document . Trailer . AddObjectOffset ( m_Stream . Position ) ; element . Write ( this ) ; var image = element as ImageElement ; if ( image != null ) { document . Trailer . AddObjectOffset ( m_Stream . Position ) ; WriteXObject ( image ) ; } } } document . Trailer . XRefOffset = m_Stream . Position ; Write ( document . Trailer ) ; }
Writes PDF document into file stream
Writes PDF document into file stream
// document meta data // header object // info object // outlines object // fonts // page tree // pages // elements // all // images // trailer
document
PdfDocument
None