Beispiel #1
0
        private int AddResourcesObject()
        {
            Newobj();
            Append("<<\n");

            if (fonts.Count > 0)
            {
                Append("/Font\n");
                Append("<<\n");
                for (int i = 0; i < fonts.Count; i++)
                {
                    Font font = fonts[i];
                    Append("/F");
                    Append(font.objNumber);
                    Append(' ');
                    Append(font.objNumber);
                    Append(" 0 R\n");
                }
                Append(">>\n");
            }

            if (images.Count > 0)
            {
                Append("/XObject\n");
                Append("<<\n");
                for (int i = 0; i < images.Count; i++)
                {
                    Image image = images[i];
                    Append("/Im");
                    Append(image.objNumber);
                    Append(' ');
                    Append(image.objNumber);
                    Append(" 0 R\n");
                }
                Append(">>\n");
            }

            if (groups.Count > 0)
            {
                Append("/Properties\n");
                Append("<<\n");
                for (int i = 0; i < groups.Count; i++)
                {
                    OptionalContentGroup ocg = groups[i];
                    Append("/OC");
                    Append(i + 1);
                    Append(' ');
                    Append(ocg.objNumber);
                    Append(" 0 R\n");
                }
                Append(">>\n");
            }

            Append(">>\n");
            Endobj();
            return(objNumber);
        }
Beispiel #2
0
 private int AddResourcesObject()
 {
     this.Newobj();
     this.Append("<<\n");
     if (this.fonts.Count > 0)
     {
         this.Append("/Font\n");
         this.Append("<<\n");
         for (int i = 0; i < this.fonts.Count; i++)
         {
             Font font = this.fonts[i];
             this.Append("/F");
             this.Append(font.objNumber);
             this.Append(' ');
             this.Append(font.objNumber);
             this.Append(" 0 R\n");
         }
         this.Append(">>\n");
     }
     if (this.images.Count > 0)
     {
         this.Append("/XObject\n");
         this.Append("<<\n");
         for (int j = 0; j < this.images.Count; j++)
         {
             Image image = this.images[j];
             this.Append("/Im");
             this.Append(image.objNumber);
             this.Append(' ');
             this.Append(image.objNumber);
             this.Append(" 0 R\n");
         }
         this.Append(">>\n");
     }
     if (this.groups.Count > 0)
     {
         this.Append("/Properties\n");
         this.Append("<<\n");
         for (int k = 0; k < this.groups.Count; k++)
         {
             OptionalContentGroup optionalContentGroup = this.groups[k];
             this.Append("/OC");
             this.Append(k + 1);
             this.Append(' ');
             this.Append(optionalContentGroup.objNumber);
             this.Append(" 0 R\n");
         }
         this.Append(">>\n");
     }
     this.Append(">>\n");
     this.Endobj();
     return(this.objNumber);
 }