Reading/Web/PDF Functionality/zh

2018年4月更新
图书功能会通过PediaPress回来. 在我们详细研究了新的生成器后，我们发现原有图书生成器的核心功能（如页码和目录）在新的生成器上很难执行. 除此之外，我们的连接代码也有重要的问题. 因此，将PDF图书功能带回Wikimedia项目需要新的替代方案. PediaPress是Wikimedia图书功能的最初赞助者. 我们找到了PediaPress，希望知道他们是否愿意接手将图书生成为PDF的任务. 我们的想法获得了同意，目前正在研究细节和制定计划. 他们将会从基于原来用于创建PDF的旧技术的解决方案开始. 这些解决方案可能会有一些视觉内容（如地图）方面的缺点，但是可以提高解决方案的运行速度. 接下来他们计划基于前一解决方案的反馈推出一个新的将HTML转换为PDF的生成器.

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

2017年九月更新
我们目前的PDF渲染服务，离线内容生成器（OCG）现已不在维护. 说白了，就是坏掉了. 维基媒体基金会阅读团队已决定在接下来几个月内替换这一服务. OCG依然基于过时代码运行，这今后可能导致安全漏洞及其他严重问题. 在过去3个月内，我们在PDF创建页面放置横幅，请求就新渲染模式提供反馈. 新的渲染器将以OCG为基础改进其性能——它将能够打印表格和信息框，并将包含朝向最佳易读性努力的样式设计. 我们收到了很多新模式的积极反馈，并且正致力于为新的PDF生成器进行必要更新.

后续补充：将生成PDF图书生成功能关闭一段时间
不幸的是，原有生成器（OCG）的主要问题迫使我们将它从生成选项中移除，而不是继续对其进行必要的更新. 这个结果比我们期待的要早. 移除OCG的时候，将单独的页面转换为PDF的操作依然可以完成. 但在我们评估和完成必要的工作前图书PDF的生成将会暂停. 我们最初选择用Electron渲染服务进行替换，但它不支持较大的PDF文件，在尝试生成有多个页面的图书时也会失败. 我们会继续尝试找到新的符合我们要求同时能够控制文件大小的图书生成系统. 这并不是我们如何计划这样做，因为我们从来就没有暂时移除图书PDF功能的目的.

時間軸:


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

功能:

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

In addition to this page being updated, this will be communicated in a banner on PDF creation page, in Tech News and on some Wikimedia mailing lists.

介紹
我們目前的PDF渲染服務，離線內容產生器不再維護. 簡單的講，它已經过期了. 它原本由第三方建立架構，而目前仍在運行老舊的程式代碼，而這在今後可能導致安全漏洞及其他大規模問題. 如果我們仍然需要PDF功能，遺憾的講，我們將不得不替換它，或者我們突然找到一種不需要計劃什麼，甚至不需要這種功能的解決方案.

Additionally, it does not support a number of rendering requests from the community, the main one being the ability to render tables. 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.

Userbase
The following table shows a sample of traffic to the Electron "Download as PDF" service for over a 6 hour period. The traffic is broken down by operating system (OS), browser, and the browser major version (e.g. Windows 7, Chrome v61.*).

Note well that the majority of our traffic appears to come from Windows based machines.

Current Functionality Requirements
The following is a list of the current requirements for PDF rendering for single-article PDF's and for books. The requirements different from the current implementation are displayed in bold.

History

 * Rendering PDF articles and books from Wikipedia pages is handled by a service called OCG. When rendering "books" through the book creator, it uses OCG as embedded within the Collection extension. OCG has multiple issues, especially with tables.


 * Multiple issues with OCG are identified, including complaints from the community around OCG's inability to render tables.
 * Rendering of tables ranks as number 9 on the German-speaking Community Technical Wishlist.
 * Wikimedia Deutschland begins on working on a solution for rendering tables in PDF's, and introduces Electron. They do this planning to run it alongside OCG, not to replace it.
 * At the same time as Wikimedia Deutschland is working on the Electron service, the responsible maintainers of the OCG service at the Wikimedia Foundation come to the conclusion that OCG has to be replaced.
 * The WMF Reading Team takes over the responsibility for the long term maintenance of PDF rendering begins plans on implementing table rendering across all projects.
 * The Reading team launches a community consultation for gathering feedback on Electron.
 * The Reading Infrastructure and Web teams begin scoping the working necessary to port OCG functionality over to the Electron service.

