Exemple #1
0
        public override object Clone()
        {
            PDFObject   obj1;
            CorePDFDict dict1 = new CorePDFDict();

            foreach (DictionaryEntry entry1 in this)
            {
                obj1 = ((PDFObject)entry1.Value);
                dict1[((PDFName)entry1.Key)] = ((obj1 is PDFIndirect) ? obj1 : ((PDFObject)obj1.Clone()));
            }
            return(dict1);
        }
Exemple #2
0
        internal CorePDFStream(CoreDocument doc, Stream str, long pos, CorePDFDict dict)
        {
            long num1;

            this.mRawStream   = null;
            this.mEncId       = -1;
            this.mEncGen      = -1;
            this.mDict        = dict;
            this.mDict.Parent = this;
            try
            {
                if (this.FileSpec != null)
                {
                    if (!this.FileSpec.IsValid)
                    {
                        return;
                    }
                    if (doc != null)
                    {
                        if (doc.mExtHandler != null)
                        {
                            this.mRawStream = doc.mExtHandler.GetReadStream(doc, this.FileSpec);
                            return;
                        }
                        this.mRawStream = Stream.Null;
                        return;
                    }
                    this.mRawStream = Stream.Null;
                    return;
                }
                num1            = ((PDFInteger)dict["Length"].Direct).Value;
                this.mRawStream = new SubStream(str, pos, num1);
                str.Position    = (pos + num1);
            }
            catch (InvalidCastException)
            {
                throw new PDFSyntaxException("Invalid length value in stream dictionary");
            }
            catch (NullReferenceException)
            {
                throw new PDFSyntaxException("No length value in stream dictionary");
            }
            catch (IOException exception1)
            {
                throw new PDFSyntaxException(string.Format("Error opening data stream: {S:O}}", exception1.Message));
            }
        }
Exemple #3
0
 // Methods
 internal CorePDFStream(Stream str, CorePDFDict dict, bool encodeAndEncrypt)
 {
     this.mRawStream = null;
     this.mEncId     = -1;
     this.mEncGen    = -1;
     if (dict.Parent != null)
     {
         throw new ArgumentException("Dictionary is already owned it can not be used as stream dictionary", "dict");
     }
     this.mDict        = dict;
     this.mDict.Parent = this;
     str.Position      = ((long)0);
     if (encodeAndEncrypt)
     {
         this.Encode(str);
         return;
     }
     this.SetRawStream(str);
 }