Esempio n. 1
0
 private void CheckResourcesOfAppearanceStreams(PdfDictionary appearanceStreamsDict, ICollection <PdfObject>
                                                checkedObjects)
 {
     if (checkedObjects.Contains(appearanceStreamsDict))
     {
         return;
     }
     else
     {
         checkedObjects.Add(appearanceStreamsDict);
     }
     foreach (PdfObject val in appearanceStreamsDict.Values())
     {
         if (val is PdfDictionary)
         {
             PdfDictionary ap = (PdfDictionary)val;
             if (ap.IsDictionary())
             {
                 CheckResourcesOfAppearanceStreams(ap, checkedObjects);
             }
             else
             {
                 if (ap.IsStream())
                 {
                     CheckAppearanceStream((PdfStream)ap);
                 }
             }
         }
     }
 }
Esempio n. 2
0
        private PdfObject CleverPdfDictionaryClone(PdfDictionary dict)
        {
            PdfDictionary newDict;

            if (dict.IsStream())
            {
                newDict = new PdfStream(emptyByteArray);
                newDict.Remove(PdfName.LENGTH);
            }
            else
            {
                newDict = new PdfDictionary();
            }

            foreach (PdfName key in dict.Keys)
            {
                if (keysForCheck.Contains(key))
                {
                    newDict.Put(key, dict.Get(key));
                }
            }

            return(newDict);
        }
Esempio n. 3
0
 protected internal virtual void CheckResourcesOfAppearanceStreams(PdfDictionary appearanceStreamsDict)
 {
     foreach (PdfObject val in appearanceStreamsDict.Values())
     {
         if (val is PdfDictionary)
         {
             PdfDictionary ap = (PdfDictionary)val;
             if (ap.IsDictionary())
             {
                 CheckResourcesOfAppearanceStreams(ap);
             }
             else
             {
                 if (ap.IsStream())
                 {
                     if (!IsAlreadyChecked(ap))
                     {
                         CheckResources(ap.GetAsDictionary(PdfName.Resources));
                     }
                 }
             }
         }
     }
 }
Esempio n. 4
0
        private PdfObject CleverPdfDictionaryClone(PdfDictionary dict) {
            PdfDictionary newDict;
            if (dict.IsStream()) {
                newDict = new PdfStream(emptyByteArray);
                newDict.Remove(PdfName.LENGTH);
            }
            else
                newDict = new PdfDictionary();

            foreach (PdfName key in dict.Keys)
                if (keysForCheck.Contains(key))
                    newDict.Put(key, dict.Get(key));

            return newDict;
        }