/** * Convenience method to getBody().getContent() * @since 2.7 */ public List<Object> getContent() { return getBody().getContent(); }
private static void movePageBreaks(Body body) { List<Object> elts = body.getContent(); for (Object o : elts) { if (o instanceof P) { updateParagraph((P)o); } } }
return getContent();
private static void moveSectPr(Body body) { || body.getContent().size()==0) { log.warn("w:document/w:body null or empty"); return; Object o = body.getContent().get(0); pasteSectPr(body.getContent(), sectPr); log.info("Moved sectPr to new P"); return;
public static void process(WordprocessingMLPackage wmlPackage) { Body body = wmlPackage.getMainDocumentPart().getJaxbElement().getBody(); if (body==null || body.getContent().size()==0) { log.warn("w:document/w:body null or empty"); return; } Object o = body.getContent().get(0); if (o instanceof P && ((P)o).getPPr()!=null) { PPr pPr = ((P)o).getPPr(); BooleanDefaultTrue val = new BooleanDefaultTrue(); val.setVal(Boolean.FALSE); pPr.setPageBreakBefore(val); } } }
new TraversalUtil(body.getContent(), finder); SdtBlock sdt = finder.tocSDT; if(sdt != null){ List<Object> sublist = body.getContent().subList(index, body.getContent().size()); // end is exclusive SectPrFindFirst sf = new SectPrFindFirst(); new TraversalUtil(sublist, sf); body.getContent().add(index, sdt); return generateToc( sdt, instruction, leader, skipPageNumbering);
private void process() { propertyResolver = wmlPackage.getMainDocumentPart().getPropertyResolver(); List<Object> newContent = process(wmlPackage.getMainDocumentPart().getContent()); wmlPackage.getMainDocumentPart().getJaxbElement().getBody().getContent().clear(); wmlPackage.getMainDocumentPart().getJaxbElement().getBody().getContent().addAll(newContent); }
/** The dummy section wrappers only contains one section with all the document. Therefore * any sections within the document are ignored in the conversion process. As it doesn't * need to check for sections it is faster and the html-Output only uses one section.<br> * It will use the Header/Footer of the body sectPr. This isn't correct, if there are * several Sections in the document, but to find the correct SectPr it would need to check * the document content - and the aim of this method is a low overhead. * * @param wmlPackage * @param dummyPageNumbering * @return */ protected static List<ConversionSectionWrapper> processDummy(WordprocessingMLPackage wmlPackage, Document document, RelationshipsPart rels, BooleanDefaultTrue evenAndOddHeaders, boolean dummyPageNumbering) { log.debug("starting"); List<ConversionSectionWrapper> conversionSections = new ArrayList<ConversionSectionWrapper>(); ConversionSectionWrapper currentSectionWrapper = null; HeaderFooterPolicy previousHF = new HeaderFooterPolicy(document.getBody().getSectPr(), null, rels, evenAndOddHeaders); // SectionWrapper does work where sectPr is null (ie document has no body level sectPr), // so document.getBody().getSectPr() is ok currentSectionWrapper = createSectionWrapper( document.getBody().getSectPr(), previousHF, rels, evenAndOddHeaders, 1, document.getBody().getContent(), dummyPageNumbering); conversionSections.add(currentSectionWrapper); return conversionSections; }
for (Object o : document.getBody().getContent() ) { List<Object> all = document.getBody().getContent(); Object last = all.get( all.size()-1 ); if (last instanceof P
new TraversalUtil(body.getContent(), finder);
groupAdjacentBorders(mainDocument.getJaxbElement().getBody().getContent());
shell.getContent().addAll(contentList); Body shellClone = (Body) XmlUtils.deepCopy(shell); return shellClone.getContent();
shell.getContent().addAll(contentList); Body shellClone = (Body)XmlUtils.deepCopy(shell); return shellClone.getContent();
for (Object o : document.getBody().getContent() ) {
Body body = wmlDocumentEl.getBody(); List <Object> bodyChildren = body.getContent();
Body body = wmlDocumentEl.getBody(); List <Object> bodyChildren = body.getContent();
/** * Convenience method to getBody().getContent() * @since 2.7 */ public List<Object> getContent() { return getBody().getContent(); }
private static void movePageBreaks(Body body) { List<Object> elts = body.getContent(); for (Object o : elts) { if (o instanceof P) { updateParagraph((P)o); } } }
private void process() { propertyResolver = wmlPackage.getMainDocumentPart().getPropertyResolver(); List<Object> newContent = process(wmlPackage.getMainDocumentPart().getContent()); wmlPackage.getMainDocumentPart().getJaxbElement().getBody().getContent().clear(); wmlPackage.getMainDocumentPart().getJaxbElement().getBody().getContent().addAll(newContent); }
/** * @param reader * @param baseUrl * @param wordMLPackage * @return * @throws IOException */ public List<Object> convert(Reader reader, String baseUrl) throws Docx4JException { renderer = getRenderer(); Document dom = XMLResource.load(reader).getDocument(); renderer.setDocument(dom, baseUrl); renderer.layout(); traverse(renderer.getRootBox(), null); return imports.getContent(); }