def __init__(self, doc, pageid, attrs):
self.doc = doc<EOL>self.pageid = pageid<EOL>self.attrs = dict_value(attrs)<EOL>self.lastmod = resolve1(self.attrs.get('<STR_LIT>'))<EOL>self.resources = resolve1(self.attrs.get('<STR_LIT>', dict()))<EOL>self.mediabox = resolve1(self.attrs['<STR_LIT>'])<EOL>if '<STR_LIT>' in self.attrs:<EOL><INDENT>self.cropbox = resolve1(self.attrs['<STR_LIT>'])<EOL><DEDENT>else:<EOL><INDENT>self.cropbox = self.mediabox<EOL><DEDENT>self.rotate = (int_value(self.attrs.get('<STR_LIT>', <NUM_LIT:0>))+<NUM_LIT>) % <NUM_LIT><EOL>self.annots = self.attrs.get('<STR_LIT>')<EOL>self.beads = self.attrs.get('<STR_LIT:B>')<EOL>if '<STR_LIT>' in self.attrs:<EOL><INDENT>contents = resolve1(self.attrs['<STR_LIT>'])<EOL><DEDENT>else:<EOL><INDENT>contents = []<EOL><DEDENT>if not isinstance(contents, list):<EOL><INDENT>contents = [contents]<EOL><DEDENT>self.contents = contents<EOL>return<EOL>
Initialize a page object.

        doc: a PDFDocument object.
        pageid: any Python object that can uniquely identify the page.
        attrs: a dictionary of page attributes.