Example #1
0
 public void Init(InputMeta meta)
 {
     style    = meta.ReadWord();
     penWidth = meta.ReadShort();
     meta.ReadWord();
     color = meta.ReadColor();
 }
Example #2
0
        public void Init(InputMeta meta)
        {
            height = Math.Abs(meta.ReadShort());
            meta.Skip(2);
            angle = (float)(meta.ReadShort() / 1800.0 * Math.PI);
            meta.Skip(2);
            bold      = (meta.ReadShort() >= BOLDTHRESHOLD ? MARKER_BOLD : 0);
            italic    = (meta.ReadByte() != 0 ? MARKER_ITALIC : 0);
            underline = (meta.ReadByte() != 0);
            strikeout = (meta.ReadByte() != 0);
            charset   = meta.ReadByte();
            meta.Skip(3);
            pitchAndFamily = meta.ReadByte();
            byte[] name = new byte[nameSize];
            int    k;

            for (k = 0; k < nameSize; ++k)
            {
                int c = meta.ReadByte();
                if (c == 0)
                {
                    break;
                }
                name[k] = (byte)c;
            }
            try {
                faceName = System.Text.Encoding.GetEncoding(1252).GetString(name, 0, k);
            }
            catch {
                faceName = System.Text.ASCIIEncoding.ASCII.GetString(name, 0, k);
            }
            faceName = faceName.ToLower(CultureInfo.InvariantCulture);
        }
Example #3
0
 public void Init(InputMeta meta)
 {
     height = Math.Abs(meta.ReadShort());
     meta.Skip(2);
     angle = (float)(meta.ReadShort() / 1800.0 * Math.PI);
     meta.Skip(2);
     bold = (meta.ReadShort() >= BOLDTHRESHOLD ? MARKER_BOLD : 0);
     italic = (meta.ReadByte() != 0 ? MARKER_ITALIC : 0);
     underline = (meta.ReadByte() != 0);
     strikeout = (meta.ReadByte() != 0);
     charset = meta.ReadByte();
     meta.Skip(3);
     pitchAndFamily = meta.ReadByte();
     byte[] name = new byte[nameSize];
     int k;
     for (k = 0; k < nameSize; ++k) {
         int c = meta.ReadByte();
         if (c == 0) {
             break;
         }
         name[k] = (byte)c;
     }
     try {
         faceName = System.Text.Encoding.GetEncoding(1252).GetString(name, 0, k);
     }
     catch {
         faceName = System.Text.ASCIIEncoding.ASCII.GetString(name, 0, k);
     }
     faceName = faceName.ToLower(CultureInfo.InvariantCulture);
 }
Example #4
0
 public void Init(InputMeta meta)
 {
     style = meta.ReadWord();
     color = meta.ReadColor();
     hatch = meta.ReadWord();
 }
Example #5
0
 public MetaDo(Stream meta, PdfContentByte cb)
 {
     this.cb   = cb;
     this.meta = new InputMeta(meta);
 }
Example #6
0
 public MetaDo(Stream meta, PdfContentByte cb)
 {
     this.cb = cb;
     this.meta = new InputMeta(meta);
 }
Example #7
0
 /// <summary>
 /// This method checks if the image is a valid WMF and processes some parameters.
 /// </summary>
 private void ProcessParameters()
 {
     type = Element.IMGTEMPLATE;
     originalType = ORIGINAL_WMF;
     Stream istr = null;
     try {
         string errorID;
         if (rawData == null){
             WebRequest w = WebRequest.Create(url);
             istr = w.GetResponse().GetResponseStream();
             errorID = url.ToString();
         }
         else{
             istr = new MemoryStream(rawData);
             errorID = "Byte array";
         }
         InputMeta im = new InputMeta(istr);
         if (im.ReadInt() != unchecked((int)0x9AC6CDD7))    {
             throw new BadElementException(errorID + " is not a valid placeable windows metafile.");
         }
         im.ReadWord();
         int left = im.ReadShort();
         int top = im.ReadShort();
         int right = im.ReadShort();
         int bottom = im.ReadShort();
         int inch = im.ReadWord();
         dpiX = 72;
         dpiY = 72;
         scaledHeight = (float)(bottom - top) / inch * 72f;
         this.Top =scaledHeight;
         scaledWidth = (float)(right - left) / inch * 72f;
         this.Right = scaledWidth;
     }
     finally {
         if (istr != null) {
             istr.Close();
         }
         plainWidth = this.Width;
         plainHeight = this.Height;
     }
 }
Example #8
0
 public void Init(InputMeta meta)
 {
     style = meta.ReadWord();
     penWidth = meta.ReadShort();
     meta.ReadWord();
     color = meta.ReadColor();
 }
Example #9
0
 public void Init(InputMeta meta)
 {
     style = meta.ReadWord();
     color = meta.ReadColor();
     hatch = meta.ReadWord();
 }