• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java FontFactory类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.itextpdf.text.FontFactory的典型用法代码示例。如果您正苦于以下问题:Java FontFactory类的具体用法?Java FontFactory怎么用?Java FontFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



FontFactory类属于com.itextpdf.text包,在下文中一共展示了FontFactory类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: cellRodape

import com.itextpdf.text.FontFactory; //导入依赖的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: funcaoTitulo

import com.itextpdf.text.FontFactory; //导入依赖的package包/类
private Phrase funcaoTitulo(int i) {
    String txt;
    Font fontcabecatable =  FontFactory.getFont(Fontes.FONTB, BaseFont.WINANSI, BaseFont.EMBEDDED ,10f );
    switch (i)
    {
        case 0:txt="Nr. Factura";break;
        case 1:txt="Nome do Segurado"; break;
        case 2:txt="Prémio";break;
        case 3:txt="Imposto 6%";break;
        case 4:txt="Imposto 5%";break;
        case 5:txt="FGA 2.6%";break;
        default:txt="TOTAL";break;
    }
    
    a=com.itextpdf.text.Element.ALIGN_CENTER;
    Phrase rt = new Phrase(txt,fontcabecatable);
    return rt; 
}
 
开发者ID:JIGAsoftSTP,项目名称:NICON,代码行数:19,代码来源:ExportMapaProducao__.java


示例3: writeSimplePdf

import com.itextpdf.text.FontFactory; //导入依赖的package包/类
public static void writeSimplePdf() throws Exception{
			//1.新建document对象
			//第一个参数是页面大小。接下来的参数分别是左、右、上和下页边距。
			Document document = new Document(PageSize.A4, 50, 50, 50, 50);
			//2.建立一个书写器(Writer)与document对象关联,通过书写器(Writer)可以将文档写入到磁盘中。
			//创建 PdfWriter 对象 第一个参数是对文档对象的引用,第二个参数是文件的实际名称,在该名称中还会给出其输出路径。
			PdfWriter writer = PdfWriter.getInstance(document, 	new FileOutputStream("D:\\Documents\\ITextTest.pdf"));
			//3.打开文档
			document.open();		
			//4.向文档中添加内容
			//通过 com.lowagie.text.Paragraph 来添加文本。可以用文本及其默认的字体、颜色、大小等等设置来创建一个默认段落
			BaseFont bfChinese = BaseFont.createFont("STSong-Light","UniGB-UCS2-H", BaseFont.NOT_EMBEDDED);
			Font fontChinese = new Font(bfChinese, 22, Font.BOLD, BaseColor.BLACK);
			
			document.add(new Paragraph("sdfsdfsd全是中文显示了没.fsdfsfs",fontChinese));
			document.add(new Paragraph("Some more text on the 	first page with different color and font type.",
					FontFactory.getFont(FontFactory.COURIER, 14, Font.BOLD, new BaseColor(255, 150, 200))));
			Paragraph pragraph=new Paragraph("你这里有中亠好", fontChinese);
			document.add(pragraph);
			
			//图像支持格式 GIF, Jpeg, PNG, wmf
			Image gif = Image.getInstance("F:/keyworkspace/survey/WebRoot/images/logo/snlogo.png");
			gif.setBorder(5);
			gif.scaleAbsolute(30,30);
			gif.setAlignment(Image.RIGHT|Image.TEXTWRAP);
			document.add(gif);
			Paragraph pragraph11=new Paragraph("你这里有中亠好你这里有中亠好你这里有中亠好你这里有中亠好你这里有中亠好你这里有中亠好你这里有中亠好你这里有中亠好你这里有中亠好你这里有中亠好", fontChinese);
			document.add(pragraph11);
			
			Image gif15 = Image.getInstance("F:/keyworkspace/survey/WebRoot/images/logo/snlogo.png");
//			gif15.setBorder(50);
			gif15.setBorder(Image.BOX);
			gif15.setBorderColor(BaseColor.RED);
//			gif15.setBorderColorBottom(borderColorBottom)
			gif15.setBorderWidth(1);
			gif15.scalePercent(50);
			document.add(gif15);
			//5.关闭文档
			document.close();
		}
 
开发者ID:wkeyuan,项目名称:DWSurvey,代码行数:41,代码来源:ItextpdfTest.java


示例4: writeTotal

import com.itextpdf.text.FontFactory; //导入依赖的package包/类
/**
 * Writes a total line.
 * @param value Total message.
 * @param total Total number.
 */
