Drawing in a PDF file

后端 未结 3 1703
忘掉有多难
忘掉有多难 2021-02-20 14:38

I would like to draw in a PDF file.

Example: Open the PDF file and get such drawing tools like circle, square, text etc... Using these tools will draw shapes on the PDF

3条回答
  •  逝去的感伤
    2021-02-20 15:22

    http://www.fpdf.org If You want to draw using x, y coordinates fpdf as well as tcpdf can be useful for you.

    global $title;
        // Calculate width
        $w = $this->GetStringWidth($title)+6;
        $this->SetX((210-$w)/2);
        // Colors of frame, background and text
        $this->SetDrawColor(0,80,180);
        $this->SetFillColor(230,230,0);
        $this->SetTextColor(220,50,50);
        // Thickness of frame (1 mm)
        $this->SetLineWidth(1);
        // Title
        $this->Cell($w,9,$title,1,1,'C',true);
        // Line break
        $this->Ln(10);
    }
    

提交回复
热议问题