iTextSharp.text.pdf.PdfStructureElement.SetPageMark C# (CSharp) Метод

SetPageMark() приватный Метод

private SetPageMark ( int page, int mark ) : void
page int
mark int
Результат void
        internal void SetPageMark(int page, int mark)
        {
            if (mark >= 0)
                Put(PdfName.K, new PdfNumber(mark));
            if (parent == null)
                top.SetPageMark(page, reference);
        }

Usage Example

 /**
 * Begins a marked content sequence. This sequence will be tagged with the structure <CODE>struc</CODE>.
 * The same structure can be used several times to connect text that belongs to the same logical segment
 * but is in a different location, like the same paragraph crossing to another page, for example.
 * @param struc the tagging structure
 */    
 public void BeginMarkedContentSequence(PdfStructureElement struc) {        
     PdfObject obj = struc.Get(PdfName.K);
     int[] structParentMarkPoint = pdf.GetStructParentIndexAndNextMarkPoint(CurrentPage);
     int structParent = structParentMarkPoint[0];
     int mark = structParentMarkPoint[1];
     if (obj != null) {
         PdfArray ar = null;
         if (obj.IsNumber()) {
             ar = new PdfArray();
             ar.Add(obj);
             struc.Put(PdfName.K, ar);
         }
         else if (obj.IsArray()) {
             ar = (PdfArray)obj;
         }
         else
             throw new ArgumentException(MessageLocalization.GetComposedMessage("unknown.object.at.k.1", obj.GetType().ToString()));
         if (ar.GetAsNumber(0) != null)
         {
             PdfDictionary dic = new PdfDictionary(PdfName.MCR);
             dic.Put(PdfName.PG, CurrentPage);
             dic.Put(PdfName.MCID, new PdfNumber(mark));
             ar.Add(dic);
         }
         struc.SetPageMark(pdf.GetStructParentIndex(CurrentPage), -1);
     }
     else {
         struc.SetPageMark(structParent, mark);
         struc.Put(PdfName.PG, CurrentPage);
     }
     SetMcDepth(GetMcDepth() + 1);
     int contentSize = content.Size;
     content.Append(struc.Get(PdfName.S).GetBytes()).Append(" <</MCID ").Append(mark).Append(">> BDC").Append_i(separator);
     markedContentSize += content.Size - contentSize;
 }
All Usage Examples Of iTextSharp.text.pdf.PdfStructureElement::SetPageMark