Funcionalidade de leitura/Site/PDF

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

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.

Atualização de janeiro de 2018

Estamos a preparar testes de desempenho da função de composição de livros em PDF. Teremos mais informação no início de fevereiro.

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

Atualização de setembro de 2017

O nosso serviço atual de composição de PDF, o gerador de conteúdo fora de linha (OCG) deixará de ser mantido. Por outras palavras, irá deixar de funcionar. A equipa de leitura da Wikimedia Foundation trabalha há meses para substituí-lo. O OCG tem funcionado com código desatualizado que pode criar vulnerabilidades de segurança e outros problemas sérios no futuro. Durante os últimos três meses apresentámos banners na página de criação de PDF solicitando comentários sobre o protótipo do nosso novo compositor. O novo compositor terá funcionalidades melhoradas em comparação com o OCG — irá imprimir tabelas e caixas informativas, e elementos estilísticos focados na melhoria da legibilidade. Recebemos uma grande quantidade de comentários sobre o protótipo e estamos a fazer as atualizações necessárias aos nossos novos 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.

Adenda posterior: Desativação da composição de livros em PDF no curto prazo

Infelizmente, problemas sérios no nosso antigo compositor (OCG) irão obrigar-nos a removê-lo das opções de composição antes de completarmos as atualizações necessárias para a criação de livros. Isto sucede mais cedo do que pretendíamos. Quando removermos o OCG, o trabalho de composição de artigos individuais estará completo. No entanto, a composição de livros será interrompida enquanto avaliamos e concluímos os trabalhos necessários. A nossa escolha inicial do compositor de substituição, o serviço de composição Electron, não suporta ficheiros PDF de tamanhos grandes e falha ao tentar compor um livro com vários artigos. Iremos selecionar um novo sistema de composição de livros que possa suportar o tamanho dos ficheiros e preencha os nossos requisitos. Não era este o nosso plano inicial. Nunca quisemos desativar temporariamente a funcionalidade de composição de livros em 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.

Cronologia:

  • Lançamento do compositor completo para artigos individuais (imprimir em PDF) - 1 de outubro de 2017
  • Interrupção da composição de livros em PDF - 1 de outubro de 2017
  • Desativação do compositor OCG - 1 de outubro de 2017
  • Lançamento do novo compositor PDF - janeiro de 2018 (data provisória com base nos resultados da pesquisa de sistemas de composição alternativos)

Funcionalidade:

Para uma lista completa das funcionalidades atuais e futuras, veja abaixo.

Para além da atualização desta página, isto será comunicado num banner na página de criação de ficheiros PDF, em Tech News e nalgumas listas de divulgação por correio eletrónico da Wikimedia.

Introdução

O nosso serviço atual de composição de ficheiros PDF, o gerador de conteúdo fora de linha deixará de ser mantido. Por outras palavras, irá deixar de funcionar. Tendo sido criado originalmente por terceiros, ele funciona atualmente com código desatualizado que pode criar vulnerabilidades de segurança e outros problemas sérios no futuro. Para termos a funcionalidade PDF teremos infelizmente de substituí-lo, senão poderemos vir a ter de retirar subitamente esta funcionalidade sem ter planeado fazê-lo. 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.

Além disso, este serviço não suporta alguns pedidos de composição feitos pela comunidade, sendo o principal a capacidade de compor tabelas. Selecionámos um novo serviço, o serviço de composição Electron, como substituto adequado. O nosso próximo passo será duplicar a funcionalidade fornecida pelo OCG usando o novo serviço de composição Electron. Abaixo, iremos descrever as principais funcionalidades que identificámos serem necessárias. Gostaríamos de fomentar um diálogo acerca das funcionalidades que possam estar em falta, ou sejam supérfluas, na lista fornecida. Gostaríamos também de realçar os nossos planos futuros para composição de ficheiros PDF, de forma a recebermos comentários iniciais. 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.

Historial

  • A composição de artigos e livros em PDF a partir das páginas da Wikipédia é feita por um serviço chamado OCG. Ao compor «livros» através do criador de livros, este utiliza o OCG tal como incorporado na extensão Collection. O OCG tem vários problemas, especialmente com tabelas.
  • 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.

  • Estão identificados vários problema com o OCG, incluindo queixas da comunidade motivadas pela incapacidade do OCG de compor tabelas.
  • A composição de tabelas surge no número 9 da Lista de Requisitos Técnicos da Comunidade de Língua Germânica.
  • A Wikimedia Deutschland começa a trabalhar na solução para a composição de tabelas em ficheiros PDF, e introduz o Electron. Fazem-no com a intenção de executá-lo em paralelo com o OCG e não de o substituir.
  • Ao mesmo tempo que a Wikimedia Deutschland trabalha no serviço Electron, os responsáveis pelo serviço de manutenção do serviço OCG da Wikimedia Foundation chegam à conclusão de que o OCG tem de ser substituído.
  • A equipa de leitura da WMF assume a responsabilidade de manutenção a longo prazo do compositor de ficheiros PDF, e começa a planear a implementação da composição de tabelas para todos os projetos.
  • A equipa de leitura lança uma consulta da comunidade para recolher comentários acerca do Electron.
  • As equipas da infraestrutura de leitura e web começam a delimitar o trabalho necessário para transferir a funcionalidade OCG para o serviço Electron.

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.

Proposta

A seguinte é uma proposta de definição do âmbito das funcionalidades necessárias para a composição de ficheiros PDF:

  • Os artigos individuais serão compostos no formato PDF usando a hiperligação Descarregar em PDF da barra lateral.
  • A composição de vários artigos no formato PDF será feita usando a ferramenta «Criador de livros».
  • Todos os artigos contêm atribuição da autoria dos textos e imagens.
  • Todos os ficheiros PDF que forem compostos poderão imprimir tabelas.
    • Os utilizadores poderão personalizar a disposição (layout) dos respetivos PDF (opcional).

Diferenças entre a implementação atual e a futura

OCG Novo Serviço Notas
Composição de artigos individuais Yes Yes
Composição de mais que um artigo usando o criador de livros Yes Yes
Contém tabela de conteúdos para múltiplos artigos Yes Yes
Compõe tabelas No Yes
Atribuição Yes Yes Questão em aberto: localização da atribuição no novo serviço
Elementos estilísticos Latex Novos estilos
N-column layout Yes No
Default 2-column layout Yes Tentative A escolha da disposição padrão, entre as opções de uma coluna única ou de duas colunas, será feita com base nos comentários recebidos e em testes quantitativos e qualitativos.
Formato de saída PDF, Texto simples Só PDF

Desenho

Os novos estilos para os PDF serão desenhados para melhorar a legibilidade. Com base nos comentários da comunidade e em testes qualitativos e quantitativos, a disposição em duas colunas poderá ser suportada no criador de livros e/ou nos PDF de artigos individuais.

Planos de Desenvolvimento e Lançamento

É fornecida abaixo uma descrição provisória do plano de desenvolvimento e lançamento. Este plano está sujeito a alterações.

  1. Abril - Maio de 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. outubro de 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.