Exemplo n.º 1
0
 /// <summary>Moves structure associated with specified page and insert it in a specified position in the document.
 ///     </summary>
 /// <remarks>
 /// Moves structure associated with specified page and insert it in a specified position in the document.
 /// <br/><br/>
 /// NOTE: Works only for document with not flushed pages.
 /// </remarks>
 /// <param name="fromPage">page which tag structure will be moved</param>
 /// <param name="insertBeforePage">indicates before tags of which page tag structure will be moved to</param>
 public virtual void Move(PdfPage fromPage, int insertBeforePage)
 {
     for (int i = 1; i <= GetDocument().GetNumberOfPages(); ++i)
     {
         if (GetDocument().GetPage(i).IsFlushed())
         {
             throw new PdfException(MessageFormatUtil.Format(PdfException.CannotMovePagesInPartlyFlushedDocument, i));
         }
     }
     StructureTreeCopier.Move(GetDocument(), fromPage, insertBeforePage);
 }
Exemplo n.º 2
0
 /// <summary>
 /// Copies structure to a
 /// <paramref name="destDocument"/>
 /// and insert it in a specified position in the document.
 /// NOTE: Works only for
 /// <see cref="PdfStructTreeRoot"/>
 /// that is read from the document opened in reading mode,
 /// otherwise an exception is thrown.
 /// </summary>
 /// <param name="destDocument">document to copy structure to.</param>
 /// <param name="insertBeforePage">indicates where the structure to be inserted.</param>
 /// <param name="page2page">association between original page and copied page.</param>
 public virtual void CopyTo(PdfDocument destDocument, int insertBeforePage, IDictionary <PdfPage, PdfPage> page2page
                            )
 {
     StructureTreeCopier.CopyTo(destDocument, insertBeforePage, page2page, GetDocument());
 }