コード例 #1
0
 void nextChar(Orientaion o, int index, int len)
 {
     //縦中横は最後の文字以外は右へ
     if (o == Orientaion.Horizontal && index + 1 < len)
     {
         CurX -= CurFontSize * 0.5f;
         return;
     }
     CurX  = CurX2;
     CurY += CurFontSize;
 }
コード例 #2
0
        public void SetXML(String xml, Orientaion orient)
        {
            XmlDocument dom = new XmlDocument();;

            //   try {
            dom.LoadXml(xml);
            //   }catch(SAXException se) {
            //	    se.printStackTrace();
            //  }
            root = dom.DocumentElement;

            String header_string = root.GetAttribute("header");

            if ((header_string != null) && (header_string.ToLower().Equals("true") == true))
            {
                header = true;
            }
            String footer_string = root.GetAttribute("footer");

            if ((footer_string != null) && (footer_string.ToLower().Equals("true") == true))
            {
                footer = true;
            }
            String profile_string = root.GetAttribute("profile");

            if (profile_string != null)
            {
                profile = StringToColorProfile(profile_string);
            }


            String orientation_string = root.GetAttribute("orientation");

            if (orient != Orientaion.Default)
            {
                orientation_string = orient.ToString("g").ToLower();
            }

            GetHeaderInfo();
            if (orientation_string != "")
            {
                if (orientation_string.ToLower().Equals("landscape"))
                {
                    this.orientation = PageOrientation.Landscape;
                    this.size        = PageSize.A4;
                }
                else
                {
                    this.orientation = PageOrientation.Portrait;
                    this.size        = PageSize.A4;
                }
            }
            else
            {
                double sum_width = 0;
                for (int i = 0; i < widths.Length; i++)
                {
                    sum_width += widths[i];
                }
                if (sum_width / widths.Length < 80)
                {
                    this.orientation = PageOrientation.Landscape;
                    this.size        = PageSize.A4;
                }
                else
                {
                    this.orientation = PageOrientation.Portrait;
                    this.size        = PageSize.A4;
                }
            }
            String w_header = root.GetAttribute("without_header");

            if ((w_header != null) && (w_header.ToLower().Equals("true") == true))
            {
                without_header = true;
            }
        }