示例#1
0
        private papersize findOptimalSize(double height, units heightunits, double width, units widthunits)
        {
            double heightInInches = RenderSpecs.convertToInches(height, heightunits);
            double widthInInches  = RenderSpecs.convertToInches(width, widthunits);

            int heightSize = 5;
            int widthSize  = 5;

            for (int ii = 0; ii < allPaperHeightsInInch.Length - 1; ii++)
            {
                if (heightInInches < allPaperHeightsInInch[ii] && heightInInches > allPaperHeightsInInch[ii + 1])
                {
                    heightSize = ii;
                }
                if (widthInInches < allPaperWidthsInInch[ii] && widthInInches > allPaperWidthsInInch[ii + 1])
                {
                    widthSize = ii;
                }
            }
            return((papersize)(Math.Min(heightSize, widthSize)));
        }
示例#2
0
 /// <summary>
 /// Initializes a new instance of the <c>Converter</c> class.
 /// </summary>
 public Converter()
 {
     specs = new RenderSpecs();
     setDefaultFontTexTable();
 }
示例#3
0
 /// <summary>
 /// Added a version that initializes from a layout object
 /// </summary>
 /// <param name="layout">a laout object to initialize from</param>
 public void ReadFromLayout(Layout layout)
 {
     _layout = layout; //default use the first layout
     specs   = new RenderSpecs(_layout);
 }
示例#4
0
 /// <summary>
 /// Initializes a new instance of the <c>Converter</c> class. 
 /// </summary>
 public Converter()
 {
     specs = new RenderSpecs();
     setDefaultFontTexTable();
 }
示例#5
0
 /// <summary>
 /// Added a version that initializes from a layout object
 /// </summary>
 /// <param name="layout">a laout object to initialize from</param>
 public void ReadFromLayout(Layout layout)
 {
     _layout = layout; //default use the first layout
     specs = new RenderSpecs(_layout);
 }