gate.report.doc.PDF Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gate Show documentation
Show all versions of gate Show documentation
A multipurpose java library
package gate.report.doc;
import com.lowagie.text.BadElementException;
import com.lowagie.text.Chunk;
import com.lowagie.text.Document;
import com.lowagie.text.DocumentException;
import com.lowagie.text.Element;
import com.lowagie.text.Font;
import com.lowagie.text.ListItem;
import com.lowagie.text.PageSize;
import com.lowagie.text.Phrase;
import com.lowagie.text.Rectangle;
import com.lowagie.text.pdf.BaseFont;
import com.lowagie.text.pdf.PdfContentByte;
import com.lowagie.text.pdf.PdfGraphics2D;
import com.lowagie.text.pdf.PdfPCell;
import com.lowagie.text.pdf.PdfPTable;
import com.lowagie.text.pdf.PdfPageEventHelper;
import com.lowagie.text.pdf.PdfTemplate;
import com.lowagie.text.pdf.PdfWriter;
import gate.annotation.Icon;
import gate.converter.Converter;
import gate.error.AppError;
import gate.report.Chart;
import gate.report.ChartGenerator;
import gate.report.Column;
import gate.report.Doc;
import gate.report.Field;
import gate.report.Footer;
import gate.report.Form;
import gate.report.Grid;
import gate.report.Header;
import gate.report.Image;
import gate.report.LineBreak;
import gate.report.PageBreak;
import gate.report.Paragraph;
import gate.report.Report;
import static gate.report.Report.Orientation.LANDSCAPE;
import static gate.report.Report.Orientation.PORTRAIT;
import gate.report.ReportElement;
import gate.report.ReportList;
import gate.report.Style;
import gate.util.Toolkit;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.geom.Rectangle2D;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
/**
* Generates PDF documents from objects of type {@link gate.report.Report}.
*/
@Icon("gate.report.Doc$Type:PDF")
public class PDF extends Doc
{
private static final Color CAPTION_COLOR = new Color(120, 129, 133);
private static final Color HEAD_COLOR = new Color(185, 198, 205);
private static final Color FORM_COLOR = new Color(255, 255, 255);
private static final Color FIELD_COLOR = new Color(230, 230, 230);
private static final Color BODY_COLOR1 = new Color(255, 255, 255);
private static final Color BODY_COLOR2 = new Color(245, 246, 248);
private static final Map COLORS = new ConcurrentHashMap<>();
private static final ConcurrentMap