简体   繁体   English

TCPDF:在一个 MultiCell 中使用不同字体样式的最佳方法是什么?

[英]TCPDF: What is the best approach for having different font-styles in one MultiCell?

I'm trying to create a PDF with TCPDF (www.tcpdf.com) and have some problems how I could achieve a Cell with a heading and content.我正在尝试使用 TCPDF (www.tcpdf.com) 创建一个 PDF 并且在如何实现具有标题和内容的单元格时遇到一些问题。

There's the possibility of using HTML within a cell, or I could use 2 cells which are stacked above.有可能在一个单元格内使用 HTML,或者我可以使用堆叠在上面的 2 个单元格。

Or do I have a chance in using SetFont for the different contents in the cell?或者我是否有机会将 SetFont 用于单元格中的不同内容?

Also: If someone would know how to do a rowspan with a MultiCell I would really appreciate it.另外:如果有人知道如何使用 MultiCell 进行行跨度,我将不胜感激。 Now If I'm making a bigger cell it pushes everything down under away (they would never collide because the rowspan-cell is far more right than the other cells.)现在,如果我正在制作一个更大的单元格,它会将所有内容推到下方(它们永远不会发生碰撞,因为行跨单元格比其他单元格更正确。)

Thank you!谢谢!

You have to use WriteHTMLcell() instead and use XHTML code.您必须改用 WriteHTMLcell() 并使用 XHTML 代码。 In this way you can change font, style, colors, and many other things.通过这种方式,您可以更改字体、样式、colors 和许多其他内容。 Check the example n.检查示例 n。 1 at http://www.tcpdf.org for further information. 1 在http://www.tcpdf.org了解更多信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM