使用XSL-FO,CSS3而不是CSS2来创建如PDF的分页文档? [英] Use of XSL-FO, CSS3 instead of CSS2 to create Paginated documents like PDF?

查看:203
本文介绍了使用XSL-FO,CSS3而不是CSS2来创建如PDF的分页文档?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有很多旧文本,例如 2002年的这本书,说明我们必须使用CSS for Web和XSL-FO for print。
我想在现在(2012年),我们可以,最后,使用CSS与渲染引擎,了解分页媒体的CSS2 和某些 CSS3 ...但是在新文本的地方,程序员的投资和软件厂的投资?



XSL-FO或XSL格式化对象(W3C标准)是生成PDF文档最常用的技术,
来自XML或XHTML内容。版本 1.1的XSL-FO
于2006年发布,1.0 in 2001



CSS2.1是从2011年,但CSS2.0是1998年的标准,在2008年修订...我认为标准年龄不是一个问题。 使用HTML,XHTML或XML的CSS具有打印力:查看 PrinceXML WebKit打印模块(或 wkhtmltopdf ), ABCpdf 和其他人。



在CSS和XSL-FO之间选择:使用CSS2,您可以将文本完全适合纸页等。
这不是分页,多列布局,脚注,正在运行的页眉或页面边距...
无论是CSS,分页媒体还是XSL-FO,都是很好的标准。



PS:针对此上下文有一些相关问题/答案,关于webkit变换使用PHP进行转换以及使用HTML生成PDF 。没有人能解答这个问题。

解决方案

感谢所有评论和解答!



现在,2014年,我的职位超过了1.5年(5月17日),是时候巩固:对我来说,没有答案是一个完全答案,但所有的答案(见Nenotlep和亚历克斯)有助于形成一个大局。
现在,我的主要动机是巩固,是2013-11的 @ mzjn的新闻(这里)。 / p>

XSL-FO正式停用



星期六,2013-11-02, Liam RE Quin 写了
我们关闭了工作组,因为没有足够的人参加 ,W3C XML活动主管,关于 XSL-FO 2.0 连续性的失败。 (请参阅此处更好地复制)。



工作草案的最后一次更新是2012年1月,现已确认: W3C停止开发XSL-2



为什么?它将被 CSS3页面替换,如下所示。



PS:要讨论官方统计,请使用 http://stackoverflow.com/a/21345449 / 287948



CSS3正式成长



标准 CSS3-page 是一个草稿,但许多应用程序,例如 PrinceXML v9 AntennaHouse Formatter v6 表明它准备好了(!);并且预期推出的 HTML5 for 2014 包含



因此,我理解对于W3C, CSS3-page 做我们需要表达的所有东西打印和良好的PDF



其他动机



。PDF将死它是复杂的,不是XML系列或W3C投资的一部分,并且许多人声称EPUB将取代它。
这是另一个很好的动机:平板电脑阅读器和PC浏览器将打印(HTML,XHTML和EPUB)以及PDF。所以PDF不是必要的...而且,对于这一天,唯一的标准需要, Webkit打印项目将是CSS3网页
标准。



CSS3是两个战略事务的关键点:1)从XML或HTML内容生成良好的PDF;






注意:问题链接的另一个2014年更新: wkHtmlToPDF 现在在这里。关于新文本,现在我们有很多,见前。 使用CSS3构建图书









为此页面的问题,程序员提供了一个更新的答案,为什么使用XSL-FO而不是CSS2, HTML into good PDF?



