Inserts a page at position _index_ into the document.
 _index_:: Page index (starting from one).
 _page_:: The page to insert into the document. Creates a new one if none given.

 Pass the Page object if a block is present.
186929
def insert_page(index, page = Page.new)
            init_page_tree

            # Page from another document must be exported.
            page = page.export if page.document and page.document != self

            self.Catalog.Pages.insert_page(index, page)

            yield(page) if block_given?

            self
        end
802748
function insertContent(pageNum) {
        var $pageOverlay = $pages.eq(pageNum - 1).find('.crocodoc-page-autoscale');
        var $content = $(util.template(config.template, {
            pageNum: pageNum
        }));

        // listen for click events on the buttons
        $content.find('.add-page-btn').on('click', function (event) {
            addPage(pageNum);
            event.stopPropagation();
        });
        $content.find('.remove-page-btn').on('click', function (event) {
            removePage(pageNum);
            event.stopPropagation();
        });

        $pageOverlay.append($content);
    }
1028491
def insert(self, index, filename):
        """"""
        base = self._base
        dct = {'__module__': base.__module__, 'filename': filename, '_stack': self}
        cls = type(base.__name__, (base,), dct)

        self._map[cls.filename] = cls
        self._classes.insert(index, cls)
795843
def display_page(page)
    load_page(page)

    puts

    start = (page - 1) * Page::LENGTH + 1
    start.upto(start + Page::LENGTH - 1) do |i|
      puts "#{i} - #{Problem[i].title}" unless i >= Problem.total - 9
    end
  end
408382
function (pageIndex, options, callback) {

            if (pageIndex < 0) {
                throw "pageIndex must be >= 0";
            }

            var page = this.$pageCache[pageIndex];
            if (!page) {
                page = this.$pageCache[pageIndex] = new Page(null, this, pageIndex);
            }

            var self = this;
            options = _.extend(this.$, options);
            page.fetch(options, function (err, page) {
                // insert data into items if not already inserted
                if (!err && !page.itemsInsertedIntoCollection) {
                    page.itemsInsertedIntoCollection = true;

                    // add items to collection
                    self.add(page.$items, {
                        index: (pageIndex || 0) * self.$.pageSize
                    });
                }

                if (callback) {
                    callback(err, page, options);
                }
            });
        }
389624
def insert(self, index, value):
        
        def insert_trans(pipe):
            len_self = self.__len__(pipe)
            if (self.maxlen is not None) and (len_self >= self.maxlen):
                raise IndexError

            if index == 0:
                self._insert_left(value, pipe)
            else:
                self._insert_middle(index, value, pipe=pipe)

        self._transaction(insert_trans)
502416
def new_page(mediabox = [0, 0, 612.0, 792.0], _location = -1)
      p = PDFWriter.new(mediabox)
      insert(-1, p)
      p
    end
1267820
def on(page_class, browser = @browser)
      page = page_class.new(browser)
      yield page if block_given?
      page
    end
55749
def append_page(page = Page.new)
            init_page_tree

            self.Catalog.Pages.append_page(page)
            yield(page) if block_given?

            self
        end
453134
def add_page(self, page, default = True):
        
        """
        self._pages[page.page_id] = page
        page._add_display(self)
        if default or not self._active_page:
            self._active_page = page
358944
protected void initPage() throws DocumentException {
        // the pagenumber is incremented
        pageN++;

        // initialization of some page objects
        annotationsImp.resetAnnotations();
        pageResources = new PageResources();

        writer.resetContent();
        graphics = new PdfContentByte(writer);
        text = new PdfContentByte(writer);
        text.reset();
        text.beginText();
        textEmptySize = text.size();

    	markPoint = 0;
        setNewPageSizeAndMargins();
        imageEnd = -1;
        indentation.imageIndentRight = 0;
        indentation.imageIndentLeft = 0;
        indentation.indentBottom = 0;
        indentation.indentTop = 0;
        currentHeight = 0;

        // backgroundcolors, etc...
        thisBoxSize = new HashMap(boxSize);
        if (pageSize.getBackgroundColor() != null
        || pageSize.hasBorders()
        || pageSize.getBorderColor() != null) {
            add(pageSize);
        }

        float oldleading = leading;
        int oldAlignment = alignment;
        // if there is a footer, the footer is added
        doFooter();
        // we move to the left/top position of the page
        text.moveText(left(), top());
        doHeader();
        pageEmpty = true;
        // if there is an image waiting to be drawn, draw it
        try {
            if (imageWait != null) {
                add(imageWait);
                imageWait = null;
            }
        }
        catch(Exception e) {
            throw new ExceptionConverter(e);
        }
        leading = oldleading;
        alignment = oldAlignment;
        carriageReturn();

        PdfPageEvent pageEvent = writer.getPageEvent();
        if (pageEvent != null) {
            if (firstPageEvent) {
                pageEvent.onOpenDocument(writer, this);
            }
            pageEvent.onStartPage(writer, this);
        }
        firstPageEvent = false;
    }
1138132
def insert(self, index, value):
        ''''''
        newnode = LookupTreeNode(index, value)
        level = 0
        node = self.root
        while True:
            ind = _getbits(newnode.index, level)
            level += 1
            child = node.children[ind]
            if child is None or child.index == newnode.index:
                if child:
                    assert child.value == newnode.value
                node.children[ind] = newnode
                break
            elif child.index == _root_index:
                # This is a branch
                node = child
            else:
                branch = LookupTreeNode()
                nind = _getbits(newnode.index, level)
                cind = _getbits(child.index, level)
                node.children[ind] = branch

                # Life gets tricky when...
                if nind == cind:
                    branch.children[cind] = child
                    # recurse
                    node = branch
                else:
                    branch.children[nind] = newnode
                    branch.children[cind] = child
                    break
726887
def insertLink(page, lnk, mark = True):
    
    CheckParent(page)
    annot = getLinkText(page, lnk)
    if annot == "":
        raise ValueError("link kind not supported")

    page._addAnnot_FromString([annot])
    return
469498
def insert_tab index, title, config={}, &block
      @tabs.insert(index, Tab.new(title, self, config, &block) )
    end
562838
public void insert(final Widget page, final Widget tab, final int beforeIndex) {
        final String text = (tab instanceof HasText) ? ((HasText) tab).getText() : "Tab #" + beforeIndex;

        if (beforeIndex < PAGE_LIMIT - 1) {
            // visible pages
            Tab t = tabs.add(text, beforeIndex);
            super.insert(page, t, beforeIndex);

        } else if (beforeIndex == PAGE_LIMIT - 1) {
            // last visible page
            Tab t = tabs.add(text, beforeIndex);
            offPageContainer.add(new OffPageText(0, text), page);
            super.insert(offPageContainer.asWidget(), t, beforeIndex);

        } else {
            // off page - don't use beforeIndex as it'll always be PAGE_LIMIT
            int last = offPageContainer.size();
            offPageContainer.add(new OffPageText(last, text), page);
            tabs.showSelector();
        }
    }
182328
function Page(page) {
  if (!page) page = {};
  for (var key in page) this[key] = page[key];
  if (!this.hasOwnProperty('idx')) this.idx = 0;
  if (!this.hasOwnProperty('total')) this.total = 1;
  if (!this.hasOwnProperty('current')) {
    this.current = this.total;
  }
}
887751
def create_tab(self, location=None):
        
        eb = self._get_or_create_editor_buffer(location)

        self.tab_pages.insert(self.active_tab_index + 1, TabPage(Window(eb)))
        self.active_tab_index += 1