Example #1
0
        XpsSerializationManager(
            BasePackagingPolicy packagingPolicy,
            bool batchMode
            ) :
            base()
        {
            this._packagingPolicy = packagingPolicy;
            this._isBatchMode     = batchMode;
            this._isSimulating    = false;
            this._simulator       = null;

            _reachSerializationServices = new ReachSerializationServices();
            _visualSerializationService = new VisualSerializationService(this);

            _reachSerializationServices.RegisterNameSpacesForTypes();
            _reachSerializationServices.RegisterSerializableDependencyPropertiesForReachTypes();
            _reachSerializationServices.RegisterNoneSerializableClrPropertiesForReachTypes();

            XpsResourcePolicy resourcePolicy = new XpsResourcePolicy(XpsResourceSharing.NoResourceSharing);

            resourcePolicy.RegisterService(new XpsImageSerializationService(), typeof(XpsImageSerializationService));
            resourcePolicy.RegisterService(new XpsFontSerializationService(packagingPolicy), typeof(XpsFontSerializationService));

            this._resourcePolicy = resourcePolicy;
            _documentNumber      = 0;
            _pageNumber          = 0;
            _documentStartState  = false;
            _pageStartState      = false;

            XpsPackagingPolicy xpsPackagingPolicy = _packagingPolicy as XpsPackagingPolicy;

            if (xpsPackagingPolicy != null)
            {
                _xpsDocEventManager = new XpsDriverDocEventManager(this);

                xpsPackagingPolicy.PackagingProgressEvent += new PackagingProgressEventHandler(_xpsDocEventManager.ForwardPackagingProgressEvent);

                this.XpsSerializationPrintTicketRequiredOnXpsDriverDocEvent += new XpsSerializationPrintTicketRequiredEventHandler(_xpsDocEventManager.ForwardUserPrintTicket);
            }
        }
Example #2
0
        XpsOMSerializationManager(
            XpsOMPackagingPolicy xpsOMManager,
            bool batchMode
            ) :
            base()
        {
            _packagingPolicy = xpsOMManager;
            _isBatchMode     = batchMode;

            _reachSerializationServices = new ReachSerializationServices();
            _reachSerializationServices.RegisterNameSpacesForTypes();
            _reachSerializationServices.RegisterSerializableDependencyPropertiesForReachTypes();
            _reachSerializationServices.RegisterNoneSerializableClrPropertiesForReachTypes();
            _visualSerializationService = new VisualSerializationService(this);

            XpsResourcePolicy resourcePolicy = new XpsResourcePolicy(XpsResourceSharing.NoResourceSharing);

            resourcePolicy.RegisterService(new XpsImageSerializationService(), typeof(XpsImageSerializationService));
            resourcePolicy.RegisterService(new XpsFontSerializationService(_packagingPolicy), typeof(XpsFontSerializationService));
            _resourcePolicy = resourcePolicy;

            SetFontSubsettingPolicy(FontSubsetterCommitPolicies.CommitPerPage);
            SetFontSubsettingCountPolicy(4);
        }