/** * @since 2.7 */ public PageDimensions(PgSz pgSz, PgMar pgMar) { init(pgSz, pgMar, null); }
public DocumentModel getDocumentModel() { if (documentModel==null) { documentModel = new DocumentModel(this); } return documentModel; }
private HeaderPart getDummyHeader() { if (dummyHeader == null) { createDummyHeaderFooter(); } return dummyHeader; }
@Deprecated public HeaderFooterPolicy getHeaderFooterPolicy() { int last = getDocumentModel().getSections().size(); if (last>0) { // Should always be the case, since we add one, // even if the document contains no sectPr return getDocumentModel().getSections().get(last-1).getHeaderFooterPolicy(); } else { log.error("Unexpected - zero sections?!"); return null; } }
public static boolean hasDefaultHeaderOrFooter(AbstractWmlConversionContext context) { ConversionSectionWrapper currentSection = context.getSections().getCurrentSection(); return (currentSection.getHeaderFooterPolicy().getDefaultHeader()!=null) || (currentSection.getHeaderFooterPolicy().getDefaultFooter()!=null); }
public static boolean hasDefaultHeader(AbstractWmlConversionContext context) { ConversionSectionWrapper currentSection = context.getSections().getCurrentSection(); return (currentSection.getHeaderFooterPolicy().getDefaultHeader() != null); }
public static boolean hasEvenHeader(AbstractWmlConversionContext context) { ConversionSectionWrapper currentSection = context.getSections().getCurrentSection(); return (currentSection.getHeaderFooterPolicy().getEvenHeader() != null); }
public static boolean hasDefaultFooter(AbstractWmlConversionContext context) { ConversionSectionWrapper currentSection = context.getSections().getCurrentSection(); return (currentSection.getHeaderFooterPolicy().getDefaultFooter() != null); }
public TocEntry(PropertyResolver propertyResolver, PageDimensions pageDimensions, STTabTlc leader) { this.propertyResolver = propertyResolver; this.writableWidthTwips = pageDimensions.getWritableWidthTwips(); this.leader = leader; }
protected SectionWrapper(SectPr sectPr, HeaderFooterPolicy previousHF, RelationshipsPart rels, BooleanDefaultTrue evenAndOddHeaders) { // This should work even if sectPr is null this.sectPr = sectPr; if (sectPr==null) { log.warn("No (document level?) sectPr!"); } this.headerFooterPolicy = new HeaderFooterPolicy(sectPr, previousHF, rels, evenAndOddHeaders); page = new PageDimensions(sectPr); }
public static boolean hasFirstFooter(AbstractWmlConversionContext context) { ConversionSectionWrapper currentSection = context.getSections().getCurrentSection(); return (currentSection.getHeaderFooterPolicy().getFirstFooter() != null); }
public static boolean hasEvenFooter(AbstractWmlConversionContext context) { ConversionSectionWrapper currentSection = context.getSections().getCurrentSection(); return (currentSection.getHeaderFooterPolicy().getEvenFooter() != null); }
/** * set Margins from docx4j.properties * * @since 2.8 */ public void setMargins() { String margin= Docx4jProperties.getProperties().getProperty("docx4j.PageMargins", "NORMAL"); setMargins(MarginsWellKnown.valueOf(margin)); // if (margin.equals("normal")) { // setMargins(MarginsWellKnown.NORMAL); // } else if (margin.equals("narrow")) { // setMargins(MarginsWellKnown.NARROW); // } else if (margin.equals("moderate")) { // setMargins(MarginsWellKnown.MODERATE); // } else if (margin.equals("wide")) { // setMargins(MarginsWellKnown.WIDE); // } else { // log.warn("Unknown margin setting " + margin + "in docx4j.properties"); // setMargins(MarginsWellKnown.NORMAL); // } }
/** * set page size/orientation from docx4j.properties * @since 2.8 */ public void setPgSize() { String papersize= Docx4jProperties.getProperties().getProperty("docx4j.PageSize", "A4"); log.debug("Using paper size: " + papersize); String landscapeString = Docx4jProperties.getProperties().getProperty("docx4j.PageOrientationLandscape", "false"); boolean landscape= Boolean.parseBoolean(landscapeString); log.debug("Landscape orientation: " + landscape); setPgSize(PageSizePaper.valueOf(papersize), landscape); } /**
public PageDimensions() { pgSz = Context.getWmlObjectFactory().createSectPrPgSz(); setPgSize(); pgMar = Context.getWmlObjectFactory().createSectPrPgMar(); setMargins(); }
public DocumentModel(WordprocessingMLPackage wordMLPackage) { this.wordMLPackage = wordMLPackage; refresh(); }
public static void setCurrentPartDefaultHeader(AbstractWmlConversionContext context) { ConversionSectionWrapper currentSection = context.getSections().getCurrentSection(); context.setCurrentPart(currentSection.getHeaderFooterPolicy().getDefaultHeader()); }
public static void setCurrentPartDefaultFooter(AbstractWmlConversionContext context) { ConversionSectionWrapper currentSection = context.getSections().getCurrentSection(); context.setCurrentPart(currentSection.getHeaderFooterPolicy().getDefaultFooter()); }
private FooterPart getDummyFooter() { if (dummyFooter == null) { createDummyHeaderFooter(); } return dummyFooter; }