Method Write
Namespace TallComponents.PDF.Layout
Class Document
Write PDF document to stream in Declarative mode.
It is the responsibility of the client (caller) to Flush and Close the .
Please check the tutorial on differences in the Push (normal) and Pull (low resource, event driven) mode generation. There are some features that change behavior when using Pull-mode.
The following snippets demonstrate how to create a simple PDF document and save it to a file using Declarative mode. C# // Create a document Document doc = new Document(); Section section = new Section(); doc.Sections.Add( section ); // Add some content TextParagraph text = new TextParagraph(); text.Fragments.Add( new Fragment( "Hello world!" ) ); section.Paragraphs.Add( text ); using( FileStream fs = new FileStream( "out.pdf", FileMode.Create, FileAccess.ReadWrite ) ) { // Write the document in Declarative mode doc.Write( fs ); } VB.NET ' Create a new document Dim doc As New Document Dim section As New Section doc.Sections.Add(section) ' Add some content Dim text As New TextParagraph text.Fragments.Add(New Fragment("Hello world!")) section.Paragraphs.Add(text) Dim fs As FileStream = Nothing Try fs = New FileStream("out.pdf", FileMode.Create, FileAccess.ReadWrite) ' Write in Declarative mode doc.Write(fs) Finally If Not fs Is Nothing Then fs.Close() End If End Try
Syntax
public
Void
Write(
Stream
stream
)
Returns
Void
Parameters
Stream
stream