阅读/网络/PDF功能

From mediawiki.org
< Reading‎ | Web
This page is a translated version of the page Reading/Web/PDF Functionality and the translation is 73% complete.
Outdated translations are marked like this.

2019年7月15日PDF渲染的更新

We’ve launched the new PDF renderer. We’re looking at feedback, but haven't so far seen any significant issues. We might incorporate some suggestions, but want to note that this is not an ongoing project with continuous development. In other words, now that it's deployed and proven to work, the new renderer is entering maintenance mode. The talk page of this page won’t be abandoned, but it could take a while before anyone reacts, simply because everyone's got so much else on their plate.

In terms of books, we've left it in the hands of volunteer developers and PediaPress. We'll be glad to reach out to them with questions, but we're not planning any involvement in terms of the technical implementation.

2019年6月4日PDF渲染的更新

我們已經將新的渲染器作為單頁PDF的默認PDF渲染器應用至所有項目。 We hope this will resolve the issues associated with the Electron renderer, which was often unable to generate PDFs as expected. 如果有任何關於新的渲染器的問題或者相關錯誤與議題,請隨時與我們聯繫。

2019年3月18日PDF渲染的更新

We're getting close to the deployment of our new renderer, Proton, with only a few tasks remaining as blockers (as can be seen in the task graph in phab:T181084). 一旦设置了部署日期,我们将发布另一个更新。 此渲染器将替换电子渲染器作为单页PDF的默认PDF渲染器。

2018年8月17日图书更新

PediaPress的样书

这份PDF 更新且更全面的示例 展示了新的书本渲染效果,相较于在维基年会上发布的第一版本布局已经有了很大变化,感谢大家的反馈。导出功能仍有一些明显的问题:页面断裂,消息框,表格以及数学公式都还可以有很大的改进空间。这份PDF 专注于国际化脚本和数学公式的样本文件 中就有几处需要解决的问题。数序公式现在是使用MathML来渲染的,改为使用LaTeX后效果应该会显著提升。 The layout changed quite a from the first version presented at Wikimania. Thanks for all the feedback. The export still has a number of significant issues: page breaks, infoboxes, tables, and math formulas need to be improved substantially. This sample file focusing on international scripts and math formulas reveals some of the problems that still need to be solved. Math formulas are currently rendered using MathML - switching to LaTeX should lead to significant improvements.

2018年8月8日图书更新

我们一直在与PediaPress合作制作和设计新书。他们为我们提供了当前输出的样本,这与最终版本非常相似。我们与PediaPress团队讨论了他们目前正在解决的改进点。如果您对这些样品有任何反馈或其他意见,请在讨论页告诉我们。

2018年4月图书更新

图书功能会通过PediaPress回来。在我们详细研究了新的生成器后,我们发现原有图书生成器的核心功能(如页码和目录)在新的生成器上很难执行。除此之外,我们的连接代码也有重要的问题。因此,将PDF图书功能带回Wikimedia项目需要新的替代方案。PediaPress是Wikimedia图书功能的最初赞助者。我们找到了PediaPress,希望知道他们是否愿意接手将图书生成为PDF的任务。我们的想法获得了同意,目前正在研究细节和制定计划。他们将会从基于原来用于创建PDF的旧技术的解决方案开始。这些解决方案可能会有一些视觉内容(如地图)方面的缺点,但是可以提高解决方案的运行速度。接下来他们计划基于前一解决方案的反馈推出一个新的将HTML转换为PDF的生成器。 After investigating the new renderer in depth, we realized that core features of the original book creator (such as page numbers and table of contents) would be very difficult to implement using the new renderer. In addition, we had significant issues with our concatenation code. Thus, we had to look for alternatives in terms of bringing back the PDF books functionality on Wikimedia projects. We reached out to PediaPress, who were the original patrons of books on Wikipedia to see if they would be interested in taking up PDF rendering for books once again. They have agreed and we are currently working on the details and schedule. They will start by working on a temporary solution based on an older technology that has previously been used to create PDF. This might have some drawbacks when it comes to graphical elements, such as maps, but will mean a faster working solution. They then plan to work on a new HTML-to-PDF renderer afterwards, based on feedback on the first implementation.

2018年1月更新