private void writeTotal(String value, double total)
{
    if (assertRequiredState())
    {
        this.font = FontFactory.getFont(
            this.font.getFamilyname(),
            this.font.getSize(),
            Font.BOLD,
            this.font.getColor());
        table.addCell(this.getCell(""));
        table.addCell(this.getCell(""));
        table.addCell(this.getCell("-------------"));
        table.addCell(this.getCell(""));
        // new row
        table.addCell(this.getCell(""));
        table.addCell(this.getCell(value + " Total:"));
        table.addCell(this.getCell(total + ""));
        table.addCell(this.getCell(""));
    }
}
 
开发者ID:webbfontaine,项目名称:displaytag,代码行数:26,代码来源:ItextTotalWrapper.java


示例5: emitMethodSummary

import com.itextpdf.text.FontFactory; //导入依赖的package包/类
private void emitMethodSummary(final PdfPTable summaryTable, MethodEntry methodEntry) {
    log.debug("Emitting summary for method {}", methodEntry.signature());

    methodEntry.patterns().forEach(new Consumer<String>() {
        @Override
        public void accept(String pattern) {
            Phrase phrase = new Phrase(pattern, FontFactory.getFont("Arial", 10, BLACK));
            PdfPCell patternCell = new PdfPCell(phrase);
            patternCell.setColspan(SUMMARY_NB_COLS - 2);
            patternCell.setBorder(Rectangle.BOTTOM);
            patternCell.setBorderColor(BaseColor.LIGHT_GRAY);

            summaryTable.addCell(emptyCell(2));
            summaryTable.addCell(patternCell);
        }
    });
}
 
开发者ID:Arnauld,项目名称:cucumber-contrib,代码行数:18,代码来源:GrammarPdfReport.java


示例6: main

import com.itextpdf.text.FontFactory; //导入依赖的package包/类
public static void main(String[] args) throws FileNotFoundException, DocumentException {
	Document document = new Document();
	PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream(DEST));
	document.open();
	Font font = FontFactory.getFont(FONT, BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);
	document.add(new Paragraph("hello world,我是rainbowhorse。", font));
	document.close();
	writer.close();
}
 
开发者ID:Sunny0715,项目名称:java_pdf_demo,代码行数:10,代码来源:JavaToPdfCN.java


示例7: configureStyles

import com.itextpdf.text.FontFactory; //导入依赖的package包/类
public void configureStyles(TGLayoutStyles styles) {
	TGConfigManager config = TuxGuitar.getInstance().getConfig();
	
	styles.setBufferEnabled(false);
	styles.setFirstMeasureSpacing(DEFAULT_HORIZONTAL_SPACING);
	styles.setMinBufferSeparator(DEFAULT_MIN_BUFFER_SEPARATOR);
	styles.setMinTopSpacing(DEFAULT_MIN_TOP_SPACING);
	styles.setMinScoreTabSpacing(MIN_SCORE_TAB_SPACING);
	styles.setScoreLineSpacing(DEFAULT_SCORE_LINE_SPACING);
	styles.setFirstTrackSpacing(DEFAULT_FIRST_TRACK_SPACING);
	styles.setTrackSpacing(DEFAULT_TRACK_SPACING);
	styles.setStringSpacing(DEFAULT_STRING_SPACING);
	styles.setChordFretIndexSpacing(CHORD_FRET_INDEX_SPACING);
	styles.setChordStringSpacing(CHORD_STRING_SPACING);
	styles.setChordFretSpacing(CHORD_FRET_SPACING);
	styles.setChordNoteSize(3);
	styles.setChordLineWidth(1);
	styles.setRepeatEndingSpacing(20);
	styles.setTextSpacing(15);
	styles.setMarkerSpacing(15);
	styles.setDivisionTypeSpacing(10);
	styles.setEffectSpacing(8);
	styles.setDefaultFont(new TGFontModel(FontFactory.TIMES_ROMAN, 8, false, false));
	styles.setNoteFont(new TGFontModel(FontFactory.TIMES_BOLD, 9, true, false));
	styles.setTimeSignatureFont(new TGFontModel(FontFactory.TIMES_BOLD, 15, true, false));
	styles.setLyricFont(new TGFontModel(FontFactory.TIMES_ROMAN, 8, false, false));
	styles.setTextFont(new TGFontModel(FontFactory.TIMES_ROMAN, 8, false, false));
	styles.setGraceFont(new TGFontModel(FontFactory.TIMES_ROMAN, 8, false, false));
	styles.setChordFont(new TGFontModel(FontFactory.TIMES_ROMAN, 8, false, false));
	styles.setChordFretFont(new TGFontModel(FontFactory.TIMES_ROMAN, 8, false, false));
	styles.setMarkerFont(new TGFontModel(FontFactory.TIMES_ROMAN, 8, false, false));
	styles.setBackgroundColor(config.getColorModelConfigValue(TGConfigKeys.COLOR_BACKGROUND));
	styles.setLineColor(config.getColorModelConfigValue(TGConfigKeys.COLOR_LINE));
	styles.setScoreNoteColor(config.getColorModelConfigValue(TGConfigKeys.COLOR_SCORE_NOTE));
	styles.setTabNoteColor(config.getColorModelConfigValue(TGConfigKeys.COLOR_TAB_NOTE));
	styles.setPlayNoteColor(config.getColorModelConfigValue(TGConfigKeys.COLOR_PLAY_NOTE));
	styles.setLoopSMarkerColor(config.getColorModelConfigValue(TGConfigKeys.COLOR_LOOP_S_MARKER));
	styles.setLoopEMarkerColor(config.getColorModelConfigValue(TGConfigKeys.COLOR_LOOP_E_MARKER));
}
 
