I am reading a file content and sending it to browser as content type "PDF",Data in the PDf not identifying line breaks.
I am using, Itext jar and formatting HTML using HTMLWorker.
Could any one help or any source code?
My Code so Far:
Document document = new Document(PageSize.LETTER);
response.setContentType("application/pdf");
try {
    PdfWriter.getInstance(document, response.getOutputStream());
    document.open();
    String cnt = SAMPLEJAVA.getFileContent("D:/abc.docx");
    System.out.println(cnt);
    HTMLWorker htmlWorker = new HTMLWorker(document);
    String str = "<html><body><pre>" + cnt + "</pre></body></html>";
    htmlWorker.parse(new StringReader(str));
    document.close();
    System.out.println("Done");
} catch(Exception ex)  {
}
 
    