Jak usunąć puste strony w dokumencie wielostronicowym?

EDYCJA: dodano odpowiedź, ponieważ edycja byłaby długa (patrz odpowiedź2)

Po abyły post o scalaniu dokumentów Skończyłem na działającym skrypcie (Thanks Henrique;), ale nadal mam jeden mały problem: końcowy „scalony” dokument zawiera czasami puste strony (w zależności od innych dokumentów), które chciałbym usunąć. Nie mogę znaleźć łatwego sposobu, aby to zrobić. Skrypt wygląda tak:

function mergeDocs(docIDs) {  // parameter docIDs is an array of Doc IDs
  var baseDocname = DocumentApp.openById(docIDs[0]).getName();// typical name = IMPRESSION_page_07_07-06-2012__20:57
  var modelDoc = DocsList.getFileById(docIDs[0]);
  var newmodelName=baseDocname.substr(0,11)+'multipage'+baseDocname.substring(18);
  var baseDocId = DocsList.copy(modelDoc,newmodelName).getId();// make a copy of firstelement and give it new basedocname build from the serie(to keep margins etc...)
  var baseDoc = DocumentApp.openById(baseDocId)
  var body = baseDoc.getActiveSection();
//
  for( var i = 0; i < docIDs.length; ++i ) {
    var otherCopy = DocumentApp.openById(docIDs[i]).getActiveSection();
    var totalElements = otherCopy.getNumChildren();
    for( var j = 0; j < totalElements; ++j ) {
      var element = otherCopy.getChild(j).copy();
      var type = element.getType();
      if( type == DocumentApp.ElementType.PARAGRAPH )
        body.appendParagraph(element);
      else if( type == DocumentApp.ElementType.TABLE )
        body.appendTable(element);
      else if( type == DocumentApp.ElementType.LIST_ITEM )
        body.appendListItem(element);
      else
        throw new Error("According to the doc this type couldn't appear in the body: "+type);
    }
     body.appendPageBreak(); // if content length is too short avoids breaking page layout
  }
}

„PageBreak” powoduje (czasami) pustą stronę, wiem o tym (!), Ale konieczne jest zachowanie idealnego układu strony (drukuję etykiety z tym dokumentem). tutaj jestlink do typowego przykładu

questionAnswers(2)

yourAnswerToTheQuestion