首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >打印格式文本

打印格式文本
EN

Stack Overflow用户
提问于 2015-12-14 12:52:48
回答 1查看 787关注 0票数 0

我在print中为course information添加了Moodle函数。使用TCPDF libraryjavascript,它从$description variable中打印以下内容

课程可见度和课程排序课程课程将首先按可用性排序(已提供给学生的课程将首先出现,然后是学生无法使用的课程),然后按学期进行排序。例如,如果您在本学期教授一门课程,并且学生可以使用,它将出现在您的课程列表的顶部。如果您在本学期中教授一门课程,而学生却无法使用,则在所有可供学生使用的课程之后,它将出现。 学生一年级学生二年级研究生

请注意,«courses»附带了pdf中的原始格式!

下面是我在printpdf.php中使用的代码

代码语言:javascript
复制
$html = '<html>
<body>
<img src="/moodle/theme/base/pix/logo.png" alt="test alt attribute" border="0" height="100" width="220" allign="left" /><br />
<p><span style="font-size: small;"><font color="#######">Organisation name<br><b>Directorate <br><b>Department </b><br>Subdepartment</font></span></p>
<h2>Course Information</h2>
<h3>'. $title . '</h3><br />
'. $description . '<br />
</body>
</html>';

$pdf->writeHTML($html, true, false, true, false, '');

$pdf->lastPage();
$pdf->Output('CourseInfo.pdf', 'D');

是否可以像在$description页面上那样以原始格式打印它?

课程可见性与排序

Instructors:课程将首先按照可用性进行排序(已提供给学生的课程将首先出现,然后是不可供学生使用的课程),然后按学期进行排序。例如,如果您在本学期教授一门课程,并且学生可以使用,它将出现在您的课程列表的顶部。如果您在本学期中教授一门课程,而学生却无法使用,则在所有可供学生使用的课程之后,它将出现。

学生:

  • 一年级学生
  • 二年级学生
  • 研究生
EN

回答 1

Stack Overflow用户

发布于 2015-12-14 13:38:11

您可以以html方式更改要传递给$descriptionprintpdf.php变量。

代码语言:javascript
复制
<h2>Course Visibility and Sorting</h2>

 <p>Instructors: The «courses» will be sorted first by availability (courses     
that have been made available to students will show up first followed by courses     
not available to students), then by semester. For example, if you are teaching a     
course in the current semester and it is available to students, it will 
appear at the top of your course listing. If you are teaching a course in      
the current semester and it is not available to students, it will appear 
after all the courses that are available to students. </p>

<h2>Students:</h2>
<br>

first year students<br>
second year students<br>
post graduate<br>
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/34267573

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档