如何使用Angular创建n个可打印页面? [英] How to use Angular to create n printable pages?

查看:190
本文介绍了如何使用Angular创建n个可打印页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我想知道如何使用Angular创建可打印的内容,跳转到结束页面并打印更多内容。



如何强制内容始终适合特定尺寸,如PDF?我需要Angular来做到这一点吗?如果不是HTML,我可以遍历PDF可打印页面吗?



示例:

假设我是一名教师,并且我已经要求我的学生将10行文章发送到特定的网络系统。现在,在管理页面中,我想在10个页面上打印10篇学生论文,每篇论文都从相应页面的第0行开始。

示例2:



假设我想打印n个空白页。在系统上,我被问到需要多少页面,并且Angular打印它。



示例3:



假设我有一个有3个名字的数组。我想在第一页打印第一个名字,第二个打印第二个,第三个打印第三个。
$ b @edit



这是已执行的最终项目。这是一个timeSheet生成器。它需要app.js中的一个数组,并为每个员工打印一个新页面。

您只需应用相应的CSS: / p>

  .pageBreak {
page-break-after:always;
}


{{essay}}
< / p>

每篇文章都会印在单独的页面上。


Well, I've searched a bit and did not find anything similar.

I want to know how can I use Angular to create printable content, jump to the end of the page and print more content.

How can I force the content to always fit on a specific size, like a PDF? Do I need Angular to do this? If not HTML, can I iterate over PDF printable pages?

Example:

Suppose I'm a teacher and I've asked my students to send a 10 lines essays to a specific web system. Now, in the admin page, I want to print 10 students essays on 10 pages, every one of them starting on line 0 of the respective page.

Example 2:

Suppose I want to print n blank pages. On a system, I'm asked how many pages do I want and Angular prints it.

Example 3:

Suppose I have an array with 3 names. I want to print the first name on the first page, second on the second and third on the third.

@edit

This is the final project implemented. It's a timeSheet generator. It takes an array inside app.js and print a new page for every employee.

解决方案

You simply apply the appropriate CSS:

.pageBreak {
  page-break-after: always;
}


<p ng-repeat="essay in essays" class="pageBreak">
{{essay}}
</p>

Every essay will be printed on a separate page.

这篇关于如何使用Angular创建n个可打印页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