Ejemplo n.º 1
0
        /// <summary>
        /// Dispatches PrepareForSave to the objects that need it.
        /// </summary>
        internal override void PrepareForSave()
        {
            // Prepare pages.
            if (_pages != null)
            {
                _pages.PrepareForSave();
            }

            // Create outline objects.
            if (AcroForm != null)
            {
                AcroForm.PrepareForSave();
            }

            if (_outline != null && _outline.Outlines.Count > 0)
            {
                if (Elements[Keys.PageMode] == null)
                {
                    PageMode = PdfPageMode.UseOutlines;
                }
                _outline.PrepareForSave();
            }

            // Clean up structure tree root.
            PdfStructureTreeRoot str = Elements.GetObject(Keys.StructTreeRoot) as PdfStructureTreeRoot;

            if (str != null)
            {
                str.PrepareForSave();
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Dispatches PrepareForSave to the objects that need it.
        /// </summary>
        internal override void PrepareForSave()
        {
            if (_pages != null)
            {
                _pages.PrepareForSave();
            }

            if (_outline != null && _outline.Outlines.Count > 0)
            {
                if (Elements[Keys.PageMode] == null)
                {
                    PageMode = PdfPageMode.UseOutlines;
                }
                _outline.PrepareForSave();
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Dispatches PrepareForSave to the objects that need it.
        /// </summary>
        internal override void PrepareForSave()
        {
            // Prepare pages.
            if (_pages != null)
            {
                _pages.PrepareForSave();
            }

            // Create outline objects.
            if (_outline != null && _outline.Outlines.Count > 0)
            {
                if (Elements[Keys.PageMode] == null)
                {
                    PageMode = PdfPageMode.UseOutlines;
                }
                _outline.PrepareForSave();
                if (_acroForm != null)
                {
                    _acroForm.PrepareForSave();
                }
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Dispatches PrepareForSave to the objects that need it.
        /// </summary>
        internal override void PrepareForSave()
        {
            var pages = _pages;

            //We need the pages when saving but they are available only when CanModify yet when Pages is populated, the ability to modify may become possible even when !CanModify.
            //By using a local copy of PdfPages, we can switch to an unexposed copy during !CanModify.
            if (!Owner.CanModify && _pages == null)
            {
                pages = (PdfPages)Elements.GetValue(Keys.Pages, VCF.CreateIndirect);
                if (Owner.IsImported)
                {
                    pages.FlattenPageTree();
                }
            }

            // Prepare pages.
            if (pages != null)
            {
                pages.PrepareForSave();
            }

            // Create outline objects.
            if (_outline != null && _outline.Outlines.Count > 0)
            {
                if (Elements[Keys.PageMode] == null)
                {
                    PageMode = PdfPageMode.UseOutlines;
                }
                _outline.PrepareForSave();
            }

            // Clean up structure tree root.
            PdfStructureTreeRoot str = Elements.GetObject(Keys.StructTreeRoot) as PdfStructureTreeRoot;

            if (str != null)
            {
                str.PrepareForSave();
            }
        }