Page MenuHomePhabricator

PDF rendering does not include graph image, as the Graph extension does not support Graphoid anymore
Open, LowPublic

Description

Go to any page with a graph. Press Download as PDF and open the file.

The PDF does not contain the Graph image.

Map Demo based on this page

Many graphs based on this page

Caused by: T242855: Undeploy graphoid

Event Timeline

geraki raised the priority of this task from to Medium.
geraki updated the task description. (Show Details)
geraki subscribed.

Now it no longer returns code, but it doesn't show a graph image either.

TheDJ renamed this task from PDF rendering returns html code instead of graph image to PDF rendering does not include graph image.Aug 7 2015, 8:55 AM
TheDJ updated the task description. (Show Details)
TheDJ added a project: OCG-PDF-renderer.
TheDJ set Security to None.

Hi,

Good day.
I will be a lookout on this since I badly needed this feature on our project.
Thanks in advance.

Ace

As already announced in Tech News, OfflineContentGenerator (OCG) will not be used anymore after October 1st, 2017 on Wikimedia sites. OCG will be replaced by Electron. You can read more on mediawiki.org.

MSantos lowered the priority of this task from Medium to Lowest.Feb 2 2021, 4:00 PM
MSantos subscribed.

Although this is a valid bug, it's not caused by Proton

The reason is that the Graph extension does not support Graphoid anymore, which means there isn't a tool to generate raster images for the graphs.

For security reasons Proton does not support rendering PDF with JavaScript enabled therefore it can't create a raster image from dynamic graphs.

IMO this became a feature request that's out of the scope of the current maintenance status.

Aklapper renamed this task from PDF rendering does not include graph image to PDF rendering does not include graph image, as the Graph extension does not support Graphoid anymore.Feb 2 2021, 10:11 PM
Jdlrobson raised the priority of this task from Lowest to Low.Apr 26 2023, 12:33 AM

Our PDF renderer is based on a web browser these days, so there's no particular reason Graph doesn't work any more. There is some load-on-demand code in Graph, so /maybe/ there's a remaining bug about ensuring that everything is loaded before the PDF is rendered.

Our PDF renderer is based on a web browser these days, so there's no particular reason Graph doesn't work any more. There is some load-on-demand code in Graph, so /maybe/ there's a remaining bug about ensuring that everything is loaded before the PDF is rendered.

I remember someone from services saying that we intentionally do not run javascript in the PDF rendering container, so it is expected.

as @TheDJ says - Proton - our PDF renderer disables the Javascript when rendering the page: https://github.com/wikimedia/mediawiki-services-chromium-render/blob/76161ba764e28e0f4f494d903d41d875a64481e6/lib/renderer.js#L157

Therefore if the page has any JS it's not gonna be executed. As the comment says, the Javascript was used to prevent lazyloading of images plus puppeteer was in a very early state when we started working on Proton - therefore the safest option was to entirely disable the Javascript as we didn't require it for a printable version of article.