Printing incomplete

For support with specific websites

Moderator: trava90

Forum rules
Please always mention the name/domain of the website in question in your topic title.
Please one website per topic thread (to help keep things organized). While behavior on different sites might at first glance seem similar, they are not necessarily caused by the same.

Please try to include any relevant output from the Toolkit Error Console or the Developer Tools Web Console using the following procedure:
  1. Clear any current output
  2. Navigate or refresh the page in question
  3. Copy and paste Errors or seemingly relevant Warnings into a single [ code ] block.
User avatar
mseliger
Fanatic
Fanatic
Posts: 114
Joined: 2016-02-17, 10:53

Printing incomplete

Unread post by mseliger » 2023-10-28, 09:34

Hello,

i've have problems with some websites of CodeProject. When I printed these pages (or preview them) they are incomplete.
2023-10-28_11-21.png
The website is
https://www.codeproject.com/Articles/5370606/spSearchTables-Search-and-find-tables-or-columns-b?display=Print

I have try to print this page with a new profile (OS Version: Linux Mint 21.2, PaleMoon 32.4.1, GTK2 Build)

Code: Select all

Timestamp: 10/28/2023 11:23:04 AM
Warning: Key event not available on some keyboard layouts: key=“i” modifiers=“accel,alt,shift” id=“key_browserToolbox”
Source File: chrome://browser/content/browser.xul
Line: 0
Timestamp: 10/28/2023 11:23:06 AM
Warning: Content Security Policy: Ignoring ‘x-frame-options’ because of ‘frame-ancestors’ directive.
The same effect is when I print this page with basilisk webbrowser, but not with firefox 115.4 esr-Version.
You do not have the required permissions to view the files attached to this post.
Mit freundlichen Grüßen / Greetings
Maria
---
Ich bin ein Westfale, und zwar ein Stockwestfale, nämlich ein Münsterländer – Gott sei Dank! füge ich hinzu ...
Annette von Droste zu Hülshoff, Bei uns zu Lande auf dem Lande

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35652
Joined: 2011-08-28, 17:27
Location: Motala, SE

Re: Printing incomplete

Unread post by Moonchild » 2023-10-28, 10:24

Printing in the browser is a "best effort" kind of deal. It does not necessarily work with pages that have not been specifically laid out to be "printer friendly" (by the webmasters) due to the complexities of non-linear document hierarchies and custom placement via CSS taking items "out of flow".
This is a known limitation of the in-browser printing feature.

For this reason there are browser extensions (like Fireshot) that can make "as-displayed" snapshots, and services (like PrintFriendly) to assist.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

User avatar
suzyne
Lunatic
Lunatic
Posts: 364
Joined: 2023-06-28, 22:43
Location: Australia

Re: Printing incomplete

Unread post by suzyne » 2023-10-28, 21:02

I have found that even services like PrintFriendly can make a mess of what look like straightforward pages, so it must be a difficult problem, when they boast they have been doing it since 2009 and they still can't consistently get it right?
Laptop 1: Windows 10 64-bit, i7 @ 2.80GHz, 16GB, NVIDIA GeForce MX450.
Laptop 2: Windows 10 32-bit, Atom Z3735F @ 1.33GHz, 2GB, Intel HD Graphics.

User avatar
moonbat
Knows the dark side
Knows the dark side
Posts: 4984
Joined: 2015-12-09, 15:45

Re: Printing incomplete

Unread post by moonbat » 2023-10-28, 22:12

suzyne wrote:
2023-10-28, 21:02
what look like straightforward pages
Those unfortunately can be deceptive, what looks like a simple page still gets generated by kilos of javascript that's totally unnecessary. The Google homepage these days is a good example. So a print service that counts on the page being rendered in regular HTML/CSS would have problems.
"One hosts to look them up, one DNS to find them and in the darkness BIND them."

Image
Linux Mint 21 Xfce x64 on HP i5-5200 laptop, 12 GB RAM.
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX

User avatar
Kris_88
Keeps coming back
Keeps coming back
Posts: 940
Joined: 2021-01-26, 11:18

Re: Printing incomplete

Unread post by Kris_88 » 2023-10-28, 22:29

Bug 1421637
Print issue with display: flex
https://bugzilla.mozilla.org/show_bug.cgi?id=1421637

Example page:

Code: Select all

<html>
<body>
================================================================
<div style="display: flex;">
HEADER<br />
1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />
1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />
1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />
1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />
1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />
1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />
1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />
1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />
1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />
1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />
1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />
1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />
1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />
1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />
1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />
1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />
1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />
1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />
1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />
1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />
1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />
1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />1<br />
FOOTER
</div>
================================================================
</body>
</html>

User avatar
Kris_88
Keeps coming back
Keeps coming back
Posts: 940
Joined: 2021-01-26, 11:18

Re: Printing incomplete

Unread post by Kris_88 » 2023-10-28, 23:13

The problem is here:

Code: Select all


<div class="extended article-container-parts">

.article-container-parts {
	display: -webkit-box !important;
	display: -moz-box !important;
	display: -ms-flexbox !important;
	display: -webkit-flex !important;
	display: flex !important;
}

.article-container-parts {
  display: -webkit-box;
  /* OLD - iOS 6-, Safari 3.1-6 */
  display: -moz-box;
  /* OLD - Firefox 19- (buggy but mostly works) */
  display: -ms-flexbox;
  /* TWEENER - IE 10 */
  display: -webkit-flex;
  /* NEW - Chrome */
  display: flex;
  /* NEW, Spec - Opera 12.1, Firefox 20+ */
}

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35652
Joined: 2011-08-28, 17:27
Location: Motala, SE

Re: Printing incomplete

