Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Plugins 对虾和文本格式_Plugins_Ruby On Rails 3_Prawn_Prawnto - Fatal编程技术网

Plugins 对虾和文本格式

Plugins 对虾和文本格式,plugins,ruby-on-rails-3,prawn,prawnto,Plugins,Ruby On Rails 3,Prawn,Prawnto,Prawn/prawnto是生成pdf文件的很酷的东西。但是我不能完全按照它们的样子呈现格式化文本。Prawn正在将所有html标记,呈现为字符串。下面是我写的代码 pdf.text“#{@product.name}”,大小=>20,样式=>:粗体 pdf.text“Ashis Rai” 并希望看到结果 Nokia N97 Ashis Rai 诺基亚N97 阿希斯莱 但我得到的最终结果如下 诺基亚N97 ashisraipdf.text方法将呈现所传递的内容。要使文本加粗,需要使用 pdf.

Prawn/prawnto是生成pdf文件的很酷的东西。但是我不能完全按照它们的样子呈现格式化文本。Prawn正在将所有html标记,呈现为字符串。下面是我写的代码

pdf.text“#{@product.name}”,大小=>20,样式=>:粗体
pdf.text“Ashis Rai”

并希望看到结果

Nokia N97 Ashis Rai 诺基亚N97 阿希斯莱 但我得到的最终结果如下

诺基亚N97

ashisrai

pdf.text方法将呈现所传递的内容。要使文本加粗,需要使用

pdf.text,:font\u style=>:粗体

获取文档的一个好方法是运行 gem服务器

然后将浏览器指向


这将为您提供有关方法和一些选项的更多详细信息。

下面有一个选项,允许我们的格式化文本在pdf文件中呈现

:inline_format => true
你可以通过@Angela查看