开发者ID:theokyr,项目名称:TuxGuitar-1.3.1-fork,代码行数:40,代码来源:PDFController.java


示例8: onEndPage

import com.itextpdf.text.FontFactory; //导入依赖的package包/类
public void onEndPage(PdfWriter writer, Document document)
{
	Font font = FontFactory.getFont(Fonts.OPEN_SANS, BaseFont.IDENTITY_H, BaseFont.EMBEDDED, 8, Font.NORMAL, BaseColor.BLACK);

	ColumnText.showTextAligned(writer.getDirectContent(), Element.ALIGN_CENTER, new Phrase(Localization.getString(Strings.REPORT_FOOTER_LEFT), font), 100, 25, 0);
	ColumnText.showTextAligned(writer.getDirectContent(), Element.ALIGN_CENTER, new Phrase(Localization.getString(Strings.REPORT_FOOTER_CENTER, document.getPageNumber()), font), 300, 25, 0);
	ColumnText.showTextAligned(writer.getDirectContent(), Element.ALIGN_CENTER, new Phrase(DateTime.now().toString("dd.MM.YYYY"), font), 500, 25, 0);
}
 
开发者ID:deadlocker8,项目名称:BudgetMaster,代码行数:9,代码来源:HeaderFooterPageEvent.java


示例9: generateHeader

import com.itextpdf.text.FontFactory; //导入依赖的package包/类
private Chapter generateHeader()
{	
	Font font = FontFactory.getFont(FONT, BaseFont.IDENTITY_H, BaseFont.EMBEDDED, 16, Font.BOLDITALIC, BaseColor.BLACK);
	Chunk chunk = new Chunk(Localization.getString(Strings.REPORT_HEADLINE, date.toString("MMMM yyyy")), font);
	Chapter chapter = new Chapter(new Paragraph(chunk), 1);
	chapter.setNumberDepth(0);
	chapter.add(Chunk.NEWLINE);
	return chapter;
}
 
开发者ID:deadlocker8,项目名称:BudgetMaster,代码行数:10,代码来源:ReportGenerator.java


示例10: generateCategoryBudgets

import com.itextpdf.text.FontFactory; //导入依赖的package包/类
private PdfPTable generateCategoryBudgets()
{
	PdfPTable table = new PdfPTable(2);
	table.setWidthPercentage(100);
	Font font = FontFactory.getFont(FONT, BaseFont.IDENTITY_H, BaseFont.EMBEDDED, 8, Font.NORMAL, BaseColor.BLACK);
	
	//header cells
	PdfPCell cellHeaderCategory = new PdfPCell(new Phrase(Localization.getString(Strings.TITLE_CATEGORY), font));
	cellHeaderCategory.setBackgroundColor(GrayColor.LIGHT_GRAY);
	cellHeaderCategory.setHorizontalAlignment(Element.ALIGN_CENTER);
	table.addCell(cellHeaderCategory);
	PdfPCell cellHeaderAmount = new PdfPCell(new Phrase(Localization.getString(Strings.TITLE_AMOUNT), font));
	cellHeaderAmount.setBackgroundColor(GrayColor.LIGHT_GRAY);
	cellHeaderAmount.setHorizontalAlignment(Element.ALIGN_CENTER);
	table.addCell(cellHeaderAmount);		

	for(CategoryBudget budget : categoryBudgets)
	{				
		PdfPCell cellName = new PdfPCell(new Phrase(budget.getCategory().getName(), font));
		cellName.setBackgroundColor(new BaseColor(Color.WHITE));
		cellName.setHorizontalAlignment(Element.ALIGN_CENTER);
		cellName.setVerticalAlignment(Element.ALIGN_MIDDLE);
		table.addCell(cellName);
		
		PdfPCell cellAmount = new PdfPCell(new Phrase(Helpers.getCurrencyString(budget.getBudget() / 100.0, currency), font));
		cellAmount.setBackgroundColor(new BaseColor(Color.WHITE));
		cellAmount.setHorizontalAlignment(Element.ALIGN_CENTER);
		cellAmount.setVerticalAlignment(Element.ALIGN_MIDDLE);
		table.addCell(cellAmount);
	}
	
	return table;
}
 
