PDFRasterizer.NET 4.0 is now available. Supports .NET Core. Renders pixel-perfectly.

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


public Void Write(XmlReader readerStream stream)




XmlReader reader
XML specification of the document content.

Stream stream
Write to this stream.
Download TallPDF.NET 4.0
We will send you a download link

  • This field is for validation purposes and should be left unchanged.
Why do we ask your email address?
We send tips that speed up your evaluation
We let you know about bug fixes
You can always unsubscribe with one click
We never share your address with a 3rd party
Thank you for your download

We have sent an email with a download link.