简体   繁体   English

如何在drupal 7中打印页面?

[英]How to print a page in drupal 7?

I have a module for drupal 7 that generate reports. 我有一个用于drupal 7的模块,可以生成报告。 I want to print one of the reports with out drupal menus and footer. 我想打印一份报告,没有drupal菜单和页脚。 I want the report to be displayed on second page alone with view descriptive data? 我希望报告仅与查看描述性数据一起显示在第二页上吗? Please Help. 请帮忙。

After hacking in to print module's cod. 入侵以打印模块的鳕鱼后。 I found that to generat blank drupal page use the following in the link call back 我发现要生成空白的drupal页面,请在链接回调中使用以下内容

drupal_send_headers(); drupal_send_headers();
print $myHTML; 打印$ myHTML;

假设您要打印的报告是节点,则“ 打印”模块应能够处理所需的内容。

In your page callback you can simply print out the information you want and then die, but that will prevent shutdown functions and hook_exit tasks. 在页面回调中,您可以简单地打印出所需的信息然后消失,但这将阻止关机功能和hook_exit任务。 The better way would be to use drupal_page_footer() 更好的方法是使用drupal_page_footer()

http://api.drupal.org/api/drupal/includes!common.inc/function/drupal_page_footer/7 http://api.drupal.org/api/drupal/includes!common.inc/function/drupal_page_footer/7

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

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