Example #1
0
        internal DocumentData(Document document, DocumentType type)
            : base("Document")
        {
            Debug.Assert(document != null);

            _documentType = type;

            _pages = new Pages(document);

            _masterPages = new MasterPages(document);

            _pageAnnotationFieldSet = new AnnotationFieldSet(document, "PageAnnotationFieldSet");

            _widgetAnnotationFieldSet = new AnnotationFieldSet(document, "WidgetAnnotationFieldSet");

            _widgetDefaultStyleSet = new WidgetDefaultStyleSet(document);

            _generatorConfigurationSet = new GeneratorConfigurationSet(document);

            _adaptiveViewSet = new AdaptiveViewSet(document);

            _deviceSet = new DeviceSet(document);

            _documentSettings = new DocumentSettings(document);

            _globalGuides = new Guides();
        }
Example #2
0
        public IMasterPage DuplicateMasterPage(Guid pageGuid)
        {
            CheckOpen();

            if (!MasterPages.Contains(pageGuid))
            {
                throw new ArgumentException("pageGuid");
            }

            Serializer writer     = new Serializer(_workingDirectoryGuid, Guid.Empty, _workingImagesDirectory);
            MasterPage sourcePage = MasterPages[pageGuid] as MasterPage;

            writer.AddMasterPage(sourcePage);

            IMasterPage newPage = null;

            using (Stream stream = writer.WriteToStream())
            {
                IObjectContainer container = AddMasterPages(stream);
                if (container.MasterPageList.Count > 0)
                {
                    newPage = container.MasterPageList[0];
                }
            }

            newPage.IsLockedToMasterLocation = sourcePage.IsLockedToMasterLocation;

            return(newPage);
        }