Page MenuHomePhabricator

Extension:Collection and/or PDF rendering of http://www.mediawiki.org/wiki/Manual:Hooks fails
Closed, ResolvedPublic

Description

Please can you check what is wrong? The Extension show an error message, this is reproducible.

The bug appears also when rendering that as the only page of a book.

The page is part of the new book

http://www.mediawiki.org/wiki/User:Wikinaut/Books/MediaWiki_Developer%27s_Guide

where I noticed the problem today in the generated PDF.


Version: unspecified
Severity: normal
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=45856

Details

Reference
bz29241

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:37 PM
bzimport added a project: Collection.
bzimport set Reference to bz29241.
WARNING: Article could not be rendered - ouputting plain text. Potential causes of the problem are: (a) a bug in the pdf-writer software (b) problematic Mediawiki markup (c) table is too wide

(In reply to comment #1)

WARNING: Article could not be rendered - ouputting plain text. Potential causes of the problem are: (a) a bug in the pdf-writer software (b) problematic Mediawiki markup (c) table is too wide

I think, the Collection extension should be fixed in some way to find an automatic solution (e.g. smaller font).

table is too wide... it's problem

(In reply to comment #3)

table is too wide... it's problem

None of those tables have a forced width... It should be able to resize the column sizes fine(ish)

Currently the PDF download link on that page seems to work ok at present.

Was the bug fixed and the mwpdf generator updated, or did some page that triggered the problem get changed or removed from the book?

Ah no -- it is in there, that message is actually *in the PDF*, not *about the failure to produce a PDF*. :P

Brion:

I added the PDF link, and the templates, yes.

This bugzilla is only about rendering of the page Manual:Hooks fails.

(In reply to comment #4)

(In reply to comment #3)

table is too wide... it's problem

None of those tables have a forced width... It should be able to resize the
column sizes fine(ish)

I tried many things with width settings. Nothing worked. The E:Collection simply fails with that page http://www.mediawiki.org/wiki/Manual:Hooks .

I really would like to see the experts solving that issue for that page. Spent lots of hours, for nothing...

(In reply to comment #10)

Tom, if you want to test the issue yourself you'll probably need to check out
the renderer, set it up, and check its output and logs.

Good idea, but where are the real E:Collection experts? paging E:collection experts... *ping*

volker.haas wrote:

The problem is that no element in the PDF is allowed to be larger than a single page. In the example the problem are cells which span over many, many rows (like the "Page Rendering" cell). The PDF framework (reportlab) we are using simply gives up if it encounters stuff that doesn't fit on a page. Currently I have no good idea how to solve this, but I'll look into the issue

(In reply to comment #12)

The problem is that no element in the PDF is allowed to be larger than a single
page. In the example the problem are cells which span over many, many rows
(like the "Page Rendering" cell). The PDF framework (reportlab) we are using
simply gives up if it encounters stuff that doesn't fit on a page. Currently I
have no good idea how to solve this, but I'll look into the issue

Volker,

thanks for pointing to this issue. Perhaps the error text (of the PDF creator) could mention the length problem expressly. I was trying to limit the table width to make it fit the page width, but when I understand you correctly, long tables with unbreakable stuff in it cause the problems.

Can it be of help, if page authors use the
css page break auto property as explained here :

http://www.w3schools.com/css/pr_print_pagebi.asp

<style>
@media print
{
table {page-break-inside:avoid}
}
</style>

Or, that a collaborative page author _could_ intentionally place helpers like <!--NEW PAGE MAY COME HERE--> to assist the PDF renderer ti find places to "break" the page and to continue on a new page.

Or, that the rendering switches into a "panic" mode and uses unlimited page size which is then post-rendered to make the unlimited page size fit to single pages.

I am willing to help to find a solution for such problems.

volker.haas wrote:

I have fixed the issue with the example article. Before I install that on the live system I need to clean up a bit and test some more.

Using css page break hints doesn't help unfortunately - the PDF framework can't deal with that.

I would vote against the use of page break hints if the issue is solved generally.

volker.haas wrote:

fixed and live on wikipedia servers

volker.haas wrote:

I don't quite understand. But the original example [1] now renders fine

[1] http://www.mediawiki.org/wiki/Manual:Hooks

(In reply to comment #15)

fixed and live on wikipedia servers

Volker: s u p e r g r e a t, quick and full solution of this problem.
I confirm: the bug is fixed.

See that page now in the context of (first) book on MediaWiki:
http://www.mediawiki.org/wiki/User:Wikinaut/Books/MediaWiki_Developer%27s_Guide

(In reply to comment #17)

I don't quite understand. But the original example [1] now renders fine

[1] http://www.mediawiki.org/wiki/Manual:Hooks

Still fine (although I didn't check if syntax changed). However, see bug 45856.