iTextSharp center align objects within the Document object

后端 未结 6 1759
面向向阳花
面向向阳花 2021-02-12 14:56

Is there a quick and simple way to center align objects within the Document object? Without performing any calculation logic, ie. Get width of page, get width

6条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-12 15:52

    For image alignment:

    iTextSharp.text.Image image1 = iTextSharp.text.Image.GetInstance(MapPath("~/images/HKVictoriaHarbour.png"));
    image1.Alignment = iTextSharp.text.Image.ALIGN_CENTER;
    doc.Add(image1);
    

提交回复
热议问题