Tim Juntunen wrote:
I tried to substitute the iText 2.0.8 library in place of 1.4.5, but my code hung and I haven't debugged it further to find the reason.
It works in iText 2.0.8 (see attachment). I haven't tested it with iText 1.4.5. The new history files tell me that version dates from September 2006: http://www.1t3xt.com/downloads/history.php?branch=history.10&node=14 I'm sure you want to do some more effort getting iText 2.0.8 to work, to avoid this AND OTHER bugs that have been fixed since 2006. -- This answer is provided by 1T3XT BVBA
phrase_test.pdf
Description: Adobe PDF document
import java.io.IOException;
import java.io.FileOutputStream;
import com.lowagie.text.Document;
import com.lowagie.text.DocumentException;
import com.lowagie.text.Paragraph;
import com.lowagie.text.Phrase;
import com.lowagie.text.pdf.PdfWriter;
public class PhraseTest {
public static final void main(String[] args) {
Document document = new Document();
try {
PdfWriter.getInstance(document, new
FileOutputStream("phrase_test.pdf"));
document.open();
String myPhrase = "Line one with spaces\nLine two
should start on the next line";
Paragraph p = new Paragraph (new Phrase(myPhrase));
document.add(p);
} catch (IOException e) {
e.printStackTrace();
} catch (DocumentException e) {
e.printStackTrace();
}
document.close();
}
}
------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://itext.ugent.be/itext-in-action/
