import
java.io.*;
import
org.apache.poi.xwpf.usermodel.*;
public
class
GFG {
public
static
void
main(String[] args)
throws
Exception
{
XWPFDocument document =
new
XWPFDocument();
String path = System.getProperty(
"user.dir"
);
path +=
"/BorderText.docx"
;
FileOutputStream out
=
new
FileOutputStream(
new
File(path));
XWPFParagraph paragraph
= document.createParagraph();
paragraph.setBorderBottom(Borders.DASHED);
paragraph.setBorderLeft(Borders.DASHED);
paragraph.setBorderRight(Borders.DASHED);
paragraph.setBorderTop(Borders.DASHED);
XWPFRun line = paragraph.createRun();
line.setText(
"Whether programming excites you or you feel stifled"
+
", wondering how to prepare for interview questions"
+
" or how to ace data structures and algorithms"
+
", GeeksforGeeks is a one-stop solution."
);
document.write(out);
out.close();
document.close();
System.out.println(
"Word Document with Border Text created successfully!"
);
}
}