Пример #1
0
 /**
  * Writes eficiently to a stream
  *
  * @param os the stream to write to
  * @throws IOException on write error
  */
 internal void WriteTo(Stream os)
 {
     byte[] tmp = DocWriter.GetISOBytes(number.ToString());
     os.Write(tmp, 0, tmp.Length);
     os.WriteByte((byte)' ');
     tmp = DocWriter.GetISOBytes(generation.ToString());
     os.Write(tmp, 0, tmp.Length);
     os.Write(STARTOBJ, 0, STARTOBJ.Length);
     objecti.ToPdf(writer, os);
     os.Write(ENDOBJ, 0, ENDOBJ.Length);
 }
Пример #2
0
        // methods overriding some methods in PdfObject

/**
 * Returns the PDF representation of this <CODE>PdfArray</CODE>.
 *
 * @return        an array of <CODE>byte</CODE>s
 */

        public override void ToPdf(PdfWriter writer, Stream os)
        {
            os.WriteByte((byte)'[');
            bool      first = true;
            PdfObject obj   = null;

            foreach (PdfObject obja in arrayList)
            {
                obj  = (obja == null) ? PdfNull.PDFNULL : obja;
                type = obj.Type;
                if (!first && type != PdfObject.ARRAY && type != PdfObject.DICTIONARY && type != PdfObject.NAME && type != PdfObject.STRING)
                {
                    os.WriteByte((byte)' ');
                }
                first = false;
                obj.ToPdf(writer, os);
            }
            os.WriteByte((byte)']');
        }