How do I output text on separate lines?

Q: let's say I want to add:


In each page, like it shows, "Hello" in one line and "world" in the
next one. Right now PDFNet puts everything in the same line. What do I
need to do to put words line by line?
A: You would need to create and write two text 'elements' (one for
each line). For example:

ElementBuilder eb = new ElementBuilder();
ElementWriter writer = new ElementWriter();

Page page = doc.PageCreate();
writer.Begin(page); // begin writing to this page

// Begin writing a block of text
Element element = builder.CreateTextBegin(Font.Create(doc,
Font.StandardType1Font.e_times_roman), 12);

element = eb.CreateTextRun("Hello");
element.SetTextMatrix(10, 0, 0, 10, 0, 600);
element.GetGState().SetLeading(15); // Set the spacing between lines

writer.WriteElement(eb.CreateTextNewLine()); // New line

element = eb.CreateTextRun("World");

writer.WriteElement(eb.CreateTextNewLine()); // New line

// Finish the block of text

writer.End(); // save changes to the current page

// ? doc.PagePushBack(page);