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


Java PdfPTable.setWidthPercentage方法代碼示例

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


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

示例1: cellRodape

import com.itextpdf.text.pdf.PdfPTable; //導入方法依賴的package包/類
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,代碼行數:19,代碼來源:ExporOnlyViagemPdf.java

示例2: generatePage

import com.itextpdf.text.pdf.PdfPTable; //導入方法依賴的package包/類
@Override
public PdfPTable generatePage() throws Exception {
    Image image = Image.getInstance(imageFile.toURL());
    float heightToWidthRatio = (210f / 297f);
    Image imageCropped = ImageUtils.cropImageToMeetRatio(pdfWriter, image, heightToWidthRatio);

    PdfPCell cell = new PdfPCell(imageCropped, true);
    cell.setBorder(0);
    cell.setPadding(COVER_MARGIN);
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
    cell.setExtraParagraphSpace(0);
    cell.setRightIndent(0);

    PdfPTable table = new PdfPTable(1);
    ;
    table.setWidthPercentage(100f);
    table.setWidths(new int[]{1});
    table.setExtendLastRow(true);
    table.addCell(cell);

    return table;
}
 
開發者ID:lenrok258,項目名稱:MountainQuest-PL,代碼行數:24,代碼來源:CoverPageGenerator.java

示例3: createGridTable

import com.itextpdf.text.pdf.PdfPTable; //導入方法依賴的package包/類
protected PdfPTable createGridTable(ReportDataModel dataModel, boolean isRepeatHeader) throws Exception {
	PdfPTable table = new PdfPTable(calculateGridColumnCount(dataModel.getTopColumnHeaders()));
	table.setWidthPercentage(100);
	Collection<ColumnHeader> topHeaders = dataModel.getTopColumnHeaders();
	List<Integer> widths = new ArrayList<Integer>();
	generateGridColumnWidths(topHeaders, widths);
	int[] values = new int[widths.size()];
	for (int i = 0; i < widths.size(); i++) {
		values[i] = widths.get(i);
	}
	table.setWidths(values);
	int maxHeaderLevel = getGridMaxColumngroup(topHeaders);
	createGridColumnHeader(table, topHeaders, maxHeaderLevel);
	createGridTableDatas(table, dataModel.getReportData());
	if (isRepeatHeader) {
		table.setHeaderRows(maxHeaderLevel);
	}
	return table;
}
 
開發者ID:bsteker,項目名稱:bdf2,代碼行數:20,代碼來源:AbstractPdfReportBuilder.java

示例4: addOfferInstances

import com.itextpdf.text.pdf.PdfPTable; //導入方法依賴的package包/類
private void addOfferInstances(List<OfferInstance> offerInstances, Document document, BaseFont bf)
		throws DocumentException {

	if(offerInstances.isEmpty()) {
		return;
	}

	document.add(new Paragraph("Wybrane oferty: ", new Font(bf, 12)));

	PdfPTable offerInstancesTable = new PdfPTable(3);
	offerInstancesTable.setWidthPercentage(100);
	offerInstancesTable.setSpacingBefore(18f);
	offerInstancesTable.setSpacingAfter(18f);
	createofferInstancesTableHeaders(offerInstancesTable);
	createofferInstancesTableContent(offerInstances, offerInstancesTable);
	document.add(offerInstancesTable);
}
 
開發者ID:marcin-pwr,項目名稱:hotel,代碼行數:18,代碼來源:ResidenceService.java

示例5: createFooterTable

import com.itextpdf.text.pdf.PdfPTable; //導入方法依賴的package包/類
/**
     * <a href="http://stackoverflow.com/questions/43807931/creating-table-in-pdf-on-last-page-bottom-wrong-official-solution">
     * Creating table in pdf on last page bottom (wrong official solution)
     * </a>
     * <p>
     * Helper method for {@link #testCreateTableLikeUser7968180()}.
     * </p>
     */
    private static PdfPTable createFooterTable() throws DocumentException
    {
        int[] columnWidths = new int[] { 1, 1, 1, 1, 1, 1, 1, 1, 1 };
        PdfPTable datatable = new PdfPTable(columnWidths.length);
        datatable.setKeepTogether(true);
        datatable.setWidthPercentage(100);
        datatable.setWidths(columnWidths);
        datatable.getDefaultCell().setPadding(5);

//        datatable.getDefaultCell().setHorizontalAlignment(horizontalAlignment);
//        datatable.getDefaultCell().setVerticalAlignment(verticalAlignment);

        for (int i = 0; i < 100; i++)
        {
            datatable.addCell("Přehledová tabulka");
//            addCellToTable(datatable, horizontalAlignmentLeft, verticalAlignmentMiddle, "Přehledová tabulka",
//                    columnWidths.length, 1, fontTypeBold, fontSizeRegular, cellLayout_Bottom);
        }

        return datatable;
    }
 