Update After Consultation
We launched a consultation on the current implementation of the PDF renderer in early June, 2017. After reviewing the consultation responses, we have made the following observations:


 * A larger number of users preferred the single-column format over the double column format
 * Users which prefered the double-column format highlighted that their preference was based in the styling and look and feel of double columns. Some users also expressed concerns with font size and wasting paper when printing PDF's in the single-column option
 * The following feature requests were made:
 * Functional hyperlinks
 * Date and url, 'this page downloaded [date] from [URL]'
 * Customizable css for layout, title, TOC
 * Option for 2 column format
 * Include/exclude images versions
 * Modifiable margins
 * print by section - allows you to remove references, paragraphs you don’t want, index, etc
 * allowing configurable text size

Based on the feedback, we have incorporated the following into our new print styles:


 * 超链接
 * 条目信息
 * smaller font and book-like styling

The remainder of the requests above will be postponed until the second iteration of the PDF renderer, in which we plan to build a settings mode that will allow for customization of the available options.

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


 * Individual articles will be rendered to PDF using the "Download as PDF" link in the sidebar
 * Multiple articles will be rendered to PDF using the Book Creator tool
 * All articles will contain attribution for text and images
 * All PDFs rendered will be able to print tables
 * Users will be able to customize the layout of their PDF (optional)

Design
The new PDF styles will be designed for increased readability. Based on community feedback and qualitative or quantitative testing, support for a 2-column layout may be built for the book creator and/or for individual PDFs.

Development and Deployment Roadmap
The following is a rough outline of the development and deployment roadmap. It is subject to change.


 * 1) 2017年4~5月：
 * 2) The Reading team builds back-end support for functionality identified above
 * 3) Communities are consulted on expanding or shrinking proposed functionality
 * 4) Qualitative test performed for styling
 * 5) 2017年6~7月：
 * 6) New styles implemented
 * 7) First iteration is launched along with OCG on all projects and performance is compared
 * 8) Iterations based on consultations and identified edge cases
 * 9) 2017年8~9月：
 * 10) Additional changes made if necessary
 * 11) 2017年10月
 * 12) Second iteration launched without OCG on all projects

Single Articles

 * A PDF for a single article will be created by selecting the "Download as PDF" link
 * Upon selecting "Download as PDF", the PDF file will be generated. To download the file, users will select the "Download the file link"
 * Each PDF file will contain the following:
 * Article title and text
 * 資訊框 （如果有）
 * 表格s （如果有）
 * Single-column layout
 * 頁碼
 * All article images and captions
 * Links to pages linked from the article (blue links and external links)
 * Text and image sources, contributors, and licenses

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.

Functionality available in October, 2017
Note: no changes will be made to the current book creator workflow at this time


 * User will launch the books creator by selecting "Create a book"
 * This will navigate to the current book creation page
 * To download a book, users will select the "download" link from the books page
 * Users may only download books in PDF format
 * Books will contain all elements from single article format as well as:
 * 圖書標題頁面
 * The references for each article from the book will appear at the end of the article
 * 每个条目将出现在新页面上
 * A single section for text and image sources, contributors, and licenses, that contains the collected contributions from all articles

Functionality available in November - December, 2017
Styles for books will be updated for improved readability
 * Books will contain a table of contents with page numbers
 * Selecting a section from the table of contents will navigate the user to the corresponding section within the book

Alternative
There is an alternative way of exporting MediaWiki to LaTeX, PDF, ODT and EPUB:

http://mediawiki2latex.wmflabs.org/

The computational resources on the server are limited.

If you run Ubuntu Linux and want results faster, you can install the m2l-pyqt or mediawiki2latex packages.

__INDEX__