我们正在准备图书功能的性能测试。在2月初我们会得到更多信息。

2017年九月更新

我们目前的PDF渲染服务,离线内容生成器(OCG)现已不在维护。说白了,就是坏掉了。维基媒体基金会阅读团队已决定在接下来几个月内替换这一服务。OCG依然基于过时代码运行,这今后可能导致安全漏洞及其他严重问题。在过去3个月内,我们在PDF创建页面放置横幅,请求就新渲染模式提供反馈。新的渲染器将以OCG为基础改进其性能——它将能够打印表格和信息框,并将包含朝向最佳易读性努力的样式设计。我们收到了很多新模式的积极反馈,并且正致力于为新的PDF生成器进行必要更新。 Simply put, it's breaking down. The Reading team at the Wikimedia Foundation has been working towards replacing it for months. OCG has been running on outdated code which may introduce security vulnerabilities and other major issues in the future. Over the last three months, we’ve had banners on the PDF creation page asking for feedback on the prototype for our new renderer. The new renderer will have improved capabilities from OCG – it will be able to print tables and infoboxes and will contain styling focused on better readability. We've gathered a lot of good feedback on the prototype and are working on making the required updates to our new PDFs.

后续补充:将生成PDF图书生成功能关闭一段时间

不幸的是,原有生成器(OCG)的主要问题迫使我们将它从生成选项中移除,而不是继续对其进行必要的更新。这个结果比我们期待的要早。移除OCG的时候,将单独的页面转换为PDF的操作依然可以完成。但在我们评估和完成必要的工作前图书PDF的生成将会暂停。我们最初选择用Electron渲染服务进行替换,但它不支持较大的PDF文件,在尝试生成有多个页面的图书时也会失败。我们会继续尝试找到新的符合我们要求同时能够控制文件大小的图书生成系统。这并不是我们如何计划这样做,因为我们从来就没有暂时移除图书PDF功能的目的。 This is earlier than we wanted. By the time we remove OCG, the work for rendering of single articles will be completed. However, the rendering of books will be paused while we evaluate and complete the necessary work. Our initial choice of renderer for the replacement, the Electron rendering service, is not capable of supporting PDFs of larger sizes and fails when attempting to render a book with multiple articles. We will be working to select a new rendering system for books which can handle the size of the files and support our requirements. This is not how we planned to do this. We never aimed to temporarily remove the book PDF functionality.

時間軸:

  • 发布功能完备的单页生成器(打印到PDF)——2017年10月1日
  • 暂停图书PDF渲染——2017年10月1日
  • 彻底停用OCG渲染器——2017年10月1日
  • 发布完整功能的图书渲染器——2018年1月(基于研究结果计划发布的备选渲染系统)

功能:

一系列当前的和将要到来的功能,参见该页

除了更新此页面之外,还将在PDF创建页面的横幅中,技术新闻和一些维基媒体邮件列表中进行传达。

介紹

我們目前的PDF渲染服務,離線內容產生器不再維護。簡單的講,它已經过期了。它原本由第三方建立架構,而目前仍在運行老舊的程式代碼,而這在今後可能導致安全漏洞及其他大規模問題。如果我們仍然需要PDF功能,遺憾的講,我們將不得不替換它,或者我們突然找到一種不需要計劃什麼,甚至不需要這種功能的解決方案。 Simply put, it's breaking down. Originally created by a third party, it currently runs on outdated code which may introduce security vulnerabilities and other major issues in the future. If we're to have the PDF functionality, we unfortunately have to replace it, or we might suddenly find ourselves in a situation where we'd have to take it down without having planned to do so.

此外,它不支持来自社区的大量呈现请求,主要是呈现表格的能力。我们选择了一项新服务电子渲染服务作为合适的替代品。我们的下一步是使用电子渲染服务复制OCG提供的功能。下面,我们将描述我们已经确定的必要功能的主要部分。我们想邀请谈谈所提供的清单中遗漏的内容或多余内容。我们还想强调我们未来的PDF渲染计划,以收集初步反馈。 We have selected a new service, the electron rendering service, as a suitable replacement. Our next step is to duplicate the functionality provided by OCG using the electron rendering service. Below, we will describe the main portions of the functionality we have identified as necessary. We would like to invite conversation around what is missing or what is superfluous in the provided list. We would also like to highlight over our future plans for PDF rendering to gather initial feedback.

