I am trying to figure out how to add String data to a document (without loading a document from the laptop harddrive). I need to set the SUBJECT line, the DATE line, and the AUTH line after setting the heading. Quite frankly I can not understand the transition from the sample java docs to an actual formatted document as attached. This is my first attempt at using the Spire.Doc jar.
public void CreateWORDDocument() throws IOException{
Date dt = new Date();
SimpleDateFormat df = new SimpleDateFormat( "ddMMyyyy");
date = df.format(dt);
filename = "C:\\Users\\wmelendez\\Documents\\NetBeansProjects\\PlumbPRO\\NewDOC";
String Line4 = "SUBJ: Report of Projects & Costs";
String Line2 = "DATE: '"+ date + "' ";
String Line3 ="AUTH: Brian Williams, brian.williams@realpage.com";
//Create word document.
Document document =new Document();
//Add a new section.
Section section = document.addSection();
//Add a section
//Add a new paragraph.
Paragraph paragraph = section.addParagraph();
//Append Text.
paragraph.appendText(jtxtarea_SUMMARY.getText());
//Save to file.
document.saveToFile(filename + "2 -"+ date + ".docx", FileFormat.Docx);