Dynamically generating PDF in memory.

Q: I want to create a new PDF file all from ram and web service calls
for data.

Everything seems to work but I only get one line of text and it is on
bottom of first page?

Easy to start with :

PDFDoc new_doc = new PDFDoc(); //Empty doc for all pages to get added
string[] pageText = { "John", "Doe", "10 00256" };

// Generate first page in PDF with Text
new_doc = buildPDF.genFirstPagePDF(new_doc, pageText);

public static PDFDoc genFirstPagePDF(PDFDoc baseDocument, string[]
            ElementWriter writer = new ElementWriter();
            ElementReader reader = new ElementReader();
            Element element;

            Page page = baseDocument.PageCreate(); // Add a blank
            ElementBuilder eb = new ElementBuilder();

              element = eb.CreateTextRun("Name:"+pageText[1]+",
              element.SetTextMatrix(1, 0, 0, 1, 80, 10);
            element = eb.CreateTextRun(" Booking Number :" +
pageText[2] + " ");
            element.SetTextMatrix(1, 0, 0, 1, 90, 20);

           return baseDocument;

So how to I center this matrix on the first page, and get multiple
A: You can generate a PDF from scratch using ElementBuilder &
ElementWriter however these are a bit low-level classes and they do
not offer built-in support for line wrapping, content reflow etc.
Before getting into nitty-gritty of PDF generation using
ElementBuilder & ElementWriter you may want to consider using WPF
FlowDocument (http://msdn.microsoft.com/en-us/library/aa970909.aspx)
or XAML for dynamic PDF generation. As a starting point you may want
to take a look at Xaml2PDF sample project: