I'm trying to create a new document consisting of first pages of other documents.
The problem I'm encountering is that I don't see a way to filter source document elements to only ones that start and end on first page.
This is the code that shows types of all highest level elements of document. Is there any way to filter them, so only ones of first page are included?
var body = doc.getBody();
for(var i = 0; i < body.getNumChildren();i++){
var child = parent.getChild(i);
Logger.log(child.getType());
}
I cannot rely on a fact that first page ends with page break, if it is, task is easy.