# Path: pypdflite/pdfobjects/pdfobject.py
# class _PDFObject(object):
# 
#     """ Mainly used in Session, to maintain
#         ids and byte counts for the objects
#         in session.buffer.
# 
#     """
# 
#     def __init__(self, given_id, offset):
#         self.id = given_id
#         self.offset = offset


import os
from .pdfobjects.pdfobject import _PDFObject

    def _set_compression(self, value):
        """ May be used to compress PDF files. Code is more readable
            for testing and inspection if not compressed. Requires a boolean. """
        if isinstance(value, bool):
            self.compression = value
        else:
            raise Exception(
                TypeError, "%s is not a valid option for compression" % value)

    # Objects
    def _create_placeholder_objects(self):
        """ PDF objects #1 through #3 are typically saved for the
            Zeroth, Catalog, and Pages Objects. This program will save
            the numbers, but outputs the individual Page and Content objects
            first. The actual Catalog and Pages objects are calculated after.

        """
        self.objects.append("Zeroth")
        self.objects.append("Catalog")
        self.objects.append("Pages")

    def _add_object(self, flag=None):
        """ The flag is a simple integer to force the placement
            of the object into position in the object array.
            Used for overwriting the placeholder objects.

        """
        self.offset = len(self.buffer)
        if flag is None:
            objnum = len(self.objects)

# Path: pypdflite/pdfobjects/pdfobject.py
# class _PDFObject(object):
# 
#     """ Mainly used in Session, to maintain
#         ids and byte counts for the objects
#         in session.buffer.
# 
#     """
# 
#     def __init__(self, given_id, offset):
#         self.id = given_id
#         self.offset = offset


# Path: pypdflite/session.py
import os
from .pdfobjects.pdfobject import _PDFObject

    def _set_compression(self, value):
        """ May be used to compress PDF files. Code is more readable
            for testing and inspection if not compressed. Requires a boolean. """
        if isinstance(value, bool):
            self.compression = value
        else:
            raise Exception(
                TypeError, "%s is not a valid option for compression" % value)

    # Objects
    def _create_placeholder_objects(self):
        """ PDF objects #1 through #3 are typically saved for the
            Zeroth, Catalog, and Pages Objects. This program will save
            the numbers, but outputs the individual Page and Content objects
            first. The actual Catalog and Pages objects are calculated after.

        """
        self.objects.append("Zeroth")
        self.objects.append("Catalog")
        self.objects.append("Pages")

    def _add_object(self, flag=None):
        """ The flag is a simple integer to force the placement
            of the object into position in the object array.
            Used for overwriting the placeholder objects.

        """
        self.offset = len(self.buffer)
        if flag is None:
            objnum = len(self.objects)

            obj = _PDFObject(objnum, self.offset)
