
import java.awt.Color;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

import com.lowagie.text.Cell;
import com.lowagie.text.Chunk;
import com.lowagie.text.Document;
import com.lowagie.text.Font;
import com.lowagie.text.PageSize;
import com.lowagie.text.Paragraph;
import com.lowagie.text.Table;
import com.lowagie.text.pdf.PdfWriter;


/**
 * @author IS00050
 *
 * Example with newlines
 */
public class newline0
{
    public static void main(String[] args) throws FileNotFoundException, IOException
    {
        Document document = new Document(PageSize.A5, 40, 30, 40, 10);
        try
        {
            Table aTable;

            String strOutputFile = "C:/tmp/newline0.pdf";

            // creation of the different writers
            PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream(strOutputFile));

            document.open();

			document.add(Chunk.NEWLINE);
			document.add(Chunk.NEWLINE);
			document.add(Chunk.NEWLINE);
			document.add(Chunk.NEWLINE);
			document.add(Chunk.NEWLINE);
			document.add(new Paragraph("adsfadsf"));
			document.add(Chunk.NEWLINE);
			document.add(Chunk.NEWLINE);
			document.add(new Chunk("e"));

            document.close();
            System.out.println("Finished.");

        }
        catch (Exception anException) {
			anException.printStackTrace();
        }

    }
}

/**
 * @author IS00050
 *
 * Example with chunks - overprinting
 */
public class newline1
{
    public static void main(String[] args) throws FileNotFoundException, IOException
    {
        Document document = new Document(PageSize.A5, 40, 30, 40, 10);
        try
        {
            Table aTable;

            String strOutputFile = "C:/tmp/newline1.pdf";

            // creation of the different writers
            PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream(strOutputFile));

            document.open();

			document.add(new Chunk("a", new Font(Font.HELVETICA, 8)));
			document.add(Chunk.NEWLINE);
			document.add(new Chunk("b", new Font(Font.HELVETICA, 10)));
			document.add(Chunk.NEWLINE);
			document.add(new Chunk("c", new Font(Font.HELVETICA, 12)));
			document.add(Chunk.NEWLINE);
			document.add(new Chunk("d", new Font(Font.HELVETICA, 14)));
			document.add(Chunk.NEWLINE);
			document.add(new Paragraph("adsfadsf"));
			document.add(new Chunk("d", new Font(Font.HELVETICA, 16)));
			document.add(Chunk.NEWLINE);
			document.add(new Chunk("e"));
			document.add(Chunk.NEWLINE);

            document.close();
            System.out.println("Finished.");

        }
        catch (Exception anException) {
			anException.printStackTrace();
        }

    }
}
