Esempio n. 1
0
 private void method_4(IPdfIndirectObject obj, Class64 bodyWriter)
 {
     bodyWriter.ObjectPositions.Add(new Class65(obj, this.stream_0.Position));
     this.method_7(obj.Number.ToString((IFormatProvider)CultureInfo.InvariantCulture) + " " + obj.Generation.ToString((IFormatProvider)CultureInfo.InvariantCulture) + " obj");
     obj.Value.Write(new ExtendedPdfOutput((IPdfOutput)bodyWriter));
     this.method_8();
     this.method_7("endobj");
 }
Esempio n. 2
0
 public static string GetReferenceString(IPdfIndirectObject referencedObject)
 {
     if (referencedObject == null)
     {
         throw new ArgumentException("Referenced object is null.");
     }
     return(referencedObject.Number.ToString((IFormatProvider)CultureInfo.InvariantCulture) + " " + referencedObject.Generation.ToString((IFormatProvider)CultureInfo.InvariantCulture) + " R");
 }
Esempio n. 3
0
 /// <summary>
 /// Value-setting constructor.
 /// </summary>
 /// <param name="referent">The indirect object that this should be a reference to.</param>
 /// <exception cref="ArgumentNullException">Thrown if the referent parameter is null.</exception>
 public PdfReference(IPdfIndirectObject referent)
 {
     if (referent == null)
     {
         throw new ArgumentNullException(nameof(referent));
     }
     Value = referent;
 }
Esempio n. 4
0
 private void method_3(IPdfIndirectObject obj)
 {
     if (obj.Number != 0)
     {
         return;
     }
     obj.Number = this.int_0;
     ++this.int_0;
 }
        /// <summary>
        /// Mark a slot in the cross-reference table as occupied by an object that has been written to a particular address in the output stream.
        /// </summary>
        /// <param name="value">The object to be listed in the table.  Its ID must be an ID previously allocated by a call to <see cref="ClaimSlot" />.</param>
        /// <param name="offset">The address of the object within the output, as a zero-based offset in bytes from the start of the strean.</param>
        /// <exception cref="ArgumentException">Thrown if the object ID of the value parameter is out of range for this cross-ref table.</exception>
        /// <exception cref="ArgumentNullException">Thrown if the value parameter is null.</exception>
        public void SetSlot(IPdfIndirectObject value, int offset)
        {
            if (value == null)
            {
                throw new ArgumentNullException(nameof(value));
            }
            if (value.ObjectId >= _contents.Count || value.ObjectId < 0)
            {
                throw new ArgumentException(Resources.Structural_PdfCrossRefTable_SetSlot_Invalid_ObjectId_Error, nameof(value));
            }
            PdfCrossRefTableEntry entry = new PdfCrossRefTableEntry(value, offset);

            _contents[value.ObjectId] = entry;
        }
Esempio n. 6
0
 /**
  * <summary>Resolves a generic object.</summary>
  */
 public static ResolvedObject <T> Resolve <T>(
     PdfObject obj,
     IPdfIndirectObject container
     ) where T : PdfDataObject
 {
     if (obj == null)
     {
         return(null);
     }
     else if (obj is IPdfIndirectObject)
     {
         IPdfIndirectObject indirectObject = (IPdfIndirectObject)obj;
         return(new ResolvedObject <T>((T)indirectObject.DataObject, indirectObject.IndirectObject));
     }
     else
     {
         return(new ResolvedObject <T>((T)obj, container.IndirectObject));
     }
 }
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="value">The indirect object that this entry refers to.</param>
 /// <param name="offset">The address of the object within its file.</param>
 public PdfCrossRefTableEntry(IPdfIndirectObject value, int offset)
 {
     Value  = value;
     Offset = offset;
 }
Esempio n. 8
0
 public Class65(IPdfIndirectObject indirectObject, long position)
 {
     this.ipdfIndirectObject_0 = indirectObject;
     this.long_0 = position;
 }
Esempio n. 9
0
 public PdfReference(IPdfIndirectObject referencedObject)
 {
     this.ipdfIndirectObject_0 = referencedObject;
 }