开发者ID:deadlocker8,项目名称:BudgetMaster,代码行数:34,代码来源:ReportGenerator.java


示例11: getFont

import com.itextpdf.text.FontFactory; //导入依赖的package包/类
private Font getFont(String color, boolean bold) throws Exception {
	Font font = FontFactory.getFont(BscConstants.PDF_ITEXT_FONT, BaseFont.IDENTITY_H, BaseFont.EMBEDDED);
	int rgb[] = SimpleUtils.getColorRGB2(color);
	BaseColor baseColor = new BaseColor(rgb[0], rgb[1], rgb[2]);
	font.setSize(9);
	font.setColor(baseColor);
	return font;
}
 
开发者ID:billchen198318,项目名称:bamboobsc,代码行数:9,代码来源:PersonalReportPdfCommand.java


示例12: getFont

import com.itextpdf.text.FontFactory; //导入依赖的package包/类
private Font getFont(String color, boolean bold) throws Exception {
	Font font = FontFactory.getFont(BscConstants.PDF_ITEXT_FONT, BaseFont.IDENTITY_H, BaseFont.EMBEDDED);
	int rgb[] = SimpleUtils.getColorRGB2(color);
	BaseColor baseColor = new BaseColor(rgb[0], rgb[1], rgb[2]);
	font.setSize(9);
	if (bold) {
		font.setSize(14);
		font.setStyle(Font.BOLD);
	}		
	font.setColor(baseColor);
	return font;
}
 
开发者ID:billchen198318,项目名称:bamboobsc,代码行数:13,代码来源:KpiReportPdfCommand.java


示例13: addImageToPdf

import com.itextpdf.text.FontFactory; //导入依赖的package包/类
/**
 * The <code>addImageToPdf</code> method is used to add image to pdf and make it searchable by adding image text in invisible mode
 * w.r.t parameter 'isPdfSearchable' passed.
 * 
 * @param pdfWriter {@link PdfWriter} writer of pdf in which image has to be added
 * @param htmlUrl {@link HocrPage} corresponding html file for fetching text and coordinates
 * @param imageUrl {@link String} url of image to be added in pdf
 * @param isPdfSearchable true for searchable pdf else otherwise
 * @param widthOfLine
 */
