当前位置: 首页>>代码示例>>Java>>正文


Java Paragraph.add方法代码示例

本文整理汇总了Java中com.itextpdf.text.Paragraph.add方法的典型用法代码示例。如果您正苦于以下问题:Java Paragraph.add方法的具体用法?Java Paragraph.add怎么用?Java Paragraph.add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.itextpdf.text.Paragraph的用法示例。


在下文中一共展示了Paragraph.add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getObjectDescription

import com.itextpdf.text.Paragraph; //导入方法依赖的package包/类
private Paragraph getObjectDescription() 
{

	Paragraph p = new Paragraph();
	p.setLeading(0, 1.2f);
	p.setAlignment(Element.ALIGN_JUSTIFIED);
       p.setSpacingAfter(10);
       p.setSpacingBefore(50);
       
	if(o.getDescription()!=null){
		p.add(new Chunk(o.getDescription(), bodyFont));
	}
	else{
		p.add(new Chunk("No description recorded", bodyFont));
	}
	
	return p;
}
 
开发者ID:ltrr-arizona-edu,项目名称:tellervo,代码行数:19,代码来源:ProSheet.java

示例2: addTitlePage

import com.itextpdf.text.Paragraph; //导入方法依赖的package包/类
private static void addTitlePage(Document document,Resolucion res)
    throws DocumentException {
  Paragraph preface = new Paragraph();
  // We add one empty line
  addEmptyLine(preface, 1);
  // Lets write a big header
  preface.add(new Paragraph("Consejo Profesional de Informatica de Santiago del Estero", catFont));

  addEmptyLine(preface, 1);
  // Will create: Report generated by: _name, _date
  preface.add(new Paragraph( "Comision Directiva del Consejo, " + new Date(), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
      smallBold));
  addEmptyLine(preface, 2);
  preface.add(new Paragraph("Resolucion N°"+res.getNumero_resolucion()+"",
      smallBold));

  addEmptyLine(preface, 3);

  preface.add(new Paragraph("Esta Resolucion de tipo "+res.getTipo()+" formulada para notificar al socio con legajo: "+res.getLegajo_socio()+" de su actual estado como socio del Consejo.\n"
          + res.getDescripcion_solicitud()+" "+res.getDescripcion_resolucion()+" en la fecha "+res.getFecha(),
      cuerpo));

  document.add(preface);
  // Start a new page
  document.newPage();
}
 
开发者ID:gonzapala,项目名称:CPI,代码行数:27,代码来源:generarPDF.java

示例3: getComments

import com.itextpdf.text.Paragraph; //导入方法依赖的package包/类
private Paragraph getComments(WSIBox b) throws DocumentException
{

	Paragraph p = new Paragraph();
	p.setLeading(0, 1.2f);
	
	p.add(new Chunk("Comments: \n", subSubSectionFont));
	if(b.getComments()!=null){
		p.add(new Chunk(b.getComments(), bodyFont));
	}
	else{
		p.add(new Chunk("No comments recorded", bodyFont));
	}
	
	return(p);
}
 
开发者ID:ltrr-arizona-edu,项目名称:tellervo,代码行数:17,代码来源:BasicBoxLabel.java

示例4: createSimpleTextPdf

import com.itextpdf.text.Paragraph; //导入方法依赖的package包/类
static byte[] createSimpleTextPdf(String paragraphFormat, int paragraphCount) throws DocumentException
{
    ByteArrayOutputStream baos = new ByteArrayOutputStream();

    Document document = new Document();
    PdfWriter.getInstance(document, baos);
    document.open();
    for (int i = 0; i < paragraphCount; i++)
    {
        Paragraph paragraph = new Paragraph();
        paragraph.add(String.format(paragraphFormat, i));
        document.add(paragraph);
    }
    document.close();

    return baos.toByteArray();
}
 
开发者ID:mkl-public,项目名称:testarea-itext5,代码行数:18,代码来源:DenseMerging.java

示例5: createSimpleTextPdf

