         
         _document = page.document
         
-        _documentHandle = _document!._documentHandle
+        _documentHandle = _document._documentHandle
     }
     
     internal func _cleanup() {

             Encoding.gbEucCnVertical,
             Encoding.gbkEucHorisontal,
             Encoding.gbkEucVertical:
            _document?._useCNSEncodings()
        case Encoding.eTenB5Vertical,
             Encoding.eTenB5Horisontal:
            _document?._useCNTEncodings()
        case Encoding.rksjHorisontal,
             Encoding.rksjVertical,
             Encoding.rksjHorisontalProportional,
             Encoding.eucHorisontal,
             Encoding.eucVertical:
            _document?._useJPEncodings()
        case Encoding.kscEucHorisontal,
             Encoding.kscEucVertical,
             Encoding.kscMsUhcProportional,
             Encoding.kscMsUhsVerticalFixedWidth,
             Encoding.kscMsUhsHorisontalFixedWidth:
            _document?._useKREncodings()
        case Encoding.utf8:
            _document?._useUTFEncodings()
        default:
            return
        }

#endif
import Foundation

/// The `DrawingContext` class represents a PDF drawing destination.
///
/// You cannot initialize the context directly. You need to call the `PDFPage.draw(_:)` method; an instance
/// of `DrawingContext` will be passed to the provided closure. That instance is only valid during the lifetime
/// of that closure.
///
/// Each instance of `DrawingContext` is bound to some `PDFPage`, hence you can use it to perform
/// drawing operations on only one page.
public final class DrawingContext {
    
    private unowned var _document: PDFDocument
    private var __page: HPDF_Page
    private var _documentHandle: HPDF_Doc
    private var _isInvalidated = false
