Method Write

Namespace TallComponents.PDF.Layout
Class Document

Write document in Event-Driven mode to a stream. The document is read from an XML reader.

It is the responsibility of the client (caller) to Flush and Close the .

Please check the turorial 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.

XML (layout.xml) <?xml version="1.0" encoding="utf-8" ?> <document> <section> <paragraph type="TextParagraph"> <fragment>Hello world from XML!</fragment> </paragraph> </section> </document> C# Document doc = new Document(); using( FileStream fs = new FileStream( "out.pdf", FileMode.Create, FileAccess.ReadWrite ) ) { try { XmlTextReader reader = new XmlTextReader( @"layout.xml" ); doc.Write( reader, fs ); } catch( Exception ex ) { System.Console.WriteLine( "Error: {0}", ex.Message ); } } VB.NET ' Create a new document Dim doc As New Document Dim fs As FileStream = Nothing Try Dim reader As New Xml.XmlTextReader("layout.xml") fs = New FileStream("out.pdf", FileMode.Create, FileAccess.ReadWrite) ' Write from XML in Event-Driven mode doc.Write(reader, fs) Catch ex As Exception System.Console.WriteLine( "Error: {0}", ex.Message ) Finally If Not fs Is Nothing Then fs.Close() End If End Try

Syntax

public  Void  Write( XmlReader  reader Stream  stream )

Returns

Void

Parameters


XmlReader reader
XML specification of the document content.

Stream stream
Write to this stream.