示例#1
0
 public override void BeginArrayEntry()
 {
     if (FinishedEntry)
     {
         CurrentStream.Write(Constants.ArrayEntrySeparator);
     }
     this.FinishedEntry = false;
 }
示例#2
0
 /// <summary>
 /// Writes a boolean value to the current stream
 /// </summary>
 /// <param name="value"></param>
 public override void WriteBoolean(bool value)
 {
     if (value)
     {
         CurrentStream.Write("true");
     }
     else
     {
         CurrentStream.Write("false");
     }
 }
示例#3
0
 public override void BeginDictionaryEntry(string name)
 {
     if (FinishedEntry)
     {
         CurrentStream.Write(Constants.DictionaryNameValueSeparator);
     }
     FinishedEntry = false;
     CurrentStream.Write(Constants.StartName);
     CurrentStream.Write(ValidateName(name));
     CurrentStream.Write(Constants.WhiteSpace);
 }
示例#4
0
 public override void WriteStringLiteral(string value, Scryber.FontEncoding encoding)
 {
     if (UseHex && encoding != FontEncoding.PDFDocEncoding)
     {
         //TODO Write encoding prefix
         CurrentStream.Write(Constants.StartHexString);
         value = ToHex(value, encoding);
         CurrentStream.Write(value);
         CurrentStream.Write(Constants.EndHexString);
     }
     else
     {
         Scryber.Text.PDFEncoding enc = Scryber.Text.PDFEncoding.GetEncoding(encoding);
         CurrentStream.Write(Constants.StartString);
         if (null != enc.Prefix && enc.Prefix.Length > 0)
         {
             CurrentStream.Write(enc.Prefix);
         }
         CurrentStream.Write(enc.GetBytes(value));
         CurrentStream.Write(Constants.EndString);
     }
 }
 public void Write(byte[] buffer)
 {
     CurrentStream.Write(buffer, 0, buffer.Length);
 }
 public void Write(byte[] buffer, int offset, int count)
 {
     CurrentStream.Write(buffer, offset, count);
 }
示例#7
0
 /// <summary>
 /// Writes a PDFName string to the current stream
 /// </summary>
 /// <param name="name"></param>
 public override void WriteName(string name)
 {
     CurrentStream.Write(Constants.StartName);
     CurrentStream.Write(ValidateName(name));
 }
示例#8
0
 /// <summary>
 /// Writes a real value to the current stream
 /// </summary>
 /// <param name="value"></param>
 public override void WriteReal(float value)
 {
     CurrentStream.Write(value.ToString("F", System.Globalization.CultureInfo.InvariantCulture));
 }
示例#9
0
 /// <summary>
 /// Writes a long value to the current stream
 /// </summary>
 /// <param name="value"></param>
 public override void WriteNumber(long value)
 {
     CurrentStream.Write(value.ToString());
 }
示例#10
0
 public override void WriteStringHex(byte[] value)
 {
     CurrentStream.Write(Constants.StartHexString);
     CurrentStream.Write(ToHex(value));
     CurrentStream.Write(Constants.EndHexString);
 }
示例#11
0
 public override void WriteByteString(string byteString)
 {
     CurrentStream.Write(Constants.StartHexString);
     CurrentStream.Write(byteString);
     CurrentStream.Write(Constants.EndHexString);
 }
示例#12
0
 public override void EndArray()
 {
     this.FinishedEntry = false;
     CurrentStream.Write(Constants.EndArray);
 }
示例#13
0
 public override void EndArrayEntry()
 {
     CurrentStream.Write(Constants.ArrayEntrySeparator);
 }
示例#14
0
 public override void BeginArray()
 {
     CurrentStream.Write(Constants.StartArray);
     this.FinishedEntry = false;
 }
示例#15
0
 public override void BeginDictionary()
 {
     CurrentStream.Write(Constants.StartDictionary);
     this.FinishedEntry = false;
 }