import com.itextpdf.text.Paragraph; //导入方法依赖的package包/类
/**
 * This method creates a PDF with a single styled paragraph.
 */
static byte[] createSimpleTextPdf() throws DocumentException
{
    ByteArrayOutputStream baos = new ByteArrayOutputStream();

    Document document = new Document();
    PdfWriter.getInstance(document, baos);
    document.open();

    Paragraph paragraph = new Paragraph();
    paragraph.add(new Phrase("Beware: ", new Font(FontFamily.HELVETICA, 12, Font.BOLDITALIC)));
    paragraph.add(new Phrase("The implementation of ", new Font(FontFamily.HELVETICA, 12, Font.ITALIC)));
    paragraph.add(new Phrase("MarginFinder", new Font(FontFamily.COURIER, 12, Font.ITALIC)));
    paragraph.add(new Phrase(" is far from optimal. It is not even correct as it includes all curve control points which is too much. Furthermore it ignores stuff like line width or wedge types. It actually merely is a proof-of-concept.", new Font(FontFamily.HELVETICA, 12, Font.ITALIC)));
    document.add(paragraph);

    document.close();

    return baos.toByteArray();
}
 
开发者ID:mkl-public,项目名称:testarea-itext5,代码行数:23,代码来源:ImportPageWithoutFreeSpace.java

示例6: createSimpleTextPdf

import com.itextpdf.text.Paragraph; //导入方法依赖的package包/类
static byte[] createSimpleTextPdf() throws DocumentException
{
    ByteArrayOutputStream baos = new ByteArrayOutputStream();

    Document document = new Document();
    PdfWriter.getInstance(document, baos);
    document.open();
    for (int i = 1; i < 20; i++)
    {
        Paragraph paragraph = new Paragraph();
        for (int j = 0; j < i; j++)
            paragraph.add("Hello World! ");
        document.add(paragraph);
    }
    document.close();

    return baos.toByteArray();
}
 
开发者ID:mkl-public,项目名称:testarea-itext5,代码行数:19,代码来源:SimpleRedactionTest.java

示例7: getTitlePDF

import com.itextpdf.text.Paragraph; //导入方法依赖的package包/类
/**
 * Get an iText Paragraph for the Title 
 * 
 * @return Paragraph
 */
private Paragraph getTitlePDF()
{
	Paragraph p = new Paragraph();
	
	p.add(new Chunk(s.getDisplayTitle()+"\n", titleFont));

	// Add object name if this is a mSeries
	if(s.getSeries() instanceof TridasMeasurementSeries)
	{
		TridasObject tobj = s.getMeta(Metadata.OBJECT, TridasObject.class);
	
		p.add(new Chunk(tobj.getTitle(), subTitleFont));
	}		
	return p;		
}
 
开发者ID:ltrr-arizona-edu,项目名称:tellervo,代码行数:21,代码来源:SeriesReport.java

示例8: getSeriesComments

import com.itextpdf.text.Paragraph; //导入方法依赖的package包/类
private Paragraph getSeriesComments() 
{


	Paragraph p = new Paragraph();
	
	if(s.getSeries().getComments()!=null){
		
		p.setLeading(0, 1.2f);
		p.add(new Chunk("Comments: \n", subSubSectionFont));
		p.add(new Chunk(s.getSeries().getComments(), bodyFont));
		return p;
	}
	else
	{
		return p;
	}
	
	
}
 
开发者ID:ltrr-arizona-edu,项目名称:tellervo,代码行数:21,代码来源:SeriesReport.java

示例9: getElementAndSampleInfo

import com.itextpdf.text.Paragraph; //导入方法依赖的package包/类
/**
 * iText paragraph of element and sample info
 * @return Paragraph
 */
