當前位置: 首頁>>代碼示例>>Java>>正文


Java Element.ALIGN_LEFT屬性代碼示例

本文整理匯總了Java中com.itextpdf.text.Element.ALIGN_LEFT屬性的典型用法代碼示例。如果您正苦於以下問題:Java Element.ALIGN_LEFT屬性的具體用法?Java Element.ALIGN_LEFT怎麽用?Java Element.ALIGN_LEFT使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在com.itextpdf.text.Element的用法示例。


在下文中一共展示了Element.ALIGN_LEFT屬性的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: cellRodape

private PdfPTable cellRodape(String value, boolean l,boolean r,int align)
{
    Font fontCorpoTableO= FontFactory.getFont(Fontes.FONT, BaseFont.WINANSI, BaseFont.EMBEDDED ,7.5f);
    PdfPTable pTable = new PdfPTable(1);
    pTable.setWidthPercentage(100f);
    PdfPCell cellValue = new PdfPCell(new Phrase(value,fontCorpoTableO));
    if(l){cellValue.setBorderWidthLeft(0);}
    if(r){cellValue.setBorderWidthRight(0);}
   switch (align) 
   {
       case Element.ALIGN_RIGHT:cellValue.setHorizontalAlignment(Element.ALIGN_RIGHT);break;
       case Element.ALIGN_LEFT:cellValue.setHorizontalAlignment(Element.ALIGN_LEFT);break;
       case Element.ALIGN_CENTER:cellValue.setHorizontalAlignment(Element.ALIGN_CENTER);break;
       default:break;
   }
    pTable.addCell(cellValue);
    return pTable;
}
 
開發者ID:JIGAsoftSTP,項目名稱:NICON,代碼行數:18,代碼來源:ExporOnlyViagemPdf.java

示例2: createPdf

public void createPdf(String filename) throws DocumentException, IOException {

		Document document = new Document(PageSize.LETTER);
		PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream(filename));
		document.open();

		// TODO: 1. get direct content
		PdfContentByte canvas = writer.getDirectContent();

		Font font = new Font(FontFamily.HELVETICA, 18, Font.BOLD, BaseColor.ORANGE);
		Phrase headerText = new Phrase("PSEG DP&C", font);
		int alignLeft = Element.ALIGN_LEFT;
		float right = document.getPageSize().getRight();
		float top = document.getPageSize().getTop();

		// TODO: 2. use ColumnText
		ColumnText.showTextAligned(canvas, alignLeft, headerText, right - 180, top - 36, 0);

		document.close();
	}
 
開發者ID:kohmiho,項目名稱:iTextTutorial,代碼行數:20,代碼來源:T11_ColumnText.java

示例3: getDefaultAttributes

/**
 * Get the default element attributes used when creating document elements
 * @return The set of default element attributes
 */
public static ElementAttributes getDefaultAttributes() {
  CellAttributes lCellAttributes = new CellAttributes(true, PdfPCell.NO_BORDER, 0f, null);
  FontAttributes lFontAttributes = new FontAttributes(11, Font.NORMAL, BaseColor.BLACK, 1.2f);
  ParagraphAttributes lParagraphAttributes = new ParagraphAttributes(Element.ALIGN_LEFT);
  TableAttributes lTableAttributes = new TableAttributes(Optional.of(100f), Optional.empty(), Element.ALIGN_LEFT, 0f, 0f, false);

  return new ElementAttributes(lCellAttributes, lFontAttributes, lParagraphAttributes, lTableAttributes);
}
 
開發者ID:Fivium,項目名稱:FOXopen,代碼行數:12,代碼來源:DefaultElementAttributes.java

示例4: columnAlignment

public int columnAlignment(int col) {
    TableColumnNode tcn = tableNodeColumns.get(col);
    switch (tcn.getAlignment()) {
        case Left:
            return Element.ALIGN_LEFT;
        case Right:
            return Element.ALIGN_RIGHT;
        case None:
            return Element.ALIGN_UNDEFINED;
        case Center:
        default:
            return Element.ALIGN_CENTER;
    }
}
 
開發者ID:Arnauld,項目名稱:gutenberg,代碼行數:14,代碼來源:TableInfos.java

示例5: renderField

@Override
protected void renderField(String content, ColRDesc colRDesc) {
    PdfPCell cell = new PdfPCell(new Paragraph(content, pdfStyle.getDataCellFont()));
    cell.setColspan(1);

    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE);

    if (colRDesc != null && colRDesc.getHAlign() != null) {
        int alignment = Element.ALIGN_CENTER;
        switch (colRDesc.getHAlign()) {
            case LEFT:
                alignment = Element.ALIGN_LEFT;
                break;
            case RIGHT:
                alignment = Element.ALIGN_RIGHT;
                break;
            case CENTER:
                alignment = Element.ALIGN_CENTER;
                break;
            default:
                break;
        }

        cell.setHorizontalAlignment(alignment);
    }

    if (withNoBorders) {
        cell.setBorder(Rectangle.NO_BORDER);
    }
    customizeFieldCell(cell);
    table.addCell(cell);
}
 
開發者ID:inepex,項目名稱:ineform,代碼行數:33,代碼來源:PdfRenderer.java

示例6: getFooterHorizontalAlignment

/**
 * Obtain the footer horizontal alignment; Meant to be overriden if a different style is desired.
 * @return The footer horizontal alignment.
 */
protected int getFooterHorizontalAlignment()
{
    return Element.ALIGN_LEFT;
}
 
開發者ID:webbfontaine,項目名稱:displaytag,代碼行數:8,代碼來源:ItextTableWriter.java


注:本文中的com.itextpdf.text.Element.ALIGN_LEFT屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。