Exemplo n.º 1
0
        public override string ToString()
        {
            // Note: This never adds "N 0 obj" and "endobj".

            StringBuilder sb    = new StringBuilder();
            int           count = Array.Count;

            sb.Append("[");

            for (int i = 0; i < count; i++)
            {
                PDFObject item = Array[i];
                if (item.IsIndirect)
                {
                    sb.Append(item.ToReferenceString());
                }
                else
                {
                    sb.Append(item.ToString());
                }

                if (i + 1 < count)
                {
                    sb.Append(' ');
                }
            }

            sb.Append("]");
            return(sb.ToString());
        }
Exemplo n.º 2
0
        public override string ToString()
        {
            // Note: This never adds "N 0 obj" and "endobj".

            StringBuilder sb = new StringBuilder();

            sb.Append("<<\r\n");

            // TODO Escape illegal characters in keys

            foreach (string key in Entries.Keys)
            {
                PDFObject value = Entries[key];
                sb.Append('/').Append(key).Append(' ');
                if (value.IsIndirect)
                {
                    sb.Append(value.ToReferenceString()).Append("\r\n");
                }
                else
                {
                    sb.Append(value.ToString()).Append("\r\n");
                }
            }

            sb.Append(">>");
            return(sb.ToString());
        }