private Paragraph getElementAndSampleInfo()
{
	Paragraph p = new Paragraph();
	
	TridasElement telem = s.getMeta(Metadata.ELEMENT, TridasElement.class);
	TridasSample tsamp = s.getMeta(Metadata.SAMPLE, TridasSample.class);
	
	p.add(new Chunk("Element and sample details:\n", subSubSectionFont));
	
	p.add(new Chunk("- Taxon:  ", bodyFont));
	p.add(new Chunk(telem.getTaxon().getNormal()+"\n", bodyFontItalic));
	p.add(new Chunk("- Element type: "+ telem.getType().getNormal()+"\n", bodyFont));
	p.add(new Chunk("- Sample type: "+ tsamp.getType().getNormal()+"\n", bodyFont));
	return p;
	
}
 
开发者ID:ltrr-arizona-edu,项目名称:tellervo,代码行数:21,代码来源:SeriesReport.java

示例10: getTimestampPDF

import com.itextpdf.text.Paragraph; //导入方法依赖的package包/类
/**
 * iText paragraph containing created and lastmodified timestamps
 * 
 * @return Paragraph
 */
private Paragraph getTimestampPDF(WSIBox b)
{
	// Set up calendar
	Date createdTimestamp = b.getCreatedTimestamp().getValue()
			.toGregorianCalendar().getTime();
	Date nowTimestamp = new Date();
	
	DateFormat df1 = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.SHORT);
	
	Paragraph p = new Paragraph();


	p.add(new Chunk("Created: ", subSubSectionFont));
	p.add(new Chunk(df1.format(createdTimestamp), bodyFont));
	//p.add(new Chunk("\nLast Modified: ", subSubSectionFont));
	//p.add(new Chunk(df1.format(lastModifiedTimestamp), bodyFontLarge));
	p.add(new Chunk("\nLabel updated: ", subSubSectionFont));
	p.add(new Chunk(df1.format(nowTimestamp), bodyFont));

	
	return p;
	
}
 
开发者ID:ltrr-arizona-edu,项目名称:tellervo,代码行数:29,代码来源:BasicBoxLabel.java

示例11: getObjectComments

import com.itextpdf.text.Paragraph; //导入方法依赖的package包/类
private Paragraph getObjectComments() 
{

	Paragraph p = new Paragraph();
	p.setLeading(0, 1.2f);
	p.setAlignment(Element.ALIGN_JUSTIFIED);
       p.setSpacingAfter(10);
	
	if(o.getComments()!=null){
		p.add(new Chunk("Notes: ", commentFont));
		p.add(new Chunk(o.getComments(), commentFont));
	}

	
	return p;
}
 
开发者ID:ltrr-arizona-edu,项目名称:tellervo,代码行数:17,代码来源:ProSheet.java

示例12: addContent

import com.itextpdf.text.Paragraph; //导入方法依赖的package包/类
private void addContent(PdfWriter writer) throws DocumentException, PdfFormatierungsException {		
	Anchor anchor = new Anchor("Lernentwicklungsbericht", lernentwicklungsberichtUeberschriftFont);
	Chapter chapterLEB = new Chapter(new Paragraph(anchor), 1);
	chapterLEB.setNumberDepth(0);
	Paragraph paragraphHeader = new Paragraph();
	paragraphHeader.setLeading(FIXED_LEADING_TEXT, 1);
	sectionCount += 1;
	Section headerSection = chapterLEB.addSection(paragraphHeader);
	headerSection.setNumberDepth(0);

	paragraphHeader.add(Chunk.NEWLINE);
	paragraphHeader.add(PdfFormatHelper.buildHeaderNameLine(lebData.getSchuelername() , headerFont));
	paragraphHeader.add(Chunk.NEWLINE);
	paragraphHeader.add(PdfFormatHelper.buildHeaderKlassendatenLine(lebData, headerFont));
	headerSection.add(Chunk.NEWLINE);		
	headerSection.add(Chunk.NEWLINE);
	document.add(chapterLEB);
	insertDummyLineIfNecessary(writer);
	
	addKlassenbrief(chapterLEB, writer);
	addIndividuelleEinschaetzung(chapterLEB, writer);
	addFacheinschaetzungen(chapterLEB, writer);
}
 
开发者ID:fossaag,项目名称:rolp,代码行数:24,代码来源:PdfStreamSource.java

