开发者

FPDF Add text with background color to an x/y co-ordinate

开发者 https://www.devze.com 2023-01-16 10:35 出处:网络
Question explains it all really, I need to add some text to a PDF at positions X / Y with a background color.

Question explains it all really, I need to add some text to a PDF at positions X / Y with a background color.

I know I can do this using a cell, but i开发者_如何学JAVAt seems that you cannot place a cell using an X and Y co-ord.


What if you modify your current X Y position and then place the cell?

Something like:

SetXY(50, 150)
Cell(100, 50, "This is my text in a box.", 1, 0, 'c', true)


For some reason I found it works only in this sequence: first set Y then X. for the $pdf->Cell() text box.

  $pdf->SetY(30);
  $pdf->SetX(70);
  $pdf->Cell(100, 10, "This is my text in a box.", 1, 0, 'e', true);
0

精彩评论

暂无评论...
验证码 换一张
取 消