示例#1
0
 protected internal override void Write(PdfWriter writer)
 {
     writer.WriteKeyword(Keyword.ArrayBegin);
     writer.Write(PdfString.ToPdfHexadecimal(new byte[] { }, CreatedPart));
     writer.WriteSpace();
     writer.Write(PdfString.ToPdfHexadecimal(new byte[] { }, ModifiedPart));
     writer.WriteKeyword(Keyword.ArrayEnd);
 }
示例#2
0
 protected internal override void Write(PdfWriter writer)
 {
     writer.WriteKeyword(Keyword.ArrayBegin);
     writer.Write(PdfString.ToPdfHexadecimal(null, CreatedPart, writer.TempMemStream));
     writer.WriteSpace();
     writer.Write(PdfString.ToPdfHexadecimal(null, ModifiedPart, writer.TempMemStream));
     writer.WriteKeyword(Keyword.ArrayEnd);
 }
示例#3
0
 protected internal override void Write(PdfWriter writer)
 {
     writer.WriteKeyword(Keyword.ArrayBegin);
     writer.Write(PdfString.ToPdfHexadecimal(new byte[] { }, CreatedPart));
     writer.WriteSpace();
     writer.Write(PdfString.ToPdfHexadecimal(new byte[] { }, ModifiedPart));
     writer.WriteKeyword(Keyword.ArrayEnd);
 }
示例#4
0
        protected internal override void Write(PdfWriter writer)
        {
            writer.WriteKeyword(Keyword.ArrayBegin);
            bool isFirst = true;

            foreach (PdfObject obj in elements)
            {
                if (!isFirst)
                {
                    writer.WriteSpace();
                }
                else
                {
                    isFirst = false;
                }
                writer.Write(obj);
            }
            writer.WriteKeyword(Keyword.ArrayEnd);
        }
        protected internal override void Write(PdfWriter writer)
        {
            Debug.Assert(!IsIndirect, "An object reference cannot be indirect");

            writer.Write(refId.ObjectNumber);
            writer.WriteSpace();
            writer.Write(refId.GenerationNumber);
            writer.WriteSpace();
            writer.WriteKeyword(Keyword.R);
        }
示例#6
0
        protected internal override void Write(PdfWriter writer)
        {
            Debug.Assert(!IsIndirect, "An object reference cannot be indirect");

            writer.Write(refId.ObjectNumber);
            writer.WriteSpace();
            writer.Write(refId.GenerationNumber);
            writer.WriteSpace();
            writer.WriteKeyword(Keyword.R);
        }
示例#7
0
 protected internal override void Write(PdfWriter writer)
 {
     writer.WriteKeywordLine(Keyword.DictionaryBegin);
     foreach (DictionaryEntry e in entries)
     {
         writer.Write((PdfName)e.Key);
         writer.WriteSpace();
         writer.WriteLine((PdfObject)e.Value);
     }
     writer.WriteKeyword(Keyword.DictionaryEnd);
 }
示例#8
0
        protected internal override void Write(PdfWriter writer)
        {
            if (writer == null)
            {
                throw new ArgumentNullException("writer");
            }
            if (data == null)
            {
                throw new InvalidOperationException("No data for stream.");
            }

            // Prepare the stream's data.
            byte[] bytes = (byte[])data.Clone();

            // Apply any filters.
            if (HasFilters)
            {
                bytes = ApplyFilters(data);
            }

            // Encrypt the data if required.
            SecurityManager sm = writer.SecurityManager;

            if (sm != null)
            {
                bytes = sm.Encrypt(bytes, writer.EnclosingIndirect.ObjectId);
            }

            // Create the stream's dictionary.
            dictionary[PdfName.Names.Length] = new PdfNumeric(bytes.Length);
            if (HasFilters)
            {
                dictionary[PdfName.Names.Filter] = FilterName;
                if (HasDecodeParams)
                {
                    dictionary[PdfName.Names.DecodeParams] = FilterDecodeParms;
                }
            }

            // Write out the dictionary.
            writer.WriteLine(dictionary);

            // Write out the stream data.
            writer.WriteKeywordLine(Keyword.Stream);
            writer.WriteLine(bytes);
            writer.WriteKeyword(Keyword.EndStream);
        }
示例#9
0
        protected internal void WriteIndirect(PdfWriter writer)
        {
            Debug.Assert(writer != null);
            Debug.Assert(IsIndirect);

            // Write the object number and generation number
            // followed by the keyword 'obj' and finally a newline.
            writer.Write(objectId.ObjectNumber);
            writer.WriteSpace();
            writer.Write(objectId.GenerationNumber);
            writer.WriteSpace();
            writer.WriteKeywordLine(Keyword.Obj);

            // Write the objects value, subclasses will override this.
            Write(writer);

            // Follow the objects value with a newline and then the keyword 'endobj'.
            writer.WriteLine();
            writer.WriteKeyword(Keyword.EndObj);
        }
示例#10
0
        protected internal void WriteIndirect(PdfWriter writer)
        {
            Debug.Assert(writer != null);
            Debug.Assert(IsIndirect);

            // Write the object number and generation number 
            // followed by the keyword 'obj' and finally a newline.
            writer.Write(objectId.ObjectNumber);
            writer.WriteSpace();
            writer.Write(objectId.GenerationNumber);
            writer.WriteSpace();
            writer.WriteKeywordLine(Keyword.Obj);

            // Write the objects value, subclasses will override this.
            Write(writer);

            // Follow the objects value with a newline and then the keyword 'endobj'.
            writer.WriteLine();
            writer.WriteKeyword(Keyword.EndObj);
        }
 public void WriteKeyword(Keyword keyword)
 {
     streamData.WriteKeyword(keyword);
 }
示例#12
0
文件: PdfArray.cs 项目: nholik/Fo.Net
 protected internal override void Write(PdfWriter writer)
 {
     writer.WriteKeyword(Keyword.ArrayBegin);
     bool isFirst = true;
     foreach (PdfObject obj in elements)
     {
         if (!isFirst)
         {
             writer.WriteSpace();
         }
         else
         {
             isFirst = false;
         }
         writer.Write(obj);
     }
     writer.WriteKeyword(Keyword.ArrayEnd);
 }
示例#13
0
        protected internal override void Write(PdfWriter writer)
        {
            if (writer == null)
            {
                throw new ArgumentNullException("writer");
            }
            if (data == null)
            {
                throw new InvalidOperationException("No data for stream.");
            }

            // Prepare the stream's data.
            byte[] bytes = (byte[])data.Clone();

            // Apply any filters.
            if (HasFilters)
            {
                bytes = ApplyFilters(data);
            }

            // Encrypt the data if required.
            SecurityManager sm = writer.SecurityManager;
            if (sm != null)
            {
                bytes = sm.Encrypt(bytes, writer.EnclosingIndirect.ObjectId);
            }

            // Create the stream's dictionary.
            dictionary[PdfName.Names.Length] = new PdfNumeric(bytes.Length);
            if (HasFilters)
            {
                dictionary[PdfName.Names.Filter] = FilterName;
                if (HasDecodeParams)
                {
                    dictionary[PdfName.Names.DecodeParams] = FilterDecodeParms;
                }
            }

            // Write out the dictionary.
            writer.WriteLine(dictionary);

            // Write out the stream data.
            writer.WriteKeywordLine(Keyword.Stream);
            writer.WriteLine(bytes);
            writer.WriteKeyword(Keyword.EndStream);
        }