開發者ID:mkl-public,項目名稱:testarea-itext5,代碼行數:30,代碼來源:CreateTableDirectContent.java

示例6: tableWithPageNumber

import com.itextpdf.text.pdf.PdfPTable; //導入方法依賴的package包/類
private PdfPTable tableWithPageNumber() throws DocumentException, IOException {

        PdfPTable innerTable = new PdfPTable(1);
        innerTable.setWidths(new int[]{1});
        innerTable.setWidthPercentage(100);
        innerTable.setPaddingTop(0);
        innerTable.addCell(new PageNumberCellGenerator(pageNumber, BackgroundColorGenerator.DEFAULT_BACKGROUND_COLOR)
                .generateTile());

        PdfPCell cell = new PdfPCell();
        cell.setVerticalAlignment(Element.ALIGN_BOTTOM);
        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
        cell.setBorder(0);
        cell.setPadding(0);
        cell.addElement(innerTable);

        PdfPTable table = new PdfPTable(1);
        table.setWidthPercentage(100f);
        table.setWidths(new int[]{1});
        table.setExtendLastRow(true);
        table.addCell(cell);
        return table;
    }
 
開發者ID:lenrok258,項目名稱:MountainQuest-PL,代碼行數:24,代碼來源:EmptyPageGenerator.java

示例7: generatePage

import com.itextpdf.text.pdf.PdfPTable; //導入方法依賴的package包/類
@Override
public PdfPTable generatePage() throws DocumentException, IOException, URISyntaxException {
    PdfPTable table = new PdfPTable(12); // Bootstrap style
    table.setWidthPercentage(100f);
    table.setWidths(new int[]{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1});
    table.setExtendLastRow(true);

    table.addCell(generateHeaderTitle());
    table.addCell(generateHeaderData());
    table.addCell(generatePhoto());
    table.addCell(generateMapImage());
    table.addCell(generateDescription());
    table.addCell(generateFooter());

    return table;
}
 
開發者ID:lenrok258,項目名稱:MountainQuest-PL,代碼行數:17,代碼來源:DataPageGenerator.java

示例8: generateFooter

import com.itextpdf.text.pdf.PdfPTable; //導入方法依賴的package包/類
private PdfPCell generateFooter() throws IOException, DocumentException, URISyntaxException {

        PdfPCell cell = new PdfPCell();
        cell.setColspan(12);
        cell.setVerticalAlignment(Element.ALIGN_BOTTOM);
        cell.setHorizontalAlignment(Element.ALIGN_CENTER);
        cell.setBorder(0);
        cell.setPadding(0);

        PdfPTable innerTable = new PdfPTable(2);
        innerTable.getDefaultCell().setBorder(0);
        innerTable.setWidths(new int[]{1, 1});
        innerTable.setWidthPercentage(100);
        innerTable.addCell(generateStamp());
        innerTable.addCell(new PageNumberCellGenerator(pageNumber, backgroundColor).generateTile());

        cell.addElement(innerTable);
        return cell;
    }
 
開發者ID:lenrok258,項目名稱:MountainQuest-PL,代碼行數:20,代碼來源:DataPageGenerator.java

示例9: writeTree

import com.itextpdf.text.pdf.PdfPTable; //導入方法依賴的package包/類
private void writeTree(Document document) throws DocumentException, IOException {
    if(mTreeReport == null) {
        return;
    }

    Paragraph title = createTitleParagraph();
    document.add(title);

    addSpace(document);

    PdfPTable titleTable = new PdfPTable(new float[]{1f, 3f});
    titleTable.setWidthPercentage(100f);
    getParagraph(titleTable, MobileRangerApplication.getAppContext().getString(R.string.form_date_title), mTreeReport.getDate(), 0);
    getParagraph(titleTable, MobileRangerApplication.getAppContext().getString(R.string.form_reporting_employee_title), mTreeReport.getReportingEmployee(), 0);
    document.add(titleTable);
    addSpace(document);

    if(mTreeReport.getLocations() != null && mTreeReport.getLocations().size() > 0) {
        for (TreeLocation location : mTreeReport.getLocations()) {
            PdfPTable table = createTableForLocation(location);
            document.add(table);
            document.newPage();

        }
    }
}
 
