本文整理汇总了Java中com.itextpdf.text.Paragraph.setSpacingAfter方法的典型用法代码示例。如果您正苦于以下问题:Java Paragraph.setSpacingAfter方法的具体用法?Java Paragraph.setSpacingAfter怎么用?Java Paragraph.setSpacingAfter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.itextpdf.text.Paragraph
的用法示例。
在下文中一共展示了Paragraph.setSpacingAfter方法的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;
}
示例2: createPDF
import com.itextpdf.text.Paragraph; //导入方法依赖的package包/类
public void createPDF(String outputFile, ArrayList<Question> qlist, boolean showCorrectAnswer,
PageCounter pagecounter, int maximumPageNumber, String inputFolder) throws DocumentException, IOException
{
_inputFolder = inputFolder;
Document document = new Document(PageSize.A4, 50, 50, 70, 50);
PdfWriter pdfwriter = PdfWriter.getInstance(document, new FileOutputStream(outputFile));
pdfwriter.setBoxSize("art", new Rectangle(36, 54, 559, 788));
pdfwriter.setPageEvent(new HeaderFooter(maximumPageNumber));
if (pagecounter != null)
{
pdfwriter.setPageEvent(pagecounter);
}
document.open();
Paragraph p = new Paragraph();
// p.setSpacingBefore(SPACING);
p.setSpacingAfter(SPACING);
p.setIndentationLeft(INDENTATION);
writeQuestions(p, document, showCorrectAnswer, qlist);
document.close();
}
示例3: 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;
}
示例4: 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);
}
示例5: process
import com.itextpdf.text.Paragraph; //导入方法依赖的package包/类
@Override
public void process(int level, Node node, InvocationContext context) {
List<Element> subs = context.collectChildren(level, node);
com.itextpdf.text.List orderedList = new com.itextpdf.text.List(com.itextpdf.text.List.ORDERED);
for (Element sub : subs) {
if (!orderedList.add(sub)) {
// wrap it
ListItem listItem = new ListItem();
listItem.add(sub);
orderedList.add(listItem);
}
}
KeyValues kvs = context.iTextContext().keyValues();
Float spacingBefore = kvs.<Float>getNullable(ORDERED_LIST_SPACING_BEFORE).or(5f);
Float spacingAfter = kvs.<Float>getNullable(ORDERED_LIST_SPACING_AFTER).or(5f);
Paragraph p = new Paragraph();
p.add(orderedList);
p.setSpacingBefore(spacingBefore);
p.setSpacingAfter(spacingAfter);
context.append(p);
}
示例6: addTitle
import com.itextpdf.text.Paragraph; //导入方法依赖的package包/类
private void addTitle(Document document, BaseFont bf) throws DocumentException {
Paragraph paragraph = new Paragraph("Rachunek za pobyt", new Font(bf, 20));
paragraph.setAlignment(Paragraph.ALIGN_CENTER);
paragraph.setSpacingAfter(24f);
document.add(paragraph);
}
示例7: CreatePDF_3DPrinter
import com.itextpdf.text.Paragraph; //导入方法依赖的package包/类
public CreatePDF_3DPrinter(File file, ArrayList<String> infos, ArrayList<Image> imagelist) throws DocumentException, MalformedURLException, IOException{
result = file;
MyPDF = new Document(PageSize.A4, 50, 50, 80, 80);
MyWriter = PdfWriter.getInstance(MyPDF,new FileOutputStream(result));
MyWriter.setInitialLeading(160);
MyPDF.open();
Font font = new Font(Font.FontFamily.TIMES_ROMAN, 40, Font.NORMAL);
Paragraph pg = new Paragraph();
pg.setAlignment(Element.ALIGN_CENTER);
pg.setSpacingAfter(150);
pg.setFont(font);
pg.add(infos.get(0));
pg.setLeading(2,1);
MyPDF.add(pg);
Image image = Image.getInstance(loadImage("/logo.png"), null);
image.setAbsolutePosition((MyPDF.getPageSize().getWidth()/2) - (image.getWidth()/2), 580f);
if(infos.get(0).length()<25){
image.setAbsolutePosition((MyPDF.getPageSize().getWidth()/2) - (image.getWidth()/2), 620f);
}
MyPDF.add(image);
MyPDF.add(createFrontPageTable(infos));
if(imagelist!=null){
tilingImages(imagelist);
}
MyPDF.close();
}
示例8: CreatePDF_LaserCutting
import com.itextpdf.text.Paragraph; //导入方法依赖的package包/类
public CreatePDF_LaserCutting(File file, ArrayList<String> infos, ArrayList<Image> imagelist) throws DocumentException, MalformedURLException, IOException{
result = file;
MyPDF = new Document(PageSize.A4, 50, 50, 80, 80);
MyWriter = PdfWriter.getInstance(MyPDF,new FileOutputStream(result));
MyWriter.setInitialLeading(160);
MyPDF.open();
Font font = new Font(Font.FontFamily.TIMES_ROMAN, 40, Font.NORMAL);
Paragraph pg = new Paragraph();
pg.setAlignment(Element.ALIGN_CENTER);
pg.setSpacingAfter(150);
pg.setFont(font);
pg.add(infos.get(0));
pg.setLeading(2,1);
MyPDF.add(pg);
Image image = Image.getInstance(loadImage("/logo.png"), null);
image.setAbsolutePosition((MyPDF.getPageSize().getWidth()/2) - (image.getWidth()/2), 580f);
if(infos.get(0).length()<25){
image.setAbsolutePosition((MyPDF.getPageSize().getWidth()/2) - (image.getWidth()/2), 620f);
}
MyPDF.add(image);
MyPDF.add(createFrontPageTable(infos));
if(imagelist!=null){
tilingImages(imagelist);
}
MyPDF.close();
}
示例9: getPrivacyStatement
import com.itextpdf.text.Paragraph; //导入方法依赖的package包/类
private Paragraph getPrivacyStatement() {
Paragraph p = new Paragraph(PDFBuilderForCDA.this.privacyAct,
PDFBuilderForCDA.this.tmbase);
p.setSpacingAfter(1.0F);
p.setSpacingAfter(1.0F);
return p;
}
示例10: appendSubject
import com.itextpdf.text.Paragraph; //导入方法依赖的package包/类
private void appendSubject(ITextContext context, Paragraph preface) {
if (StringUtils.isEmpty(subject)) {
return;
}
Styles styles = context.styles();
Font font = styles.getFont(FIRST_PAGE_SUBJECT_FONT).or(subjectFont(styles));
for (String titlePart : subject.split("[\n\r]+")) {
Paragraph paragraph = new Paragraph(titlePart, font);
paragraph.setAlignment(Element.ALIGN_RIGHT);
paragraph.setSpacingAfter(15.0f);
preface.add(paragraph);
}
}
示例11: process
import com.itextpdf.text.Paragraph; //导入方法依赖的package包/类
@Override
public void process(int level, Node node, InvocationContext context) {
List<Element> subs = context.collectChildren(level, node);
com.itextpdf.text.List orderedList = new com.itextpdf.text.List(com.itextpdf.text.List.UNORDERED);
orderedList.setListSymbol(context.bulletSymbol());
for (Element sub : subs) {
if (!orderedList.add(sub)) {
// wrap it
ListItem listItem = new ListItem();
listItem.add(sub);
orderedList.add(listItem);
}
}
KeyValues kvs = context.iTextContext().keyValues();
Float spacingBefore = kvs.<Float>getNullable(BULLET_LIST_SPACING_BEFORE).or(5f);
Float spacingAfter = kvs.<Float>getNullable(BULLET_LIST_SPACING_AFTER).or(5f);
Paragraph p = new Paragraph();
p.add(orderedList);
p.setSpacingBefore(spacingBefore);
p.setSpacingAfter(spacingAfter);
context.append(p);
}
示例12: createPdf
import com.itextpdf.text.Paragraph; //导入方法依赖的package包/类
public void createPdf(String filename) throws DocumentException, IOException {
Document document = new Document(PageSize.LETTER);
PdfWriter.getInstance(document, new FileOutputStream(filename));
document.open();
// step 4 - add content into document
String[] imageNames = { "35_Cal_Crutchlow.jpg", "38_Bradley_Smith.jpg", "46_Valentino_Rossi.jpg",
"99_Jorge_Lorenzo.jpg" };
for (int i = 0; i < 4; i++) {
// TODO: 1. Add image into Chunk
Image image = Image.getInstance("resources/img/" + imageNames[i]);
image.scaleToFit(500, 500);
Chunk imageChunk = new Chunk(image, 0, 0, true);
Phrase phrase = new Phrase(imageNames[i]);
Paragraph paragraph = new Paragraph();
paragraph.add(imageChunk);
paragraph.add(Chunk.NEWLINE);
paragraph.add(phrase);
// TODO: 2. Ask iText to keep a paragraph together
paragraph.setKeepTogether(true);
paragraph.setSpacingAfter(12);
document.add(paragraph);
}
document.close();
}
示例13: getPhotoInParagraph
import com.itextpdf.text.Paragraph; //导入方法依赖的package包/类
public static Paragraph getPhotoInParagraph(BufferedImage bufferedImage, float scalePercent, float spacingAbove) throws BadElementException, IOException {
Paragraph paragraph = new Paragraph(" ", SUB_FONT);
PdfPTable table = new PdfPTable(1);
table.addCell(getPhotoCell(bufferedImage, scalePercent, true));
paragraph.add(table);
paragraph.setLeading(0);
paragraph.setSpacingAfter(0);
paragraph.setSpacingBefore(spacingAbove);
return paragraph;
}
示例14: getPhotosInParagraph
import com.itextpdf.text.Paragraph; //导入方法依赖的package包/类
public static Paragraph getPhotosInParagraph(List<BufferedImage> bufferedImages, float scalePercent, boolean isHorizontallyCentered) throws BadElementException, IOException {
Paragraph paragraph = new Paragraph(" ", SUB_FONT);
PdfPTable table = new PdfPTable(1);
for (BufferedImage bufferedImage : bufferedImages) {
table.addCell(getPhotoCell(bufferedImage, scalePercent, isHorizontallyCentered));
}
table.setHorizontalAlignment(Element.ALIGN_CENTER);
paragraph.add(table);
paragraph.setLeading(0);
paragraph.setSpacingAfter(0);
paragraph.setSpacingBefore(0);
return paragraph;
}
示例15: render
import com.itextpdf.text.Paragraph; //导入方法依赖的package包/类
@Override
public boolean render(final Element el) throws Exception {
Paragraph p = ctx.createParagraph();
p.add(el.getTextTrim());
p.setSpacingAfter(ctx.getPoints("paragraph.spacing"));
addToPDF(p);
return ACABOU;
}