# File lib/pdf/writer/object/page.rb, line 56
 56:   def to_s
 57:     res = "\n#{@oid} 0 obj\n<< /Type /Page\n/Parent #{@owner.oid} 0 R"
 58:     unless @annotations.empty?
 59:       res << "\n/Annots ["
 60:       @annotations.each { |e| res << " #{e.oid} 0 R"}
 61:       res << "]"
 62:     end
 63: 
 64:     if @contents.size == 1
 65:       res << "\n/Contents #{@contents[0].oid} 0 R"
 66:     else
 67:       res << "\n/Contents [\n"
 68:       @contents.each { |c| res << "#{c.oid} 0 R\n" }
 69:       res << "]"
 70:     end
 71: 
 72:       # MediaBox::  rectangle (Required; inheritable). A rectangle (see
 73:       #             Section 3.8.4, “Rectangles”), expressed in default user
 74:       #             space units, defining the boundaries of the physical
 75:       #             medium on which the page is intended to be displayed or
 76:       #             printed (see Section 10.10.1, “Page Boundaries”). 
 77:     res << "\n/MediaBox [#{@media_box.join(' ')}]" unless @media_box.nil? or @media_box.empty?
 78:       # CropBox::   rectangle (Optional; inheritable) A rectangle, expressed
 79:       #             in default user space units, defining the visible region
 80:       #             of default user space. When the page is displayed or
 81:       #             printed, its contents are to be clipped (cropped) to
 82:       #             this rectangle and then imposed on the output medium in
 83:       #             some implementation-defined manner (see Section 10.10.1,
 84:       #             “Page Boundaries”). Default value: the value of MediaBox. 
 85:     res << "\n/CropBox [#{@crop_box.join(' ')}]" unless @crop_box.nil? or @crop_box.empty?
 86:       # BleedBox::  rectangle (Optional; PDF 1.3) A rectangle, expressed in
 87:       #             default user space units, defining the region to which
 88:       #             the contents of the page should be clipped when output
 89:       #             in a production environment (see Section 10.10.1, “Page
 90:       #             Boundaries”). Default value: the value of CropBox. 
 91:     res << "\n/BleedBox [#{@bleed_box.join(' ')}]" unless @bleed_box.nil? or @bleed_box.empty?
 92:       # TrimBox::   rectangle (Optional; PDF 1.3) A rectangle, expressed in
 93:       #             default user space units, defining the intended
 94:       #             dimensions of the finished page after trimming (see
 95:       #             Section 10.10.1, “Page Boundaries”). Default value: the
 96:       #             value of CropBox. 
 97:     res << "\n/TrimBox [#{@trim_box.join(' ')}]" unless @trim_box.nil? or @trim_box.empty?
 98:       # ArtBox::    rectangle (Optional; PDF 1.3) A rectangle, expressed in
 99:       #             default user space units, defining the extent of the
100:       #             page’s meaningful content (including potential white
101:       #             space) as intended by the page’s creator (see Section
102:       #             10.10.1, “Page Boundaries”). Default value: the value of
103:       #             CropBox. 
104:     res << "\n/ArtBox [#{@art_box.join(' ')}]" unless @art_box.nil? or @art_box.empty?
105: 
106:     res << "\n>>\nendobj"
107:   end