開發者ID:krispena,項目名稱:cbsp-reports,代碼行數:27,代碼來源:TreeReportWriter.java

示例10: buildFooterVersetzungsvermerkLine

import com.itextpdf.text.pdf.PdfPTable; //導入方法依賴的package包/類
public static PdfPTable buildFooterVersetzungsvermerkLine(String versetzungsvermerk, Font footerFont) throws DocumentException {
	PdfPCell labelCell = new PdfPCell(new Phrase("Versetzungsvermerk", footerFont));
	labelCell.setBorder(Rectangle.BOTTOM);
	labelCell.setBorderWidth(1f);

	PdfPCell nameCell = new PdfPCell(new Phrase(versetzungsvermerk, footerFont));
	nameCell.setBorder(Rectangle.BOTTOM);
	nameCell.setBorderWidth(1f);
	
	PdfPTable table = new PdfPTable(2);
	table.setHorizontalAlignment(Element.ALIGN_LEFT);
	table.setWidthPercentage(100f);
	table.addCell(labelCell);
	table.addCell(nameCell);
	table.setWidths(new float[] {0.3f, 0.7f});
	return table;
}
 
開發者ID:fossaag,項目名稱:rolp,代碼行數:18,代碼來源:PdfFormatHelper.java

示例11: buildFooterDatumLine

import com.itextpdf.text.pdf.PdfPTable; //導入方法依賴的package包/類
public static PdfPTable buildFooterDatumLine(String datumString, Font footerFont) throws DocumentException {
	PdfPCell labelCell = new PdfPCell(new Phrase("Datum", footerFont));
	labelCell.setBorder(Rectangle.BOTTOM);
	labelCell.setBorderWidth(1f);

	PdfPCell nameCell = new PdfPCell(new Phrase(datumString, footerFont));
	nameCell.setBorder(Rectangle.BOTTOM);
	nameCell.setBorderWidth(1f);
	
	PdfPTable table = new PdfPTable(2);
	table.setHorizontalAlignment(Element.ALIGN_LEFT);
	table.setWidthPercentage(100f);
	table.addCell(labelCell);
	table.addCell(nameCell);
	table.setWidths(new float[] {0.3f, 0.7f});
	return table;
}
 
開發者ID:fossaag,項目名稱:rolp,代碼行數:18,代碼來源:PdfFormatHelper.java

示例12: buildFooterDienstsiegelLine

import com.itextpdf.text.pdf.PdfPTable; //導入方法依賴的package包/類
public static PdfPTable buildFooterDienstsiegelLine(Font footerFont) throws DocumentException {
	PdfPCell leftCell = new PdfPCell(new Phrase("", footerFont));
	leftCell.setBorder(Rectangle.NO_BORDER);
	leftCell.setBorderWidth(1f);
	
	PdfPCell centerCell = new PdfPCell(new Phrase("Dienstsiegel der Schule", footerFont));
	centerCell.setBorder(Rectangle.NO_BORDER);
	centerCell.setBorderWidth(1f);
	centerCell.setHorizontalAlignment(Element.ALIGN_CENTER);

	PdfPCell rightCell = new PdfPCell(new Phrase("", footerFont));
	rightCell.setBorder(Rectangle.NO_BORDER);
	rightCell.setBorderWidth(1f);
	
	PdfPTable table = new PdfPTable(3);
	table.setHorizontalAlignment(Element.ALIGN_MIDDLE);
	table.setWidthPercentage(100f);
	table.addCell(leftCell);
	table.addCell(centerCell);
	table.addCell(rightCell);
	table.setWidths(new float[] {0.3f, 0.3f, 0.3f});
	return table;
}
 
開發者ID:fossaag,項目名稱:rolp,代碼行數:24,代碼來源:PdfFormatHelper.java

示例13: buildFooterUnterschriftenLine

