php - Adding vertical text into existing pdf
I am trying to modify an existing pdf, adding datas into it using FPDI and FPDF. So far everything is fine. The only thing I am stuck at is inserting vertical text into the pdf.
Tried searching online, but non of the codes really worked.
if($x==-1)
$x=$this->x;
if($y==-1)
$y=$this->y;
if($this->angle!=0)
$this->_out('Q');
$this->angle=$angle;
if($angle!=0)
{
$angle*=M_PI/180;
$c=cos($angle);
$s=sin($angle);
$cx=$x*$this->k;
$cy=($this->h-$y)*$this->k;
I tried this, but this doesnt work together with FPDI, i.e I can generate new pdfs with verical or angled texts. But what I am trying to do is to insert vertical text into the already exisitng pdf. Unfortunately, FPDF doesnt allow to set source file. FPDI does, but this code isnt working together with FPDI somehow.
Answer
Solution:
The quoted code is extracted from this extension. The extension will work with FPDI as with FPDF by changing its extending class name as described here.
So the extension class definition will become e.g.:
And you can still use the methods of FPDI: