Jump to content

Reading/Web/PDF Functionality: Difference between revisions

From mediawiki.org
Content deleted Content added
Tags: Mobile edit Mobile web edit
m make untranslatable
 
(38 intermediate revisions by 8 users not shown)
Line 1: Line 1:
<languages />
<languages/>
<translate>
<translate>
== Update on PDF rendering, July 15 2019 == <!--T:162-->
== Update on PDF rendering, July 15 2019 == <!--T:162-->
Line 10: Line 10:


== Update on PDF rendering, June 4, 2019 == <!--T:158-->
== Update on PDF rendering, June 4, 2019 == <!--T:158-->
</translate>
<translate><!--T:159--> We have deployed the new renderer for single-article PDFs for all projects.</translate>
<translate><!--T:160--> We hope this will resolve the issues associated with the Electron renderer, which was often unable to generate PDFs as expected.</translate>
<translate><!--T:161--> Please feel free to try out the new renderer and let us know if you have questions or come across any bugs or other issues.</translate>


<!--T:159-->
We have deployed the new renderer for single-article PDFs for all projects.</translate>
<translate>
<translate>
<!--T:160-->
We hope this will resolve the issues associated with the Electron renderer, which was often unable to generate PDFs as expected.</translate>
<translate>
<!--T:161-->
Please feel free to try out the new renderer and let us know if you have questions or come across any bugs or other issues.

== Update on PDF rendering, March 18 2019 == <!--T:148-->
== Update on PDF rendering, March 18 2019 == <!--T:148-->
</translate>
<translate><!--T:149--> 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 <tvar name=1>[[phab:T181084]]</tvar>).</translate>
<translate><!--T:150--> We will post another update once the deployment date is set.</translate>
<translate><!--T:151--> This renderer will replace the electron renderer as the default PDF renderer for single-page PDFs.</translate>


<!--T:149-->
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 <tvar|1>[[phab:T181084]]</>).</translate>
<translate>
<!--T:150-->
We will post another update once the deployment date is set.</translate>
<translate>
<translate>
<!--T:151-->
This renderer will replace the electron renderer as the default PDF renderer for single-page PDFs.

== Update on books, August 17 2018 == <!--T:131-->
== Update on books, August 17 2018 == <!--T:131-->
</translate>
[[File:Amphibious_aircrafts.pdf|thumb|<translate><!--T:172--> Sample book from PediaPress</translate>]]
<translate><!--T:132--> Here is an [[<tvar name=1>:File:Amphibious_aircrafts.pdf</tvar>|updated and more comprehensive sample]] of the new book renderer.</translate>
<translate><!--T:206--> The layout changed quite a from the first version presented at Wikimania.</translate>
<translate><!--T:207--> Thanks for all the feedback.</translate>
<translate><!--T:208--> The export still has a number of significant issues: page breaks, infoboxes, tables, and math formulas need to be improved substantially.</translate>
<translate><!--T:209--> This [[<tvar name=2>:File:I18n_math.pdf</tvar>|sample file focusing on international scripts and math formulas]] reveals some of the problems that still need to be solved.</translate>
<translate><!--T:210--> Math formulas are currently rendered using MathML - switching to LaTeX should lead to significant improvements.</translate>


<translate>
<!--T:129-->
[[File:Amphibious_aircrafts.pdf|thumb|Sample book from PediaPress]]

