/** * @return pages ordered by page number */ public Collection<XDGFPage> getPages() { return _pages.getPageList(); }
@Override protected void onDocumentRead() { // by the time this gets called, all other document parts should // have been loaded, so it's safe to build the document structure // note that in other onDocumentRead(), relations/etc may not have // loaded yet, so it's not quite safe for (POIXMLDocumentPart part : getRelations()) { // organize the document pieces if (part instanceof XDGFPages) _pages = (XDGFPages) part; else if (part instanceof XDGFMasters) _masters = (XDGFMasters) part; } if (_masters != null) _masters.onDocumentRead(); _pages.onDocumentRead(); }
@Override protected void onDocumentRead() { try { try { _pagesObject = PagesDocument.Factory.parse(getPackagePart().getInputStream()).getPages(); } catch (XmlException | IOException e) { throw new POIXMLException(e); } // this iteration is ordered by page number for (PageType pageSettings: _pagesObject.getPageArray()) { String relId = pageSettings.getRel().getId(); POIXMLDocumentPart pageContentsPart = getRelationById(relId); if (pageContentsPart == null) throw new POIXMLException("PageSettings relationship for " + relId + " not found"); if (!(pageContentsPart instanceof XDGFPageContents)) throw new POIXMLException("Unexpected pages relationship for " + relId + ": " + pageContentsPart); XDGFPageContents contents = (XDGFPageContents)pageContentsPart; XDGFPage page = new XDGFPage(pageSettings, contents, _document, this); contents.onDocumentRead(); _pages.add(page); } } catch (POIXMLException e) { throw XDGFException.wrap(this, e); } }
@Override protected void onDocumentRead() { try { try { _pagesObject = PagesDocument.Factory.parse(getPackagePart().getInputStream()).getPages(); } catch (XmlException | IOException e) { throw new POIXMLException(e); } // this iteration is ordered by page number for (PageType pageSettings: _pagesObject.getPageArray()) { String relId = pageSettings.getRel().getId(); POIXMLDocumentPart pageContentsPart = getRelationById(relId); if (pageContentsPart == null) throw new POIXMLException("PageSettings relationship for " + relId + " not found"); if (!(pageContentsPart instanceof XDGFPageContents)) throw new POIXMLException("Unexpected pages relationship for " + relId + ": " + pageContentsPart); XDGFPageContents contents = (XDGFPageContents)pageContentsPart; XDGFPage page = new XDGFPage(pageSettings, contents, _document, this); contents.onDocumentRead(); _pages.add(page); } } catch (POIXMLException e) { throw XDGFException.wrap(this, e); } }
public long getPageNumber() { return _pages.getPageList().indexOf(this) + 1; }
@Override protected void onDocumentRead() { // by the time this gets called, all other document parts should // have been loaded, so it's safe to build the document structure // note that in other onDocumentRead(), relations/etc may not have // loaded yet, so it's not quite safe for (POIXMLDocumentPart part : getRelations()) { // organize the document pieces if (part instanceof XDGFPages) _pages = (XDGFPages) part; else if (part instanceof XDGFMasters) _masters = (XDGFMasters) part; } if (_masters != null) _masters.onDocumentRead(); _pages.onDocumentRead(); }
/** * @return pages ordered by page number */ public Collection<XDGFPage> getPages() { return _pages.getPageList(); }
public long getPageNumber() { return _pages.getPageList().indexOf(this) + 1; }