Unread post by Moonchild » 2023-10-29, 00:07

Kris_88 wrote:
2023-10-28, 22:29
Bug 1421637
Actually, Bug 1421637 (FF57) forwards to Bug 1089549 (older, but tracking for 59) which forwards to Bug 1622935 (FF78).
That bug has a ton more duplicates, and some important prerequisites/dependent enhancements without which it won't work:
Bug 1623225 - Store FlexItems and FlexLines in nsTArrays instead of linked lists
Bug 1625362 - Move some grid container frame's overflow-list helper function to nsContainerFrame
Bug 1627125 - Extend existing flex container APIs to support flex item fragmentation

and in itself causes regressions:
1720168, 1843228, 1637501, 1640028, 1640051, 1640275, 1678469, 1680406, 1739561

So, while the impression might be that it would be something relatively simple by just listing the one bug, it's not self-contained since flex items are not designed to be flow-broken, and it also took Mozilla considerable time to address. I'm sorry but I really don't see this getting much priority.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

User avatar
Kris_88
Keeps coming back
Keeps coming back
Posts: 940
Joined: 2021-01-26, 11:18

Re: Printing incomplete

Unread post by Kris_88 » 2023-10-29, 00:14

Moonchild wrote:
2023-10-29, 00:07
I'm sorry but I really don't see this getting much priority.
Yes, I saw that there was a complex dependency, but I didn’t see the point in copying it all into the post. It is clear that this cannot be fixed quickly, but at least we know the cause of the problem...

User avatar
athenian200
Contributing developer
Contributing developer
Posts: 1537
Joined: 2018-10-28, 19:56
Location: Georgia

Re: Printing incomplete

Unread post by athenian200 » 2023-10-29, 00:20

Kris_88 wrote:
2023-10-29, 00:14
Yes, I saw that there was a complex dependency, but I didn’t see the point in copying it all into the post. It is clear that this cannot be fixed quickly, but at least we know the cause of the problem...
How can you be sure this is the cause of the problem, if there is no patch to test against our codebase? Couldn't it just as easily be an unrelated printing issue? I feel like I'm just not seeing the evidence, there could well be multiple issues leading to incomplete printing...

I mean, it's a good lead, and that certainly could be the problem, but I think saying "the problem is here" might be premature.
"The Athenians, however, represent the unity of these opposites; in them, mind or spirit has emerged from the Theban subjectivity without losing itself in the Spartan objectivity of ethical life. With the Athenians, the rights of the State and of the individual found as perfect a union as was possible at all at the level of the Greek spirit." -- Hegel's philosophy of Mind

User avatar
back2themoon
Moon Magic practitioner
Moon Magic practitioner
Posts: 2411
Joined: 2012-08-19, 20:32

Re: Printing incomplete

Unread post by back2themoon » 2023-10-29, 00:24

Try the Reader View extension. The layout changes it brings, seem to solve bypass this particular problem. I'm not sure though whether all the code that follows remains properly formatted.
Last edited by back2themoon on 2023-10-29, 00:35, edited 1 time in total.

User avatar
Kris_88
Keeps coming back
Keeps coming back
Posts: 940
Joined: 2021-01-26, 11:18

Re: Printing incomplete

Unread post by Kris_88 » 2023-10-29, 00:31

athenian200 wrote:
2023-10-29, 00:20
but I think saying "the problem is here" might be premature.
I removed the CSS rules one by one and found the one that was causing the problem. Then I changed the class of just one element on the page and made sure that the print preview looked fine. Then I created a test example. Then I looked for a description of the printing bug related to display:flex, and found it.

EDIT: This is enough for my conviction.
Last edited by Kris_88 on 2023-10-29, 00:37, edited 1 time in total.

User avatar
athenian200
Contributing developer
Contributing developer
Posts: 1537
Joined: 2018-10-28, 19:56
Location: Georgia

Re: Printing incomplete

Unread post by athenian200 » 2023-10-29, 00:37

Kris_88 wrote:
2023-10-29, 00:31
I removed the CSS rules one by one and found the one that was causing the problem. Then I changed the class of just one element on the page and made sure that the print preview looked fine. Then I looked for a description of the printing bug related to display:flex, and found it.
I see. I guess the issue is, I think we actually have a lot of hand-written code for dealing with flex containers that Mozilla doesn't have, and Mozilla has since adopted Stylo/Servo and totally changed how they handle flex containers. So while both UXP and Mozilla may well have had a bug related to flex containers and incomplete printing... the exact cause might be different between codebases, because they've diverged a lot in that particular area.

Still, this does seem to narrow down the problem to display:flex, even if it is in totally different code than what Mozilla patched in the end.
"The Athenians, however, represent the unity of these opposites; in them, mind or spirit has emerged from the Theban subjectivity without losing itself in the Spartan objectivity of ethical life. With the Athenians, the rights of the State and of the individual found as perfect a union as was possible at all at the level of the Greek spirit." -- Hegel's philosophy of Mind

User avatar
Kris_88
Keeps coming back
Keeps coming back
Posts: 940
Joined: 2021-01-26, 11:18

Re: Printing incomplete

Unread post by Kris_88 » 2023-10-29, 00:42

The symptoms of the problem are very similar. I don't think any other bug caused the exact same problem. Although, of course, anything can happen... the only question is probability. :)

Galaxy
Moonbather
Moonbather
Posts: 51
Joined: 2016-07-04, 03:41

Re: Printing incomplete

Unread post by Galaxy » 2023-10-29, 01:15

If you install the Print Edit 18.4 extension, you can fix the print and preview problems you are having.

When you are in the Edit mode in Print Edit, go to Tools in the upper right corner and select 'Fix Page Breaks' to display all pages. A partial screen shot is shown below.
You do not have the required permissions to view the files attached to this post.