Introduction
In this page you can find the example usage for com.itextpdf.text.pdf BaseFont CP1252.
Prototype
String CP1252
To view the source code for com.itextpdf.text.pdf BaseFont CP1252.
Click
Source Link
Document
A possible encoding.
Usage
From source file:
bouttime.report.bracketsheet.BracketSheetUtil.java
License:Open Source License
public static void drawBoutLabel(PdfContentByte cb, BaseFont bf, float x, float y, float r, float topPad,
float botPad, int fontsize, float lineWidth, float grayStroke, String boutLabel, float rotation)
throws DocumentException, IOException {
if (bf == null) {
bf = BaseFont.createFont(BaseFont.TIMES_ROMAN, BaseFont.CP1252, BaseFont.EMBEDDED);
}// w ww. jav a2s . co m
drawCircle(cb, x, y, r, lineWidth, grayStroke);
if (rotation == 0) {
float mid = x + (r / 2);
drawStringCentered(cb, bf, mid, y + r + topPad, fontsize, boutLabel, rotation);
} else if (rotation == 90) {
drawStringCentered(cb, bf, x + topPad, y, fontsize, boutLabel, rotation);
From source file:
bouttime.report.bracketsheet.BracketSheetUtil.java
License:Open Source License
public static void drawBoutNum(PdfContentByte cb, BaseFont bf, float x, float y, float width, float height,
float topPad, float botPad, int fontsize, float lineWidth, float grayStroke, String boutNum,
float rotation) throws DocumentException, IOException {
if (bf == null) {
bf = BaseFont.createFont(BaseFont.TIMES_ROMAN, BaseFont.CP1252, BaseFont.EMBEDDED);
}/* w w w. j a v a2 s . c o m*/
drawRectangle(cb, x, y, width, height, lineWidth, grayStroke);
if (rotation == 0) {
float mid = x + (width / 2);
drawStringCentered(cb, bf, mid, y + botPad, fontsize, boutNum, rotation);
} else if (rotation == 90) {
float mid = y + (height / 2);
drawStringCentered(cb, bf, x + width - botPad, mid, fontsize, boutNum, rotation);
From source file:
bouttime.report.bracketsheet.BracketSheetUtil.java
License:Open Source License
public static void drawMatBox(PdfContentByte cb, BaseFont bf, float x, float y, float width, float height,
float topPad, float botPad, float lineWidth, float grayStroke, String mat, float rotation)
throws DocumentException, IOException {
if (bf == null) {
bf = BaseFont.createFont(BaseFont.TIMES_ROMAN, BaseFont.CP1252, BaseFont.EMBEDDED);
}/*w w w. j a v a 2s .c o m*/
drawRectangle(cb, x, y, width, height, lineWidth, grayStroke);
if (rotation == 0) {
float mid = x + (width / 2);
drawStringCentered(cb, bf, mid, y + height - topPad, 12, "Mat", rotation);
drawStringCentered(cb, bf, mid, y + botPad, 16, mat, rotation);
} else if (rotation == 90) {
float mid = y + (height / 2);
drawStringCentered(cb, bf, x + topPad, mid, 12, "Mat", rotation);
drawStringCentered(cb, bf, x + width - botPad, mid, 16, mat, rotation);
From source file:
bouttime.report.bracketsheet.BracketSheetUtil.java
License:Open Source License
public static void drawTimestamp(PdfContentByte cb, BaseFont bf, float x, float y, int fontsize,
String timestamp, float rotation) throws DocumentException, IOException {
if (bf == null) {
bf = BaseFont.createFont(BaseFont.TIMES_ROMAN, BaseFont.CP1252, BaseFont.EMBEDDED);
}//w w w. j ava 2 s. com
drawString(cb, bf, x, y, fontsize, timestamp, rotation);
From source file:
bouttime.report.bracketsheet.CommonBracketSheet.java
License:Open Source License
public Boolean doBlankPage(FileOutputStream fos, Dao dao) {
if (!dao.isOpen()) {
return false;
}/*from www . j a v a 2 s . c o m*/
// step 1: creation of a document-object
Document document = new Document();
try {
// step 2: creation of the writer
if (fos == null) {
return false;
PdfWriter writer = PdfWriter.getInstance(document, fos);
// step 3: we open the document
document.open();
// step 4: we grab the ContentByte and do some stuff with it
PdfContentByte cb = writer.getDirectContent();
BaseFont bf = BaseFont.createFont(BaseFont.TIMES_ROMAN, BaseFont.CP1252, BaseFont.EMBEDDED);
drawBracket(cb, bf, dao, null, false);
} catch (DocumentException de) {
logger.error("Document Exception", de);
return false;
} catch (IOException ioe) {
logger.error("IO Exception", ioe);
return false;
// step 5: we close the document
document.close();
return true;
From source file:
bouttime.report.bracketsheet.CommonBracketSheet.java
License:Open Source License
public Boolean doPage(PdfContentByte cb, Dao dao, Group g, boolean doBoutNumbers) {
if (!dao.isOpen()) {
return false;
}//from w ww .ja v a 2 s. com
try {
BaseFont bf = BaseFont.createFont(BaseFont.TIMES_ROMAN, BaseFont.CP1252, BaseFont.EMBEDDED);
drawBracket(cb, bf, dao, g, doBoutNumbers);
} catch (DocumentException de) {
logger.error("Document Exception", de);
return false;
} catch (IOException ioe) {
logger.error("IO Exception", ioe);
return false;
return true;
From source file:
bouttime.report.bracketsheet.RoundRobinBracketSheetReport.java
License:Open Source License
public static Boolean doBlankPage(FileOutputStream fos, Dao dao, Integer numWrestlers) {
if (!dao.isOpen()) {
return false;
}/*from w w w .j av a 2s.c o m*/
// step 1: creation of a document-object
Document document = new Document();
try {
// step 2: creation of the writer
if (fos == null) {
return false;
PdfWriter writer = PdfWriter.getInstance(document, fos);
// step 3: we open the document
document.open();
// step 4: we grab the ContentByte and do some stuff with it
PdfContentByte cb = writer.getDirectContent();
BaseFont bf = BaseFont.createFont(BaseFont.TIMES_ROMAN, BaseFont.CP1252, BaseFont.EMBEDDED);
drawBracket(cb, bf, dao, null, numWrestlers);
} catch (DocumentException de) {
logger.error("Document Exception", de);
return false;
} catch (IOException ioe) {
logger.error("IO Exception", ioe);
return false;
// step 5: we close the document
document.close();
return true;
From source file:
bouttime.report.bracketsheet.RoundRobinBracketSheetReport.java
License:Open Source License
public static Boolean doPage(PdfContentByte cb, Dao dao, Group g) {
if (!dao.isOpen()) {
return false;
}/*from ww w. j a v a2 s . c om*/
try {
BaseFont bf = BaseFont.createFont(BaseFont.TIMES_ROMAN, BaseFont.CP1252, BaseFont.EMBEDDED);
drawBracket(cb, bf, dao, g, 0);
} catch (DocumentException de) {
logger.error("Document Exception", de);
return false;
} catch (IOException ioe) {
logger.error("IO Exception", ioe);
return false;
return true;
From source file:
bouttime.report.bracketsheet.RoundRobinBracketSheetUtil.java
License:Open Source License
public static void drawBoutHeader(PdfContentByte cb, BaseFont bf, float x, float y)
throws DocumentException, IOException {
if (bf == null) {
bf = BaseFont.createFont(BaseFont.TIMES_ROMAN, BaseFont.CP1252, BaseFont.EMBEDDED);
}// w ww . j ava2 s . co m
float width = boutRectWidth;
float fontSize = 8;
x += (width / 2);
BracketSheetUtil.drawStringCentered(cb, bf, x, y, fontSize, "Round", 0);
x += width;
BracketSheetUtil.drawStringCentered(cb, bf, x, y, fontSize, "Bout", 0);
x += boutLineLength + width;
BracketSheetUtil.drawStringCentered(cb, bf, x, y, fontSize, "Winner", 0);
x += boutLineLength + spaceForVS + boutRectWidth + (padForVS * 2);
BracketSheetUtil.drawStringCentered(cb, bf, x, y, fontSize, "Winner", 0);
From source file:
bouttime.report.bracketsheet.RoundRobinBracketSheetUtil.java
License:Open Source License
public static void drawBout(PdfContentByte cb, BaseFont bf, float x, float y, String red, boolean strikeRed,
String green, boolean strikeGreen, String boutNum, String round, int winner)
throws DocumentException, IOException {
if (bf == null) {
bf = BaseFont.createFont(BaseFont.TIMES_ROMAN, BaseFont.CP1252, BaseFont.EMBEDDED);
}/*from w ww . j a v a2 s . co m*/
float width = boutRectWidth;
float height = boutRectHeight;
float length = boutLineLength;
float fontSize = 12;
float pad = padForVS;
float linePad = 2;
BracketSheetUtil.drawStringCentered(cb, bf, x + (width / 2), y + (boutRectHeight / 4), fontSize, round, 0);
x += width;
BracketSheetUtil.drawRectangle(cb, x, y, width, height, 1, 0);
BracketSheetUtil.drawStringCentered(cb, bf, x + (width / 2), y + (boutRectHeight / 4), fontSize, boutNum,
x += width;
BracketSheetUtil.drawHorizontalLine(cb, x, y, length, 1, 0);
if (red != null) {
BracketSheetUtil.drawString(cb, bf, x + boxPad, y + linePad, fontSize, red, strikeRed);
x += length;
BracketSheetUtil.drawRectangle(cb, x, y, width, height, 1, 0);
if (winner == 1) {
BracketSheetUtil.drawStringCentered(cb, bf, x + (width / 2), y + (height / 4), fontSize, "X", 0);
x += width + pad;
BracketSheetUtil.drawString(cb, bf, x, y + linePad, fontSize, "vs");
x += pad + spaceForVS;
BracketSheetUtil.drawHorizontalLine(cb, x, y, length, 1, 0);
if (green != null) {
BracketSheetUtil.drawString(cb, bf, x + boxPad, y + linePad, fontSize, green, strikeGreen);
x += length;
BracketSheetUtil.drawRectangle(cb, x, y, width, height, 1, 0);
if (winner == 2) {
BracketSheetUtil.drawStringCentered(cb, bf, x + (width / 2), y + (height / 4), fontSize, "X", 0);