示例13: addKlassenbrief

import com.itextpdf.text.Paragraph; //导入方法依赖的package包/类
private void addKlassenbrief(Chapter chapterLEB, PdfWriter writer) throws DocumentException, PdfFormatierungsException {
	if (!lebData.getKlassenbrief().isEmpty()) {
		sectionCount += 1;
		breakSchusterjunge(writer);
		Paragraph paragraphKlassenbrief = new Paragraph();
		Section klassenbriefSection = chapterLEB.addSection(paragraphKlassenbrief);
		klassenbriefSection.setNumberDepth(0);
		Paragraph klasseneinschaetzungParapgraph = new Paragraph(lebData.getKlassenbrief().replace('\t', '\0'), standardTextFont);
		klasseneinschaetzungParapgraph.setAlignment(Element.ALIGN_JUSTIFIED);
		klasseneinschaetzungParapgraph.setLeading(FIXED_LEADING_TEXT, zeilenabstandsfaktor);
		klasseneinschaetzungParapgraph.add(Chunk.NEWLINE);
		if (lebData.getIndividuelleEinschaetzung().isEmpty()) {
			klassenbriefSection.add(klasseneinschaetzungParapgraph);
			document.add(klassenbriefSection);
			document.add(getKlassenlehrerunterschrift(chapterLEB));
		} else {
			klasseneinschaetzungParapgraph.add(Chunk.NEWLINE);
			klassenbriefSection.add(klasseneinschaetzungParapgraph);
			document.add(klassenbriefSection);
		}
		alertLonelyHeader(writer);
		insertDummyLineIfNecessary(writer);
	}
}
 
开发者ID:fossaag,项目名称:rolp,代码行数:25,代码来源:PdfStreamSource.java

示例14: schreibeSchueler

import com.itextpdf.text.Paragraph; //导入方法依赖的package包/类
private static void schreibeSchueler(Schueler sch, Document pdf)
		throws IOException, DocumentException {
	log.fine("Schueler daten schreiben");
	Paragraph schueler = new Paragraph();
	schueler.add(new Paragraph("Benutzername:" + sch.getKurzname(),
			benutzerFont));
	schueler.add(new Paragraph("Kennwort:" + sch.getPasswort(),
			passwortFont));
	addEmptyLine(schueler, 1);
	schueler.add(new Paragraph("Ihre pers�nlichen Daten zur �berpr�fung:",
			textBold));
	schueler.add(new Paragraph(sch.getVorname() + " "
			+ sch.getFamilienname(), textFont));
	schueler.add(new Paragraph(sch.getPLZ() + " " + sch.getStadt(),
			textFont));
	schueler.add(new Paragraph(sch.getStrasse(), textFont));
	schueler.add(new Paragraph("Geburtsdatum:"
			+ schreibeCalendar(sch.getGeburtsdatum()), textFont));
	schueler.add(new Paragraph("Klasse:" + sch.getKlasse(), textFont));

	pdf.add(schueler);
}
 
开发者ID:ruettgers,项目名称:WebUntisService,代码行数:23,代码来源:ExportZuPassword.java

示例15: process

import com.itextpdf.text.Paragraph; //导入方法依赖的package包/类
@Override
public void process(int level, Node node, InvocationContext context) {
    List<Element> subs = context.collectChildren(level, node);
    Paragraph p = new Paragraph();
    for (Element sub : subs) {
        p.add(discardNewline(sub));
    }

    KeyValues kvs = context.iTextContext().keyValues();

    Float spacingBefore = kvs.<Float>getNullable(PARAGRAPH_SPACING_BEFORE).or(5f);
    Float spacingAfter = kvs.<Float>getNullable(PARAGRAPH_SPACING_AFTER).or(5f);
    p.setSpacingBefore(spacingBefore);
    p.setSpacingAfter(spacingAfter);

    applyAttributes(context, p);

    context.append(p);
}
 
开发者ID:Arnauld,项目名称:gutenberg,代码行数:20,代码来源:ParaNodeProcessor.java


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