private void addContent(final TestRunCoverageStatistics runStats) throws DocumentException { final Paragraph title = new Paragraph(runStats.title, FONT_H1); title.setIndentationLeft(PADDING_LEFT); document.add(title); document.add(createTable(runStats)); document.add(createFooter()); }
if (value != null) { try { paragraph.setIndentationLeft(Float.parseFloat(value)); } catch (Exception e) {
if (value != null) { try { paragraph.setIndentationLeft(Float.parseFloat(value)); } catch (Exception e) {
/** * Constructs a <CODE>Paragraph</CODE> with a certain <CODE>Phrase</CODE>. * * @param phrase a <CODE>Phrase</CODE> */ public Paragraph(Phrase phrase) { super(phrase); if (phrase instanceof Paragraph) { Paragraph p = (Paragraph)phrase; setAlignment(p.alignment); setIndentationLeft(p.getIndentationLeft()); setIndentationRight(p.getIndentationRight()); setFirstLineIndent(p.getFirstLineIndent()); setSpacingAfter(p.getSpacingAfter()); setSpacingBefore(p.getSpacingBefore()); setExtraParagraphSpace(p.getExtraParagraphSpace()); setRole(p.role); id = p.getId(); if (p.accessibleAttributes != null) accessibleAttributes = new HashMap<PdfName, PdfObject>(p.accessibleAttributes); } }
/** * Constructs a <CODE>Paragraph</CODE> with a certain <CODE>Phrase</CODE>. * * @param phrase a <CODE>Phrase</CODE> */ public Paragraph(Phrase phrase) { super(phrase); if (phrase instanceof Paragraph) { Paragraph p = (Paragraph)phrase; setAlignment(p.alignment); setIndentationLeft(p.getIndentationLeft()); setIndentationRight(p.getIndentationRight()); setFirstLineIndent(p.getFirstLineIndent()); setSpacingAfter(p.getSpacingAfter()); setSpacingBefore(p.getSpacingBefore()); setExtraParagraphSpace(p.getExtraParagraphSpace()); setRole(p.role); id = p.getId(); if (p.accessibleAttributes != null) accessibleAttributes = new HashMap<PdfName, PdfObject>(p.accessibleAttributes); } }
protected void populateProperties(Paragraph copy, boolean spacingBefore) { copy.setFont(getFont()); copy.setAlignment(getAlignment()); copy.setLeading(getLeading(), multipliedLeading); copy.setIndentationLeft(getIndentationLeft()); copy.setIndentationRight(getIndentationRight()); copy.setFirstLineIndent(getFirstLineIndent()); copy.setSpacingAfter(getSpacingAfter()); if (spacingBefore) copy.setSpacingBefore(getSpacingBefore()); copy.setExtraParagraphSpace(getExtraParagraphSpace()); copy.setRole(role); copy.id = getId(); if (accessibleAttributes != null) copy.accessibleAttributes = new HashMap<PdfName, PdfObject>(accessibleAttributes); copy.setTabSettings(getTabSettings()); copy.setKeepTogether(getKeepTogether()); }
protected void populateProperties(Paragraph copy, boolean spacingBefore) { copy.setFont(getFont()); copy.setAlignment(getAlignment()); copy.setLeading(getLeading(), multipliedLeading); copy.setIndentationLeft(getIndentationLeft()); copy.setIndentationRight(getIndentationRight()); copy.setFirstLineIndent(getFirstLineIndent()); copy.setSpacingAfter(getSpacingAfter()); if (spacingBefore) copy.setSpacingBefore(getSpacingBefore()); copy.setExtraParagraphSpace(getExtraParagraphSpace()); copy.setRole(role); copy.id = getId(); if (accessibleAttributes != null) copy.accessibleAttributes = new HashMap<PdfName, PdfObject>(accessibleAttributes); copy.setTabSettings(getTabSettings()); copy.setKeepTogether(getKeepTogether()); }
public ColumnText generateTableOfContent(ITextContext context) { ColumnText ct = new ColumnText(null); Styles styles = context.styles(); Chunk CONNECT = connectChunk(styles); Paragraph paragraph = new Paragraph(); paragraph.setSpacingBefore(20.0f); // first paragraph only ct.addElement(new Paragraph("Table of content", styles.sectionTitleFontForLevel(1))); ct.addElement(new Paragraph("")); Font entryFont = styles.getFontOrDefault(TOC_ENTRY_FONT); TableOfContents tableOfContents = context.tableOfContents(); for (TableOfContents.Entry entry : tableOfContents.getEntries()) { //if (entry.isExtra()) // continue; Chunk chunk = new Chunk(entry.getText(), entryFont); paragraph.add(chunk); paragraph.add(CONNECT); paragraph.add(new Chunk("" + entry.getFormattedPageNumber(), entryFont)); float indent = 10.0f * entry.getLevel(); paragraph.setIndentationLeft(indent); ct.addElement(paragraph); paragraph = new Paragraph(); } return ct; }