程序问答   发布时间:2022-06-01  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了带有dompdf的垂直文本大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

如何解决带有dompdf的垂直文本?

开发过程中遇到带有dompdf的垂直文本的问题如何解决?下面主要结合日常开发的经验,给出你关于带有dompdf的垂直文本的解决方法建议,希望对你解决带有dompdf的垂直文本有所启发或帮助;

每次单击特定链接时,我都使用dompdf生成合同,并且我需要做每个页面中都存在的垂直边(如果合同> 1page)但我不知道如何 有人可以帮我吗?

解决方法

简答

据我所知 dompdf 仅符合 CSS 2.1 并且旋转文本首次出现在 CSS3 中。

...嗯

您可以尝试的唯一技巧是使用 GD 创建一张包含您想要旋转的文本的图片。 There is a nice example here 我复制到这里,因为有时网站会脱机,链接会意外死掉。

$label = "TEXT YOU WANT TO ROTATE";
$labelfont = 2;

// pixel-width of label
$txtsz = imagefontwidth($labelfont) * strlen($label);
// pixel-height of label
$txtht = imagefontheight($labelfont);

// define temp image
$labelimage = imagecreate($txtsz,$txtsz);
$white = imagecolorallocate($labelimage,0xFF,0xFF);
$black = imagecolorallocate($labelimage,0x00,0x00);

// write to the temp image
imagestring($labelimage,$labelfont,$txtsz/2 - $txtht/2,$label,$black);

// rotate the temp image
$labelimage1 = imagerotate($labelimage,90,$white);

// copy the temp image back to the real image
imagecopy($image,$labelimage1,3,$vmargin + $ysize/2 - $txtsz/2,$txtht,$txtsz);

// destroy temp images,clear memory
imagedestroy($labelimage);
imagedestroy($labelimage1);

大佬总结

以上是大佬教程为你收集整理的带有dompdf的垂直文本全部内容,希望文章能够帮你解决带有dompdf的垂直文本所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签: