title: write string to pdf file
body: <p>I need to write a String object "plain text" to a pdf file from a java program, does java or spring have any built-in libraries that can do the job.if not what are the best choice external libraries?<br>
  I know I can use <code>FileOutputStream</code> to write data to a file but is there any option that can format the data in pdf and write it to the file, like <code>.setContentType("application/pdf")</code> of the <code>HttpServletResponse</code><br>
   thanks in advance </p>