public void Delete()
 {
     this._free = true;
     if (null != _ref && _ref is PDFIndirectObject)
     {
         PDFIndirectObject obj = (PDFIndirectObject)_ref;
         obj.Deleted = true;
     }
 }
Example #2
0
        /// <summary>
        /// Creates a new instance of the PDFStream with the specified encoding and filters
        /// </summary>
        /// <param name="stream">The stream to write to. If it is not a MemoryStream then functionality is seriously impaired.</param>
        /// <param name="encoding">The text encoding of the TextWiter stream</param>
        /// <param name="filters">The filters to apply to the stream</param>
        /// <param name="indobj">The PDF indirect object that has this stream</param>
        /// <param name="ownstream">If true then this PDFStream owns the actual stream, and can dispose of it when wanted.</param>
        public PDFStream(System.IO.Stream stream, IStreamFilter[] filters, PDFIndirectObject indobj, bool ownstream)
        {
            if (null == stream)
            {
                throw new ArgumentNullException("stream");
            }
            this._ms         = stream;
            this._filters    = filters;
            this._indobj     = indobj;
            this._ownsstream = ownstream;

            InitLineTerminator();
        }
Example #3
0
 /// <summary>
 /// Creates a new PDFStream
 /// </summary>
 /// <param name="filters"></param>
 /// <param name="indobj"></param>
 public PDFStream(IStreamFilter[] filters, PDFIndirectObject indobj)
     : this(new System.IO.MemoryStream(), filters, indobj, true)
 {
 }
 public PDFSeekableStreamWrapper(System.IO.Stream nonseekable, IStreamFilter[] filters, Native.PDFIndirectObject indobj, bool ownstream)
     : base(GetSeekableStream(), filters, indobj, true) //Pass true to the base ownstream because we do and we want it to be closed.
 {
     if (null == nonseekable)
     {
         throw new ArgumentNullException("nonseekable");
     }
     _nonseekable      = nonseekable;
     _ownedNonSeekable = ownstream;
 }