private void addImageToPdf(PdfWriter pdfWriter, HocrPage hocrPage, String imageUrl, boolean isPdfSearchable, final int widthOfLine) {
	if (null != pdfWriter && null != imageUrl && imageUrl.length() > 0) {
		try {
			LOGGER.info("Adding image" + imageUrl + " to pdf using iText");
			Image pageImage = Image.getInstance(imageUrl);
			float dotsPerPointX = pageImage.getDpiX() / PDF_RESOLUTION;
			float dotsPerPointY = pageImage.getDpiY() / PDF_RESOLUTION;
			PdfContentByte pdfContentByte = pdfWriter.getDirectContent();

			pageImage.scaleToFit(pageImage.getWidth() / dotsPerPointX, pageImage.getHeight() / dotsPerPointY);

			pageImage.setAbsolutePosition(0, 0);

			// Add image to pdf
			pdfWriter.getDirectContentUnder().addImage(pageImage);
			pdfWriter.getDirectContentUnder().add(pdfContentByte);

			// If pdf is to be made searchable
			if (isPdfSearchable) {
				LOGGER.info("Adding invisible text for image: " + imageUrl);
				float pageImagePixelHeight = pageImage.getHeight();
				Font defaultFont = FontFactory.getFont(FontFactory.HELVETICA, 8, Font.BOLD, CMYKColor.BLACK);

				// Fetch text and coordinates for image to be added
				Map<String, int[]> textCoordinatesMap = getTextWithCoordinatesMap(hocrPage, widthOfLine);
				Set<String> ketSet = textCoordinatesMap.keySet();

				// Add text at specific location
				for (String key : ketSet) {
					int[] coordinates = textCoordinatesMap.get(key);
					float bboxWidthPt = (coordinates[2] - coordinates[0]) / dotsPerPointX;
					float bboxHeightPt = (coordinates[3] - coordinates[1]) / dotsPerPointY;
					pdfContentByte.beginText();

					// To make text added as invisible
					pdfContentByte.setTextRenderingMode(PdfContentByte.TEXT_RENDER_MODE_INVISIBLE);
					pdfContentByte.setLineWidth(Math.round(bboxWidthPt));

					// Ceil is used so that minimum font of any text is 1
					// For exception of unbalanced beginText() and endText()
					if (bboxHeightPt > 0.0) {
						pdfContentByte.setFontAndSize(defaultFont.getBaseFont(), (float) Math.ceil(bboxHeightPt));
					} else {
						pdfContentByte.setFontAndSize(defaultFont.getBaseFont(), 1);
					}
					float xCoordinate = (float) (coordinates[0] / dotsPerPointX);
					float yCoordinate = (float) ((pageImagePixelHeight - coordinates[3]) / dotsPerPointY);
					pdfContentByte.moveText(xCoordinate, yCoordinate);
					pdfContentByte.showText(key);
					pdfContentByte.endText();
				}
			}
			pdfContentByte.closePath();
		} catch (BadElementException badElementException) {
			LOGGER
					.error("Error occurred while adding image" + imageUrl + " to pdf using Itext: "
							+ badElementException.toString());
		} catch (DocumentException documentException) {
			LOGGER.error("Error occurred while adding image" + imageUrl + " to pdf using Itext: " + documentException.toString());
		} catch (MalformedURLException malformedURLException) {
			LOGGER.error("Error occurred while adding image" + imageUrl + " to pdf using Itext: "
					+ malformedURLException.toString());
		} catch (IOException ioException) {
			LOGGER.error("Error occurred while adding image" + imageUrl + " to pdf using Itext: " + ioException.toString());
		}
	}
}
 
开发者ID:kuzavas,项目名称:ephesoft,代码行数:78,代码来源:MultiPageExecutor.java


示例14: getFont

import com.itextpdf.text.FontFactory; //导入依赖的package包/类
/**
 * Get a font with the provided font family and font attributes applied
 * @param pFontFamily The font family
 * @param pFontAttributes The font attributes to be applied
 * @return A font of the provided font family with font attributes applied
 * @throws ExInternal If the font family provided is not registered
 */
private Font getFont(String pFontFamily, FontAttributes pFontAttributes) throws ExInternal {
  Font lFont = FontFactory.getFont(pFontFamily, BaseFont.IDENTITY_H, BaseFont.EMBEDDED, pFontAttributes.getSize(),
                                   pFontAttributes.getStyle(), pFontAttributes.getColor());

  if (lFont.getBaseFont() == null) {
    throw new ExInternal("Could not create a font using font family '" + pFontFamily + "' as it could not be found in the registered fonts");
  }

  return lFont;
}
 
开发者ID:Fivium,项目名称:FOXopen,代码行数:18,代码来源:FontManager.java


示例15: printExplanation

import com.itextpdf.text.FontFactory; //导入依赖的package包/类
private void printExplanation(String txt) throws DocumentException {
   Font f = FontFactory.getFont(FontFactory.COURIER, 10, BaseColor.MAGENTA);
   Paragraph paragraph = new Paragraph(txt, f);
   float padding = ItextHelper.mmToPts(2);
   for (Chunk c : paragraph.getChunks()) {
      c.setBackground(new BaseColor(230, 230, 230), padding, padding, padding, padding);
   }
   getDocument().add(paragraph);
   newLine();
}
 
开发者ID:eduarddrenth,项目名称:iText-GUI,代码行数:11,代码来源:StylesheetTester.java


示例16: createTable

import com.itextpdf.text.FontFactory; //导入依赖的package包/类
/**
 * Creates the table.
 *
 * @param consent the consent
 * @return the pdf p table
 */
