title: How to apply new line in docx file generation using DOCX4J
body: <p>By the tutorials that I have seen. I learned how to add text on generating a docx file. but then Every time I add a line of text. I noticed that there is always a space between the first line of text and the second line of text. just like hitting the enter key twice. I know that the main cause is that everytime I add a line of text, I use a paragraph. and a paragraph starts with a space after another paragraph.</p>
  
  <p>This is how I add a text </p>
  
  <pre><code>ObjectFactory factory;
  factory = Context.getWmlObjectFactory();
  WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.createPackage();
  P spc = factory.createP();
  R rspc = factory.createR();
  rspc.getContent().add(wordMLPackage.getMainDocumentPart().createParagraphOfText("sample"));
  spc.getContent().add(rspc);
  
  java.io.InputStream is = new java.io.FileInputStream(file);
  wordMLPackage.getMainDocumentPart().addObject(spc);
  </code></pre>
  
  <p>so this code successfully runs and produces the right output. but when i add another paragraph. or text. i want it to be just under the first line of text. is there any way that i can add a simple line of text without using a paragraph? thanks in advance</p>
  
  <p>EDIT: I've also tried adding a simple org.docx4j.wml.Text like this </p>
  
  <pre><code>Text newtext = factory.createText();
  newtext.setValue("sample new text");
  wordMLPackage.getMainDocumentPart().addObject(newtext);
  </code></pre>
  
  <p>the program will run but when i open the generated docx file, it will just prompt a message saying that there are problem with the contents. </p>