import com.itextpdf.text.pdf.PdfPTable; //導入方法依賴的package包/類
public static PdfPTable buildFooterUnterschriftenLine(Font footerFont) throws DocumentException {
	PdfPCell leftCell = new PdfPCell(new Phrase("Schulleiter(in)", footerFont));
	leftCell.setBorder(Rectangle.TOP);
	leftCell.setBorderWidth(1f);
	leftCell.setHorizontalAlignment(Element.ALIGN_CENTER);
	
	PdfPCell centerCell = new PdfPCell(new Phrase("", footerFont));
	centerCell.setBorder(Rectangle.TOP);
	centerCell.setBorderWidth(1f);
	centerCell.setHorizontalAlignment(Element.ALIGN_CENTER);

	PdfPCell rightCell = new PdfPCell(new Phrase("Klassenleiter(in)", footerFont));
	rightCell.setBorder(Rectangle.TOP);
	rightCell.setBorderWidth(1f);
	rightCell.setHorizontalAlignment(Element.ALIGN_CENTER);
	
	PdfPTable table = new PdfPTable(3);
	table.setWidthPercentage(100f);
	table.addCell(leftCell);
	table.addCell(centerCell);
	table.addCell(rightCell);
	table.setWidths(new float[] {0.3f, 0.3f, 0.3f});
	return table;
}
 
開發者ID:fossaag,項目名稱:rolp,代碼行數:25,代碼來源:PdfFormatHelper.java

示例14: buildFooterHalbjahrDatumLine

import com.itextpdf.text.pdf.PdfPTable; //導入方法依賴的package包/類
public static PdfPTable buildFooterHalbjahrDatumLine(String datumString, Font footerFont) throws DocumentException {
	PdfPCell leftCell = new PdfPCell(new Phrase(datumString, footerFont));
	leftCell.setBorder(Rectangle.NO_BORDER);
	leftCell.setHorizontalAlignment(Element.ALIGN_CENTER);
	
	PdfPCell centerCell = new PdfPCell(new Phrase("", footerFont));
	centerCell.setBorder(Rectangle.NO_BORDER);
	centerCell.setHorizontalAlignment(Element.ALIGN_CENTER);

	PdfPCell rightCell = new PdfPCell(new Phrase("", footerFont));
	rightCell.setBorder(Rectangle.NO_BORDER);
	rightCell.setHorizontalAlignment(Element.ALIGN_CENTER);
	
	PdfPTable table = new PdfPTable(3);
	table.setWidthPercentage(100f);
	table.addCell(leftCell);
	table.addCell(centerCell);
	table.addCell(rightCell);
	table.setWidths(new float[] {0.3f, 0.3f, 0.3f});
	return table;
}
 
開發者ID:fossaag,項目名稱:rolp,代碼行數:22,代碼來源:PdfFormatHelper.java

示例15: buildFooterHalbjahrDatumKlassenleiterLine

import com.itextpdf.text.pdf.PdfPTable; //導入方法依賴的package包/類
public static PdfPTable buildFooterHalbjahrDatumKlassenleiterLine(Font footerFont) throws DocumentException {
	PdfPCell leftCell = new PdfPCell(new Phrase("Datum", footerFont));
	leftCell.setBorder(Rectangle.TOP);
	leftCell.setBorderWidth(1f);
	leftCell.setHorizontalAlignment(Element.ALIGN_CENTER);
	
	PdfPCell centerCell = new PdfPCell(new Phrase("", footerFont));
	centerCell.setBorder(Rectangle.TOP);
	centerCell.setBorderWidth(1f);
	centerCell.setHorizontalAlignment(Element.ALIGN_CENTER);

	PdfPCell rightCell = new PdfPCell(new Phrase("Klassenleiter(in)", footerFont));
	rightCell.setBorder(Rectangle.TOP);
	rightCell.setBorderWidth(1f);
	rightCell.setHorizontalAlignment(Element.ALIGN_CENTER);
	
	PdfPTable table = new PdfPTable(3);
	table.setWidthPercentage(100f);
	table.addCell(leftCell);
	table.addCell(centerCell);
	table.addCell(rightCell);
	table.setWidths(new float[] {0.3f, 0.3f, 0.3f});
	return table;
}
 
開發者ID:fossaag,項目名稱:rolp,代碼行數:25,代碼來源:PdfFormatHelper.java


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