How to find current (X, Y) position in iTextSharp?

后端 未结 4 560
鱼传尺愫
鱼传尺愫 2021-01-06 12:04

I need to create a PDF with several sections, and after each section need to add a line, but I don\'t know where to draw this line.

I need to find the exact coordin

4条回答
  •  太阳男子
    2021-01-06 13:00

    If you just need to draw a line after the current section, maybe you do not need to know current x and y. Try this:

            iTextSharp.text.pdf.draw.DottedLineSeparator sepLINE = new iTextSharp.text.pdf.draw.DottedLineSeparator();
    
            sepLINE.LineWidth = 1;
            sepLINE.Gap = 2;
            sepLINE.Percentage = 50;
            sepLINE.LineColor = new iTextSharp.text.BaseColor(System.Drawing.Color.Blue);
    
            Chunk chnkLINE = new Chunk(sepLINE);
            pdfDoc.Add(chnkLINE);
    

提交回复
热议问题