/** * Specifies that when rendering this document in a paginated * view, the contents of this paragraph are rendered on the start of a new * page in the document. * <p> * If this element is omitted on a given paragraph, * its value is determined by the setting previously set at any level of the * style hierarchy (i.e. that previous setting remains unchanged). If this * setting is never specified in the style hierarchy, then this property * shall not be applied. Since the paragraph is specified to start on a new * page, it begins page two even though it could have fit on page one. * </p> * * @return boolean - if page break is set */ public boolean isPageBreak() { final CTPPr ppr = getCTPPr(); final CTOnOff ctPageBreak = ppr.isSetPageBreakBefore() ? ppr.getPageBreakBefore() : null; if (ctPageBreak == null) { return false; } return isTruelike(ctPageBreak.getVal(), false); }
/** * Specifies that when rendering this document in a paginated * view, the contents of this paragraph are rendered on the start of a new * page in the document. * <p> * If this element is omitted on a given paragraph, * its value is determined by the setting previously set at any level of the * style hierarchy (i.e. that previous setting remains unchanged). If this * setting is never specified in the style hierarchy, then this property * shall not be applied. Since the paragraph is specified to start on a new * page, it begins page two even though it could have fit on page one. * </p> * * @param pageBreak - * boolean value */ public void setPageBreak(boolean pageBreak) { CTPPr ppr = getCTPPr(); CTOnOff ctPageBreak = ppr.isSetPageBreakBefore() ? ppr .getPageBreakBefore() : ppr.addNewPageBreakBefore(); if (pageBreak) { ctPageBreak.setVal(STOnOff.TRUE); } else { ctPageBreak.setVal(STOnOff.FALSE); } }
/** * Specifies that when rendering this document in a paginated * view, the contents of this paragraph are rendered on the start of a new * page in the document. * <p> * If this element is omitted on a given paragraph, * its value is determined by the setting previously set at any level of the * style hierarchy (i.e. that previous setting remains unchanged). If this * setting is never specified in the style hierarchy, then this property * shall not be applied. Since the paragraph is specified to start on a new * page, it begins page two even though it could have fit on page one. * </p> * * @return boolean - if page break is set */ public boolean isPageBreak() { final CTPPr ppr = getCTPPr(); final CTOnOff ctPageBreak = ppr.isSetPageBreakBefore() ? ppr.getPageBreakBefore() : null; if (ctPageBreak == null) { return false; } return isTruelike(ctPageBreak.getVal(), false); }
/** * Specifies that when rendering this document in a paginated * view, the contents of this paragraph are rendered on the start of a new * page in the document. * <p/> * If this element is omitted on a given paragraph, * its value is determined by the setting previously set at any level of the * style hierarchy (i.e. that previous setting remains unchanged). If this * setting is never specified in the style hierarchy, then this property * shall not be applied. Since the paragraph is specified to start on a new * page, it begins page two even though it could have fit on page one. * </p> * * @return boolean - if page break is set */ public boolean isPageBreak() { CTPPr ppr = getCTPPr(); CTOnOff ct_pageBreak = ppr.isSetPageBreakBefore() ? ppr .getPageBreakBefore() : null; if (ct_pageBreak != null && ct_pageBreak.getVal().intValue() == STOnOff.INT_TRUE) { return true; } return false; }
/** * Specifies that when rendering this document in a paginated * view, the contents of this paragraph are rendered on the start of a new * page in the document. * <p/> * If this element is omitted on a given paragraph, * its value is determined by the setting previously set at any level of the * style hierarchy (i.e. that previous setting remains unchanged). If this * setting is never specified in the style hierarchy, then this property * shall not be applied. Since the paragraph is specified to start on a new * page, it begins page two even though it could have fit on page one. * </p> * * @param pageBreak - * boolean value */ public void setPageBreak(boolean pageBreak) { CTPPr ppr = getCTPPr(); CTOnOff ct_pageBreak = ppr.isSetPageBreakBefore() ? ppr .getPageBreakBefore() : ppr.addNewPageBreakBefore(); if (pageBreak) ct_pageBreak.setVal(STOnOff.TRUE); else ct_pageBreak.setVal(STOnOff.FALSE); }
/** * Specifies that when rendering this document in a paginated * view, the contents of this paragraph are rendered on the start of a new * page in the document. * <p> * If this element is omitted on a given paragraph, * its value is determined by the setting previously set at any level of the * style hierarchy (i.e. that previous setting remains unchanged). If this * setting is never specified in the style hierarchy, then this property * shall not be applied. Since the paragraph is specified to start on a new * page, it begins page two even though it could have fit on page one. * </p> * * @param pageBreak - * boolean value */ public void setPageBreak(boolean pageBreak) { CTPPr ppr = getCTPPr(); CTOnOff ctPageBreak = ppr.isSetPageBreakBefore() ? ppr .getPageBreakBefore() : ppr.addNewPageBreakBefore(); if (pageBreak) { ctPageBreak.setVal(STOnOff.TRUE); } else { ctPageBreak.setVal(STOnOff.FALSE); } }
@Override protected void endVisitPargraph( XWPFParagraph paragraph, IITextContainer parentContainer, IITextContainer paragraphContainer ) throws Exception { // Page Break // Cannot use paragraph.isPageBreak() because it throw NPE because // pageBreak.getVal() can be null. CTPPr ppr = paragraph.getCTP().getPPr(); if ( ppr.isSetPageBreakBefore() ) { CTOnOff pageBreak = ppr.getPageBreakBefore(); if ( pageBreak != null && ( pageBreak.getVal() == null || pageBreak.getVal().intValue() == STOnOff.INT_TRUE ) ) { pdfDocument.newPage(); } } // Paragraph ExtendedParagraph pdfParagraph = (ExtendedParagraph) paragraphContainer; parentContainer.addElement( pdfParagraph.getContainer() ); }
CTOnOff pageBreak = ppr.getPageBreakBefore(); if ( pageBreak != null && ( pageBreak.getVal() == null || pageBreak.getVal().intValue() == STOnOff.INT_TRUE ) )
CTOnOff pageBreak = ppr.getPageBreakBefore(); if ( pageBreak != null && ( pageBreak.getVal() == null || pageBreak.getVal().intValue() == STOnOff.INT_TRUE ) )
CTOnOff pageBreak = ppr.getPageBreakBefore(); if ( pageBreak != null && ( pageBreak.getVal() == null || pageBreak.getVal().intValue() == STOnOff.INT_TRUE ) )