<!--T:132-->
Here is an [[:File:Amphibious_aircrafts.pdf|updated and more comprehensive sample]] of the new book renderer. 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 [[:File:I18n_math.pdf|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.

== Update on books, August 8 2018 == <!--T:128-->
== Update on books, August 8 2018 == <!--T:128-->


Line 45: Line 40:


== Update on books, April 2018 == <!--T:126-->
== Update on books, April 2018 == <!--T:126-->
</translate>
<translate><!--T:127--> Books functionality will be returning via [[w:PediaPress|PediaPress]].</translate>
<translate><!--T:182--> After investigating the new [[phab:T181084|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.</translate>
<translate><!--T:183--> In addition, we had significant issues with our concatenation code.</translate>
<translate><!--T:184--> Thus, we had to look for alternatives in terms of bringing back the PDF books functionality on Wikimedia projects.</translate>
<translate><!--T:185--> 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.</translate>
<translate><!--T:186--> They have agreed and we are currently working on the details and schedule.</translate>
<translate><!--T:187--> They will start by working on a temporary solution based on an older technology that has previously been used to create PDF.</translate>
<translate><!--T:188--> This might have some drawbacks when it comes to graphical elements, such as maps, but will mean a faster working solution.</translate>
<translate><!--T:189--> They then plan to work on a new HTML-to-PDF renderer afterwards, based on feedback on the first implementation.</translate>


<translate>
<!--T:127-->
Books functionality will be returning via [[w:PediaPress|PediaPress]]. After investigating the new [[phab:T181084 |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.

== Update January 2018 == <!--T:121-->
== Update January 2018 == <!--T:121-->


Line 55: Line 58:


== Update September 2017 == <!--T:92-->
== Update September 2017 == <!--T:92-->
</translate>
<translate><!--T:93--> Our current PDF rendering service, the [[offline content generator]] (OCG), is no longer maintainable.</translate>
<translate><!--T:190--> Simply put, it's breaking down.</translate>
<translate><!--T:191--> The [[Readers|Reading team]] at the Wikimedia Foundation has been working towards replacing it for months.</translate>
<translate><!--T:192--> OCG has been running on outdated code which may introduce security vulnerabilities and other major issues in the future.</translate>
<translate><!--T:193--> Over the last three months, we’ve had banners on the PDF creation page asking for [[Talk:Reading/Web/PDF Functionality|feedback]] on the prototype for our new renderer.</translate>
<translate><!--T:194--> 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.</translate>
<translate><!--T:195--> We've gathered a lot of good feedback on the prototype and are working on making the required updates to our new PDFs.</translate>


<translate>
<!--T:93-->
Our current PDF rendering service, the [[offline content generator]] (OCG), is no longer maintainable. Simply put, it's breaking down. The [[Readers|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 [[Talk:Reading/Web/PDF Functionality|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.

=== Later addendum: Turning PDF book rendering OFF for the short term === <!--T:103-->
=== Later addendum: Turning PDF book rendering OFF for the short term === <!--T:103-->
</translate>
<translate><!--T:94--> Unfortunately, major issues with our old renderer (OCG) will require us to remove it as a rendering option prior to completing the necessary updates for the books feature.</translate>
<translate><!--T:196--> This is earlier than we wanted.</translate>
<translate><!--T:197--> By the time we remove OCG, the work for rendering of single articles will be completed.</translate>
<translate><!--T:198--> However, the rendering of books will be paused while we evaluate and complete the necessary work.</translate>
<translate><!--T:199--> 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.</translate>
<translate><!--T:200--> We will be working to select a new rendering system for books which can handle the size of the files and support our requirements.</translate>
<translate><!--T:201--> This is not how we planned to do this.</translate>
<translate><!--T:202--> We never aimed to temporarily remove the book PDF functionality.</translate>


<translate>
<!--T:94-->
Unfortunately, major issues with our old renderer (OCG) will require us to remove it as a rendering option prior to completing the necessary updates for the books feature. 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.

<!--T:95-->
<!--T:95-->
Timeline:
Timeline:
Line 81: Line 97:


<!--T:102-->
<!--T:102-->
In addition to this page being updated, this will be communicated in a banner on PDF creation page, in [[m:Special:MyLanguage/Tech/News|Tech News]] and on some Wikimedia mailing lists.
In addition to this page being updated, this will be communicated in a banner on PDF creation page, in [[<tvar name=meta>m:Special:MyLanguage/Tech/News</tvar>|Tech News]] and on some Wikimedia mailing lists.


== Introduction == <!--T:1-->
== Introduction == <!--T:1-->
</translate>
<translate><!--T:2--> Our current PDF rendering service, the [[offline content generator]], is no-longer maintainable.</translate>
<translate><!--T:203--> Simply put, it's breaking down.</translate>
<translate><!--T:204--> Originally created by a third party, it currently runs on outdated code which may introduce security vulnerabilities and other major issues in the future.</translate>
<translate><!--T:205--> 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.</translate>


<translate><!--T:3--> Additionally, it does not support a number of rendering requests from the community, the main one being [[w:Wikipedia talk:Offline Content Generator|the ability to render tables]].</translate>
<!--T:2-->
<translate><!--T:176--> We have selected a new service, the [[<tvar name=1>Special:MyLanguage/Extension:ElectronPdfService</tvar>|electron rendering service]], as a suitable replacement.</translate>
Our current PDF rendering service, the [[offline content generator]], is no-longer maintainable. 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.
<translate><!--T:177--> Our next step is to duplicate the functionality provided by OCG using the electron rendering service.</translate>
<translate><!--T:178--> Below, we will describe the main portions of the functionality we have identified as necessary.</translate>
<translate><!--T:179--> We would like to invite conversation around what is missing or what is superfluous in the provided list.</translate>
<translate><!--T:180--> We would also like to highlight over our future plans for PDF rendering to gather initial feedback.</translate>


<translate>
<!--T:3-->
== Known issues == <!--T:173-->
Additionally, it does not support a number of rendering requests from the community, the main one being [[w:Wikipedia talk:Offline Content Generator|the ability to render tables]]. We have selected a new service, the [[<tvar|1>Special:MyLanguage/Extension:ElectronPdfService</>|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.
</translate>
</translate>
* <translate><!--T:174--> There is currently a [[<tvar name=phab>phab:T174955</tvar>|bug]] within Firefox (upstream) that affects the styling of infoboxes displayed across multiple pages. Progress from Mozilla can be tracked here:</translate> https://bugzilla.mozilla.org/show_bug.cgi?id=688556.

== Known Issues ==
* There is currently a [[phab: T174955|bug]] within Firefox (upstream) that affects the styling of infoboxes displayed across multiple pages. Progress from Mozilla can be tracked here: https://bugzilla.mozilla.org/show_bug.cgi?id=688556.


<translate>
<translate>
== Userbase == <!--T:152-->
== Userbase == <!--T:152-->

<!--T:153-->
The following table shows a sample of traffic to the Electron "Download as PDF" service for over a 6 hour period.</translate>
<translate>
<!--T:154-->
The traffic is broken down by operating system (OS), browser, and the browser major version (e.g. Windows 7, Chrome v61.*).</translate>
<translate>
<!--T:155-->
Note well that the majority of our traffic appears to come from Windows based machines.
</translate>
</translate>
<translate><!--T:153--> The following table shows a sample of traffic to the Electron "Download as PDF" service for over a 6 hour period.</translate>
<translate><!--T:154--> The traffic is broken down by operating system (OS), browser, and the browser major version (e.g. Windows 7, Chrome v61.*).</translate>
<translate><!--T:155--> Note well that the majority of our traffic appears to come from Windows based machines.</translate>


{| class="wikitable sortable mw-collapsible mw-collapsed"
{| class="wikitable sortable mw-collapsible mw-collapsed"
Line 112: Line 129:
! <translate><!--T:133--> Browser</translate>
! <translate><!--T:133--> Browser</translate>
! <translate><!--T:134--> Browser Major Version</translate>
! <translate><!--T:134--> Browser Major Version</translate>
! <translate><!--T:135--> % of requests</translate>
! <translate><!--T:135--> % of requests</translate>&nbsp;
|-
|-
| <translate><!--T:136--> Other</translate> || <translate><!--T:137--> Other</translate> || - || 14.38
| <translate><!--T:136--> Other</translate> || <translate><!--T:137--> Other</translate> || - || 14.38
Line 118: Line 135:
|Windows 7 || Chrome || 61 || 12.42
|Windows 7 || Chrome || 61 || 12.42
|-
|-
|Windows 10 || Chrome || 61 || 8.83
|Windows 10 || Chrome || 61 || 8.83
|-
|-
|Windows 7 || IE || 11 || 7.33
|Windows 7 || IE || 11 || 7.33
Line 214: Line 231:
|Windows 10 || Firefox || 47 || 0.21
|Windows 10 || Firefox || 47 || 0.21
|}
|}

<translate>
<translate>
== Current Functionality Requirements == <!--T:66-->
== Current Functionality Requirements == <!--T:66-->
Line 223: Line 241:


<!--T:139-->
<!--T:139-->
* Rendering PDF articles and books from Wikipedia pages is handled by a service called [[Offline_content_generator |OCG]]. When rendering "books" through the book creator, it uses [[Offline_content_generator |OCG]] as embedded within the [[Extension:Collection|Collection]] extension. [https://phabricator.wikimedia.org/maniphest/query/L14GjuqVpn7v/#R OCG has multiple issues], especially [[phab:T73808|with tables]].
* Rendering PDF articles and books from Wikipedia pages is handled by a service called [[<tvar name=2>Special:MyLanguage/Offline content generator</tvar>|OCG]].</translate> <translate><!--T:211--> When rendering "books" through the book creator, it uses [[<tvar name=1>Special:MyLanguage/Offline content generator</tvar>|OCG]] as embedded within the <tvar name=2>{{ll|Extension:Collection|Collection}}</tvar> extension.</translate> <translate><!--T:212--> [[<tvar name=1>phab:maniphest/query/L14GjuqVpn7v/#R</tvar>|OCG has multiple issues]], especially [[<tvar name=2>phab:T73808</tvar>|with tables]].</translate>
</translate>
* <translate><!--T:5--> Multiple issues with OCG are identified, including complaints from the community around OCG's inability to render tables.</translate>
* <translate><!--T:5--> Multiple issues with OCG are identified, including complaints from the community around OCG's inability to render tables.</translate>
* <translate><!--T:6--> Rendering of tables ranks as number 9 on the German-speaking Community Technical Wishlist.</translate>
* <translate><!--T:6--> Rendering of tables ranks as number 9 on the German-speaking Community Technical Wishlist.</translate>
* <translate><!--T:7--> Wikimedia Deutschland begins on working on a [[Meta:WMDE Technical Wishes/Tables in PDFs|solution]] for rendering tables in PDF's, and introduces Electron. They do this planning to run it alongside OCG, not to replace it.</translate>
* <translate><!--T:7--> Wikimedia Deutschland begins on working on a [[Meta:WMDE Technical Wishes/Tables in PDFs|solution]] for rendering tables in PDF's, and introduces Electron. They do this planning to run it alongside OCG, not to replace it.</translate>
* <translate><!--T:8--> 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.</translate>
* <translate><!--T:8--> 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.</translate>
* <translate><!--T:9--> The [[Reading|WMF Reading Team]] takes over the responsibility for the long term maintenance of PDF rendering begins plans on implementing table rendering across all projects.</translate>
* <translate><!--T:9--> The [[Reading|WMF Reading Team]] takes over the responsibility for the long term maintenance of PDF rendering and begins plans for implementing table rendering across all projects.</translate>
* <translate><!--T:10--> The Reading team launches a [[Reading/Web/PDF Rendering|community consultation]] for gathering feedback on Electron.</translate>
* <translate><!--T:10--> The Reading team launches a [[Reading/Web/PDF Rendering|community consultation]] for gathering feedback on Electron.</translate>
* <translate><!--T:11--> The Reading Infrastructure and Web teams begin scoping the working necessary to port OCG functionality over to the Electron service.</translate>
* <translate><!--T:11--> The Reading Infrastructure and Web teams begin scoping the working necessary to port OCG functionality over to the Electron service.</translate>
Line 235: Line 252:
<translate>
<translate>
== Update After Consultation == <!--T:104-->
== Update After Consultation == <!--T:104-->
</translate>


[[File:Berlin - Wikipedia.pdf|thumb|{{dir|{{pagelang}}|left|right}}|350px|<translate><!--T:175--> Proposed PDF and print styles based on feedback from consultation</translate>]]
<!--T:140-->
<translate>
[[File:Berlin - Wikipedia.pdf|thumb|right | 350px|Proposed PDF and print styles based on feedback from consultation]]

<!--T:141-->
<!--T:141-->
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:
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:
Line 291: Line 308:
|-
|-
|<translate><!--T:22--> Rendering individual articles</translate>
|<translate><!--T:22--> Rendering individual articles</translate>
|{{yes}}
|<translate><!--T:23--> Yes</translate>
|{{yes}}
|<translate><!--T:24--> Yes</translate>
|
|
|-
|-
|<translate><!--T:25--> Rendering multiple articles using the book creator</translate>
|<translate><!--T:25--> Rendering multiple articles using the book creator</translate>
|{{yes}}
|<translate><!--T:26--> Yes</translate>
|{{yes}}
|<translate><!--T:27--> Yes</translate>
|
|
|-
|-
|<translate><!--T:28--> Contains table of contents for multiple articles</translate>
|<translate><!--T:28--> Contains table of contents for multiple articles</translate>
|{{yes}}
|<translate><!--T:29--> Yes </translate>
|{{yes}}
|<translate><!--T:30--> Yes</translate>
|
|
|-
|-
|<translate><!--T:31--> Renders tables</translate>
|<translate><!--T:31--> Renders tables</translate>
|{{no}}
|<translate><!--T:32--> No</translate>
|{{yes}}
|<translate><!--T:33--> Yes</translate>
|
|
|-
|-
|<translate><!--T:34--> Attribution</translate>
|<translate><!--T:34--> Attribution</translate>
|{{yes}}
|<translate><!--T:35--> Yes</translate>
|{{yes}}
|<translate><!--T:36--> Yes</translate>
|<translate><!--T:37--> Open question: location of attribution within the new service</translate>
|<translate><!--T:37--> Open question: location of attribution within the new service</translate>
|-
|-
Line 321: Line 338:
|-
|-
|<translate><!--T:41--> N-column layout</translate>
|<translate><!--T:41--> N-column layout</translate>
|{{yes}}
|<translate><!--T:42--> Yes</translate>
|{{no}}
|<translate><!--T:43--> No</translate>
|
|
|-
|-
|<translate><!--T:44--> Default 2-column layout</translate>
|<translate><!--T:44--> Default 2-column layout</translate>
|{{yes}}
|<translate><!--T:45--> Yes</translate>
|<translate><!--T:46--> Tentative</translate>
|<translate><!--T:46--> Tentative</translate>
|<translate><!--T:47--> Default one column or two-column layout will be chosen based on feedback and quantitative and/or qualitative testing</translate>
|<translate><!--T:47--> Default one column or two-column layout will be chosen based on feedback and quantitative and/or qualitative testing</translate>
Line 344: Line 361:


<gallery widths="250" heights="350">
<gallery widths="250" heights="350">
File:Moon.pdf|Examples of new PDF output - Styles will be updated based on feedback from the ongoing consultation
File:Moon.pdf|<translate><!--T:181--> Examples of new PDF output - Styles will be updated based on feedback from the ongoing consultation</translate>
File:PDF screenshot of charter typeface.pdf|
File:PDF screenshot of charter typeface.pdf|
</gallery>
</gallery>
Line 352: Line 369:


<!--T:144-->
<!--T:144-->
The following is a rough outline of the development all
The following is a rough outline of the development and deployment roadmap. It is subject to change.



ññññññññlllll




.....











nd deployment roadmap. It is subject to change.
</translate>
</translate>


Line 386: Line 382:
# <translate><!--T:61--> August 2017 – September 2017</translate>
# <translate><!--T:61--> August 2017 – September 2017</translate>
## <translate><!--T:62--> Additional changes made if necessary</translate>
## <translate><!--T:62--> Additional changes made if necessary</translate>
# {{ym|2017|10}}
# <translate><!--T:63--> October 2017</translate>
## <translate><!--T:64--> Second iteration launched without OCG on all projects</translate>
## <translate><!--T:64--> Second iteration launched without OCG on all projects</translate>

<translate>
<translate>
=== Single Articles === <!--T:67-->
=== Single Articles === <!--T:67-->


<!--T:145-->
<!--T:145-->
* A PDF for a single article will be created by selecting the "Download as PDF" link</translate>
* A PDF for a single article will be created by selecting the "Download as PDF" link
</translate>
* <translate><!--T:68--> Upon selecting "Download as PDF", the PDF file will be generated. To download the file, users will select the "Download the file link"</translate>
* <translate><!--T:68--> Upon selecting "Download as PDF", the PDF file will be generated. To download the file, users will select the "Download the file link"</translate>
* <translate><!--T:69--> Each PDF file will contain the following:</translate>
* <translate><!--T:69--> Each PDF file will contain the following:</translate>
** <translate><!--T:70--> Article title and text</translate>
** <translate><!--T:70--> Article title and text</translate>
** '''<translate><!--T:71--> Infobox</translate>''' <translate><!--T:72--> (if any)</translate>
** '''<translate><!--T:71--> Infobox</translate>''' <translate><!--T:72--> (if any)</translate>
** '''<translate><!--T:73--> Table</translate>s''' <translate><!--T:74--> (if any)</translate>
** '''<translate><!--T:73--> Tables</translate>''' <translate><!--T:74--> (if any)</translate>
** '''<translate><!--T:75--> Single-column layout</translate>'''
** '''<translate><!--T:75--> Single-column layout</translate>'''
** <translate><!--T:76--> Page number</translate>
** <translate><!--T:76--> Page number</translate>
Line 406: Line 404:
<translate>
<translate>
=== Phabricator Tracking === <!--T:164-->
=== Phabricator Tracking === <!--T:164-->
</translate>
<translate><!--T:165--> 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 [[<tvar name=1>phab:tag/proton/</tvar>|Proton]].</translate>
<translate><!--T:166--> The project page will display any recent updates for all tasks related to PDFs.</translate>


<!--T:165-->
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 [[<tvar|1>phab:tag/proton/</>|Proton]].</translate>
<translate>
<translate>
<!--T:166-->
The project page will display any recent updates for all tasks related to PDFs.

=== Books === <!--T:80-->
=== Books === <!--T:80-->


Line 454: Line 450:


<!--T:170-->
<!--T:170-->
If you run Ubuntu Linux and want results faster, you can install the <tvar|1><code>m2l-pyqt</code></> or <tvar|2><code>mediawiki2latex packages</code></>.
If you run Ubuntu Linux and want results faster, you can install the <tvar name=1><code>m2l-pyqt</code></tvar> or <tvar name=2><code>mediawiki2latex</code></tvar> packages.
</translate>
</translate>



Latest revision as of 01:26, 15 October 2023

Update on PDF rendering, July 15 2019

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.

Update on PDF rendering, June 4, 2019

We have deployed the new renderer for single-article PDFs for all projects. We hope this will resolve the issues associated with the Electron renderer, which was often unable to generate PDFs as expected. Please feel free to try out the new renderer and let us know if you have questions or come across any bugs or other issues.

Update on PDF rendering, March 18 2019

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). We will post another update once the deployment date is set. This renderer will replace the electron renderer as the default PDF renderer for single-page PDFs.

Update on books, August 17 2018

Sample book from PediaPress

Here is an updated and more comprehensive sample of the new book renderer. 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.

Update on books, August 8 2018

We have been working with PediaPress on generating and styling the new books. They have provided us with a sample of the current output, which will be very similar to the final version. We discussed points of improvement with the PediaPress team, which they are addressing currently. If you have any feedback or other comments on these samples, please let us know on the talk page.

Update on books, April 2018

Books functionality will be returning via PediaPress. 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.

Update January 2018

We're currently preparing performance tests of the PDF to book function. We should know more in early February.

Update September 2017

Our current PDF rendering service, the offline content generator (OCG), is no longer maintainable. 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.

Later addendum: Turning PDF book rendering OFF for the short term

Unfortunately, major issues with our old renderer (OCG) will require us to remove it as a rendering option prior to completing the necessary updates for the books feature. 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.

Timeline:

  • Release of full-featured renderer for single articles (print to pdf) – Oct 1, 2017
  • Pausing book PDF rendering – Oct 1, 2017
  • Sunsetting of OCG renderer – Oct 1, 2017
  • Release of new PDF renderer – Jan, 2018 (tentative based on research results into alternative rendering systems)

Functionality:

For a full list of current and upcoming functionality, see below.

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.

Introduction

Our current PDF rendering service, the offline content generator, is no-longer maintainable. 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.

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.

Known issues

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.

OS Browser Browser Major Version % of requests 
Other Other - 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

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 and begins plans for 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

Proposed PDF and print styles based on feedback from 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:

  • hyperlinks
  • article information
  • 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.

Proposal

The following is a proposal for the scope of functionality necessary for PDF rendering:

  • 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)

Differences between current and future implementation

OCG New Service Notes
Rendering individual articles Yes Yes
Rendering multiple articles using the book creator Yes Yes
Contains table of contents for multiple articles Yes Yes
Renders tables No Yes
Attribution Yes Yes Open question: location of attribution within the new service
Styling Latex New styles
N-column layout Yes No
Default 2-column layout Yes Tentative Default one column or two-column layout will be chosen based on feedback and quantitative and/or qualitative testing
Output format PDF, Plaintext PDF Only

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. April – May 2017:
    1. The Reading team builds back-end support for functionality identified above
    2. Communities are consulted on expanding or shrinking proposed functionality
    3. Qualitative test performed for styling
  2. June – July 2017:
    1. New styles implemented
    2. First iteration is launched along with OCG on all projects and performance is compared
    3. Iterations based on consultations and identified edge cases
  3. August 2017 – September 2017
    1. Additional changes made if necessary
  4. October 2017
    1. 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
    • Infobox (if any)
    • Tables (if any)
    • Single-column layout
    • Page number
    • 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.

Books

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:
    • Book title page
    • The references for each article from the book will appear at the end of the article
    • Each article will begin on a new page
    • 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

  • 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

Styles for books will be updated for improved readability

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.