Exemplo n.º 1
0
        /// <summary>
        /// Begins a direct or indirect dictionary or array.
        /// </summary>
        public void WriteBeginObject(PDFObject obj)
        {
            bool indirect = obj.IsIndirect;

            if (indirect)
            {
                WriteObjectAddress(obj);
                if (SecurityHandler != null)
                {
                    SecurityHandler.SetHashKey(obj.ObjectID);
                }
            }
            _stack.Add(new StackItem(obj));
            if (indirect)
            {
                if (obj is PDFArray)
                {
                    WriteRaw("[\n");
                }
                else if (obj is PDFDictionary)
                {
                    WriteRaw("<<\n");
                }
                _lastCat = CharCat.NewLine;
            }
            else
            {
                if (obj is PDFArray)
                {
                    WriteSeparator(CharCat.Delimiter);
                    WriteRaw('[');
                    _lastCat = CharCat.Delimiter;
                }
                else if (obj is PDFDictionary)
                {
                    NewLine();
                    WriteSeparator(CharCat.Delimiter);
                    WriteRaw("<<\n");
                    _lastCat = CharCat.NewLine;
                }
            }
            if (Layout == PDFWriterLayout.Verbose)
            {
                IncreaseIndent();
            }
        }