如果进一步为 XML-发布没有好的理由使用 XSL-FO 。总结:




  • XSL-FO是当今的一项死技术,仅供利基市场公司使用,出版公司,如Elsevier ... Stackoverflow的大多数作家/读者来自中小型公司。像 O'Reilly Media,Inc.已经使用CSS3进行打印的公司。

  • 将取代CSS2,覆盖CSS2 的所有空白(和@ AlexS的恐惧)


  • 今天(2014),你可以通过谷歌或我的链接检查(见PrinceXML v9和AntennaHouse Formatter v6),我们有一些好的软件,


  • 作为@bytebuster说,CSS更容易开发 (和更容易学习!)。


  • 如上所述,CSS3不是孤立的,它是一个XML / HTML / SVG家庭


  • 比XSL-FO模板开发HTML + CSS模板(标准Web设计师执行简单任务的每小时成本)



  • ul>







    新闻...


    $ b b

    2016年1月,最终的CSS3标准即将到来!



    关于W3C标准:旧的css-page ,分页媒体 分片 ...现在是候选建议,见 https://www.w3.org/TR/css-break-3 p>

    There are a lot of old texts, like this 2002 book, stating that we must use "CSS for Web" and "XSL-FO for print". I think in nowadays (2012) we can, finally, to use CSS with render engines that understand paged media of CSS2 and something of CSS3... But where the "new texts", the consensus of programmers, and the investment of softhouses?

    XSL-FO or "XSL Formatting Objects" (a W3C standard) was the most often used technology to generate PDF documents, from XML or XHTML content. Version 1.1 of XSL-FO was published in 2006, 1.0 in 2001.

    CSS2.1 is from 2011, but CSS2.0 is a 1998 standard, revised in 2008... I think standard ages are not a problem. CSS with HTML, XHTML or XML have "the power of print": see tools like PrinceXML, WebKit print module (or wkhtmltopdf), ABCpdf and others.

    Choosing between CSS and XSL-FO: with CSS2 you can fit the text exactly to the paper page, etc. It's not a matter of pagination, multiple column layouts, place footnotes, running headers, or margins of a page... Both, CSS (paged media) and XSL-FO, are good standards to do this.

    PS: there are some related questions/answers for this context, about webkit transform, converting with with PHP and about Generation PDF from HTML. No one with good answer for this presented question.

    解决方案

    Thanks all comments and answers!

    Now, 2014, passed over 1.5 years of my post (May 17 '12), is time to consolidate: no answer was, for me, a "full answer", but all answers (see Nenotlep's and Alex's) contributed to form a big picture. My main motivation now, to consolidate, is the @mzjn's news (here) of 2013-11.

    XSL-FO is officially dying

    On Sat, 2013-11-02, Liam R. E. Quin wrote: "We have closed the Working Group because not enough people were taking part", W3C XML Activity Lead, about the failure of XSL-FO 2.0 continuity. (see a better copy here).

    The last update for the Working Draft was in January 2012, and now confirmed: W3C stop developing XSL-2.

    Why? It will be replaced by CSS3-page, see below.

    PS: to discuss the "official statment", use http://stackoverflow.com/a/21345449/287948

    CSS3 is officially growing

    The standard CSS3-page is a draft, but many applications, like PrinceXML v9 and AntennaHouse Formatter v6 demonstrated that it is ready (!); and, the expected launch of HTML5 for 2014 is carrying along the forecast release CSS3.

    So, I understand that for W3C, CSS3-page do all that we need to express good prints and good PDF.

    Other motivations

    One day, in a far future... PDF will dead — it is complex and is not part of the XML family or W3C investments —, and many claim that EPUB will replace it. This is another good motivation: tablet readers and PC browsers will print (HTML, XHTML and EPUB) as well as PDF. So PDF will be not necessary... And, for this day, the only standard need for, ex. Webkit printing project, will be the CSS3-page standard.

    CSS3 is the key point in two strategic affairs: 1) to generate good PDF from XML or HTML contents; 2) to replace PDF.


    NOTE: another 2014's updates for the links of the question: wkHtmlToPDF is now here. About "new texts", now we have many, see ex. Building Books with CSS3.



    An updated answer for programmers, for this page's question, Why use XSL-FO instead of CSS2, for transform HTML into good PDF?

    If you go further and implement a new system for XML-Publishing, there are no good reason to use XSL-FO. SUMMARIZING:

    • XSL-FO is a dead technology today, only used by niche companies, to give maintenance to legacy systems in big publishing companies, like Elsevier... Most writers/readers of Stackoverflow are from small and medium companies. Companies like O'Reilly Media, Inc. already use CSS3 for print.

    • CSS3 will replace CSS2, covering all gaps (and fears as @AlexS's) of CSS2.

    • today (2014), as you can check by Google or my links (see PrinceXML v9 and AntennaHouse Formatter v6), we have some good software to render content with CSS2 or CSS3.

    • as @bytebuster say, "CSS is much easier to develop" (and easier to learn!).

    • as I say above, CSS3 is not isolated, it is a piece of the "XML/HTML/SVG" family.

    • is much cheaper to develop "HTML+CSS templates" (hourly cost of a standard web designer doing a simple task), than "XSL-FO templates" (hourly cost of a rare professional in a complex task).

    • ....



    News...

    Jan'2016, the definitive CSS3 standard is coming!

    About W3C standards: the old "css-page" was replaced by "css-break", and "paged media" to "fragmentation"... Now it is a Candidate Recommendation, see https://www.w3.org/TR/css-break-3

    这篇关于使用XSL-FO,CSS3而不是CSS2来创建如PDF的分页文档?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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