已知問題

用户群

下表显示了在超过6小时的时间段中使用“下载为PDF”服务的流量示例。 流量按操作系统(OS)、浏览器和浏览器主要版本(例如Windows 7,Chrome v61.*)进行细分。 请注意,我们的大部分流量似乎来自基于Windows的计算机。

OS 浏览器 浏览器主流版本 请求百分比 
其他 其他 - 14.38
Windows 7 Chrome 61 12.42
Windows 10 Chrome 61 8.83
Windows 7 IE 11 7.33
Windows 7 Firefox 56 6.59
Windows 10 Firefox 56 3.82
Windows 10 Edge 15 3.24
Windows 8.1 Chrome 61 3.07
Windows XP Chrome 49 2.2
Windows 10 Chrome 59 1.53
Windows 10 IE 11 1.51
Windows 8.1 Firefox 56 1.31
Windows XP Firefox 52 1.22
Windows 8 Chrome 61 1.15
Windows 8.1 IE 11 1.15
Mac OS X Safari 11 0.9
Windows 7 Firefox 53 0.89
Windows 7 Firefox 52 0.78
Ubuntu Firefox 56 0.78
Windows XP IE 6 0.7
Windows 7 Chrome 55 0.68
Windows 7 Firefox 55 0.62
Mac OS X Chrome 61 0.62
Android UC Browser 11 0.6
Windows 10 Edge 14 0.59
Windows 7 Opera 48 0.53
Android Chrome Mobile 61 0.49
Windows 10 Opera 48 0.44
Windows 7 Chrome 60 0.4
Windows Vista Chrome 49 0.39
Windows 7 Yandex Browser 17 0.37
Windows 10 Firefox 55 0.37
Mac OS X Safari 10 0.36
Windows 10 Chrome 50 0.34
Android Android 4 0.33
Mac OS X Firefox 56 0.33
Windows 10 Chrome 60 0.32
Windows 8.1 Chrome 43 0.3
Android Amazon Silk 60 0.29
Windows 7 Sogou Explorer 1 0.27
Windows 8 IE 10 0.26
Windows 7 IE 8 0.26
Windows 7 IE 9 0.25
Windows 8 Opera 12 0.25
Linux Firefox 52 0.25
Mac OS X Firefox 53 0.24
Windows 7 Firefox 45 0.24
Windows 10 Firefox 57 0.24
Windows 7 Firefox 38 0.22
Windows 10 Firefox 47 0.21

当前功能要求

以下是单篇文章PDF和书籍的PDF呈现的当前要求列表。与当前实现不同的要求以粗体显示。

历史

  • 从维基百科页面呈现PDF文章和书籍由名为OCG的服务处理。通过书籍创建者呈现“书籍”时,它使用Collection扩展中嵌入的OCG。[$url OCG有多个问题],尤其是表格

When rendering "books" through the book creator, it uses OCG as embedded within the Collection extension. OCG has multiple issues, especially with tables.

  • 确定了OCG的多个问题,包括社区对OCG无法呈现表格的投诉。
  • 在德语社区技术愿望清单上,表格的渲染排名第9。
  • 德国分会开始研究PDF中的解决方案,并介绍了Electron。他们计划与OCG一起运行,而不是替换它。
  • 在维基媒体德国公司致力于电子服务的同时,维基媒体基金会OCG服务的负责维护者得出的结论是,必须更换OCG。
  • WMF阅读小组接管PDF长期维护的责任,开始计划在所有项目中实施表格渲染。
  • 阅读团队发起社区咨询,收集有关Electron的反馈。
  • 阅读基础设施和Web团队开始确定将OCG功能移植到Electron服务所需的工作范围。

咨询后更新

根据咨询反馈提出的PDF和打印样式