private PdfPTable createTable(Consent consent) {
	Font fontbold = FontFactory.getFont("Helvetica", 15, Font.BOLD);
	
	PdfPTable table = new PdfPTable(new float[]{0.2f,0.8f});
	table.setWidthPercentage(100f);
	table.getDefaultCell().setBorder(0);
	
	
	Chunk chunk2=new Chunk("NO EXCEPT",fontbold);
	Chunk chunk3=new Chunk("NO NEVER",fontbold);
	if(consent.getConsentRevokationType().equals("EMERGENCY ONLY")){
		chunk2.append("\n(This is the option you chose.)");
	}
	else if(consent.getConsentRevokationType().equals("NO NEVER")){
		chunk3.append("\n(This is the option you chose.)");
	}
	
	table.addCell(new PdfPCell(new Phrase(chunk2)));
       table.addCell(new PdfPCell(new Phrase("I Deny Consent for all Participants to access " +
       		"my electronic health information through Consent 2 Share for any purpose, EXCEPT " +
       		"in a medical emergency. By checking this box you agree, \"No, none of the Participants" +
       		" may be given access to my medical records through Consent 2 Share unless it is a medical emergency.\"")));
       table.addCell(new PdfPCell(new Phrase(chunk3)));
       table.addCell(new PdfPCell(new Phrase("I Deny Consent for all Participants to access my electronic health information" +
       		" through Consent 2 Share for any purpose, INCLUDING in a medical emergency.")));
       
       return table;
}
 
开发者ID:tlin-fei,项目名称:ds4p,代码行数:35,代码来源:ConsentRevokationPdfGenerator.java


示例17: addInvisibleChapterForHeader

import com.itextpdf.text.FontFactory; //导入依赖的package包/类
public void addInvisibleChapterForHeader(Document document, Section section) {
	try {
		Paragraph paragraph=new Paragraph(section.getSectionName(), FontFactory.getFont(FontFactory.COURIER,1f,BaseColor.WHITE));//hide chapter
		Chapter chapter = new Chapter(paragraph,0);
		document.add(chapter);
	} catch (Exception e) {
		throw new RuntimeException(e);
	}
}
 
开发者ID:ntenhoeve,项目名称:Introspect-Framework,代码行数:10,代码来源:PdfReportFactory.java


示例18: inlineCodeFont

import com.itextpdf.text.FontFactory; //导入依赖的package包/类
private Supplier<? extends Font> inlineCodeFont(final Styles styles) {
    return new Supplier<Font>() {
        @Override
        public Font get() {
            try {
                return new Font(ITextUtils.inconsolata(), styles.defaultFontSize());
            } catch (Exception e) {
                log.warn("Fail to retrieve font", e);
                return FontFactory.getFont(FontFactory.COURIER, styles.defaultFontSize());
            }
        }
    };
}
 
开发者ID:Arnauld,项目名称:gutenberg,代码行数:14,代码来源:CodeNodeProcessor.java


示例19: initTable

import com.itextpdf.text.FontFactory; //导入依赖的package包/类
/**
 * Initialize the main info holder table.
 */
protected void initTable()
{
    tablePDF = new PdfPTable(this.model.getNumberOfColumns());
    tablePDF.getDefaultCell().setVerticalAlignment(Element.ALIGN_TOP);
    tablePDF.setWidthPercentage(100);

    smallFont = FontFactory.getFont(FontFactory.HELVETICA, 7, Font.NORMAL, new BaseColor(0, 0, 0));

}
 
开发者ID:webbfontaine,项目名称:displaytag,代码行数:13,代码来源:PdfView.java


示例20: emitPackageSummary

import com.itextpdf.text.FontFactory; //导入依赖的package包/类
private void emitPackageSummary(PdfPTable summaryTable, PackageEntry packageEntry) {
    log.debug("Emitting summary for package {}", packageEntry.name());

    if (packageEntry.hasClassEntries()) {
        Phrase phrase = new Phrase(packageEntry.name(), FontFactory.getFont("Arial", 8, WHITE));
        PdfPCell packageCell = new PdfPCell(phrase);
        packageCell.setBackgroundColor(BLACK);
        packageCell.setColspan(SUMMARY_NB_COLS);
        summaryTable.addCell(packageCell);

        packageEntry.classes().forEach(emitClassSummary(summaryTable));
    }

    packageEntry.subPackages().forEach(emitPackageSummary(summaryTable));
}
 
开发者ID:Arnauld,项目名称:cucumber-contrib,代码行数:16,代码来源:GrammarPdfReport.java



注:本文中的com.itextpdf.text.FontFactory类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Match类代码示例发布时间:2022-05-21
下一篇:
Java UpdateProvider类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap