iTextSharp.text.Rectangle.Rotate C# (CSharp) Метод

Rotate() публичный Метод

Swaps the values of urx and ury and of lly and llx in order to rotate the rectangle.
public Rotate ( ) : Rectangle
Результат Rectangle
        public Rectangle Rotate()
        {
            Rectangle rect = new Rectangle(lly, llx, ury, urx);
            rect.Rotation = rotation + 90;
            return rect;
        }

Usage Example

Пример #1
0
        /// <summary>
        /// PDF Creator Helper With No Page Base (Don't want to write a page or report (header or footer)
        /// </summary>
        /// <param name="PageSize">Page Size - A4 is a default page size. Use Enum iTextSharp.text.PageSize</param>
        /// <param name="LandscapeMode">Do you want the pdf in landscape</param>
        /// <param name="MarginTop">Top Margin On The Page</param>
        /// <param name="MarginRight">Right Margin On The Page</param>
        /// <param name="MarginBottom">Bottom Margin On The Page</param>
        /// <param name="MarginLeft">Left Margin On The Page</param>
        /// <param name="PageEventHandler">A Page Event Class That Will Raise Any Events You Need</param>
        public PDFCreator(Rectangle PageSize,
                          bool LandscapeMode,
                          float MarginTop,
                          float MarginRight,
                          float MarginBottom,
                          float MarginLeft,
                          PageEventsBase PageEventHandler)
        {
            //create the instance of the ITextSharpDocument
            Doc = new Document(PageSize, MarginLeft, MarginRight, MarginTop, MarginBottom);

            //let's build the memory stream now
            Ms = new MemoryStream();

            //let's create the new writer and attach the document
            Writer = PdfWriter.GetInstance(Doc, Ms);

            //add the page events to my custom class
            if (PageEventHandler != null)
            {
                Writer.PageEvent = PageEventHandler;
            }

            //if you want the pdf in landscape now, then rotate it
            if (LandscapeMode)
            {
                Doc.SetPageSize(PageSize.Rotate());
            }

            //let's open the document so the developer can do whatever they wan't with it
            Doc.Open();
        }
All Usage Examples Of iTextSharp.text.Rectangle::Rotate