我们于2017年6月初就PDF呈现器的当前实施情况展开了咨询。在审核了咨询回复后,我们发表了以下意见:

  • 大量用户更喜欢双列格式的单列格式
  • 喜欢双列格式的用户强调他们的偏好基于双列的样式和外观。在单列选项中打印PDF时,一些用户还表达了对字体大小和浪费纸张的担忧
  • 发出以下功能要求:
    • 功能超链接
    • 日期和网址,'此网页从[网址]下载[日期]'
    • 可自定义的布局,标题,TOC的CSS
    • 2列格式的选项
    • 包含/排除图像版本
    • 可修改的利润率
    • 按部分打印,允许您删除引用、不需要的段落、索引等
    • 允许可配置的文本大小

根据反馈,我们将以下内容纳入我们的新打印样式:

  • 超链接
  • 条目信息
  • 较小的字体和书籍样式

上述请求的其余部分将推迟到PDF渲染器的第二次迭代,我们计划在其中构建一个允许自定义可用选项的设置模式。

提案

下面是界定PDF渲染所需的功能的范围的提案:

以下是PDF呈现所需功能范围的建议:

  • 使用侧栏中的“下载为PDF”链接将单个文章呈现为PDF
  • 使用Book Creator工具将多篇文章呈现为PDF
  • 所有文章都将包含文字和图片的归属地
  • 渲染的所有PDF都可以打印表格
    • 用户将能够自定义其PDF格式(可选)

当前与今后实现方式间的不同

OCG 新服務 備註
渲染單個條目
使用圖書創建器渲染多個條目
包含多個條目的目錄
渲染表格 No
署名 开放问题:新服务中的署名位置
样式 Latex 新样式
数栏布局 No
默认双栏布局 试验中 将根据反馈和定量和/或定性测试选择默认的一列或两列布局
輸出格式 PDF與純文字 僅限PDF

设计

新的PDF样式将被设计用于提高可读性。基于社区反馈和定性或定量测试,可以为书籍创建者和/或单个PDF构建对2列布局的支持。

开发和部署路线图

以下是开发和部署路线图的概述,它可能会改变。

  1. 2017年4~5月:
    1. Reading团队为上述功能构建后端支持
    2. 在扩展或缩小提议的功能方面,咨询社区
    3. 为造型进行定性测试
  2. 2017年6~7月:
    1. 实施了新的风格
    2. 首次迭代与OCG一起在所有项目上启动,并对性能进行了比较
    3. 基于协商和确定的边缘情况的迭代
  3. 2017年8~9月:
    1. 必要时进行其他更改
  4. 2017年10月
    1. 在没有OCG的情况下在所有项目上启动了第二次迭

单篇文章

  • 通过选择“下载为PDF”链接,将创建单篇文章的PDF
  • 选择“下载为PDF”后,将生成PDF文件。要下载该文件,用户将选择“下载文件链接”
  • 每个PDF文件将包含以下内容:
    • 条目标题和文字
    • 資訊框 (如果有)
    • 表格 (如果有)
    • 单列布局
    • 頁碼
    • 所有文章图片和标题
    • 链接到文章链接的页面(蓝色链接和外部链接)
    • 文本和图像源,贡献者和许可证

Phabricator Tracking

All PDF-related changes including sunsetting OCG, replacing the Electron PDF renderer, and any updates to books or the collections extension are tracked under the phabricator project Proton. The project page will display any recent updates for all tasks related to PDFs.

书籍

2017年11月至12月期间提供的功能

Note: no changes will be made to the current book creator workflow at this time

  • 用户将通过选择“创建书籍”来启动图书创建者
  • 这将导航到当前的图书创建页面
  • 要下载图书,用户将从图书页面选择“下载”链接
  • 用户只能下载PDF格式的图书
  • 书籍将包含单篇文章格式的所有元素以及:
    • 圖書標題頁面
    • 书中每篇文章的参考文献将在本文末尾出现
    • 每个条目将出现在新页面上
    • 文本和图像源,贡献者和许可证的单个部分,包含所有文章的收集贡献

2017年11月至12月期间提供的功能

  • 书籍将包含带有页码的目录
    • 从目录中选择一个部分将导航用户到书中的相应部分

将更新书籍样式以提高可读性

替代

还有另一种将MediaWiki导出到LaTeX,PDF,ODT和EPUB的方法:

http://mediawiki2latex.wmflabs.org/

服务器上的计算资源是有限的。

如果您运行Ubuntu Linux并希望更快地获得结果,则可以安装m2l-pyqtmediawiki2latex