You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by Ravi Jagannathan <ra...@gmail.com> on 2012/04/11 18:59:20 UTC

text to pdf conversion problem

Hi,
   I am a Java novice.
   I am using pdfbox to convert a text file to a pdf file.  I am
using the method "createPDFFromText".  I encountered two problems.
   One is the beginning space " " in the text was taken out and the
text file looks unreadable since the beginning space in the start of
the paragraph is gone.  Second is, for font size 10, if a line is too
long, the text does not wrap around.  It gets cut off.
    I traced the problem to the method createPDFFromText where the line
   "String[] lineWords = nextLine.trim().split( " " );"
could be responsible for the problem.

   Any ideas?
Appreciate the help,
thanks,
ravi.

Re: text to pdf conversion problem

Posted by Ravi Jagannathan <ra...@gmail.com>.
The below issue is in the class TextToPDF.java,
ravi.

On Wed, Apr 11, 2012 at 9:59 AM, Ravi Jagannathan <ra...@gmail.com> wrote:
> Hi,
>   I am a Java novice.
>   I am using pdfbox to convert a text file to a pdf file.  I am
> using the method "createPDFFromText".  I encountered two problems.
>   One is the beginning space " " in the text was taken out and the
> text file looks unreadable since the beginning space in the start of
> the paragraph is gone.  Second is, for font size 10, if a line is too
> long, the text does not wrap around.  It gets cut off.
>    I traced the problem to the method createPDFFromText where the line
>   "String[] lineWords = nextLine.trim().split( " " );"
> could be responsible for the problem.
>
>   Any ideas?
> Appreciate the help,
> thanks,
> ravi.