예제 #1
0
        /// <summary>
        /// Sets the paper and orientation based upon the size
        /// </summary>
        private void UpdatePage()
        {
            SizeF sf = this._size.ToDrawing();

            this._paper       = Papers.GetPaperFromSize(sf);
            this._orientation = this.Width > this.Height ? PaperOrientation.Landscape : PaperOrientation.Portrait;
        }
예제 #2
0
        public static PDFSize GetSizeInDeviceIndependentUnits(PaperSize paperSize)
        {
            SizeF   mm   = Papers.GetSizeInMM(paperSize);
            PDFSize full = new PDFSize(
                new PDFUnit(mm.Width, PageUnits.Millimeters),
                new PDFUnit(mm.Height, PageUnits.Millimeters));

            return(full);
        }
예제 #3
0
 /// <summary>
 /// Sets the new page size based upon the paper and orientation
 /// </summary>
 private void UpdateSizes()
 {
     if (this.PaperSize != PaperSize.Custom)
     {
         PDFSize size = Papers.GetSizeInDeviceIndependentUnits(this.PaperSize);
         if (this.Orientation == PaperOrientation.Landscape)
         {
             this._size = new PDFSize(size.Height, size.Width);
         }
         else
         {
             this._size = size;
         }
     }
 }