This site will have limited functionality while we undergo maintenance to improve your experience. If an article doesn't solve your issue and you want to ask a question, we have our support community waiting to help you at @FirefoxSupport on Twitter and/r/firefox on Reddit.

Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

Firefox does not print When printing a 2MB document with plain html

more options

I have a requirement to print a large document. The size of the html files is about 1.9MB.

Firefox does not responds while printint this kind of large file.

I have uploaded a sample file at http://www.4shared.com/document/riEKai1K/tt_online.html?refurl=d1url

and

https://dl.dropbox.com/u/71996963/tt.htm


I tested this with firefox versions 14 and 15. But the problem is with all the versions.

How can i get this resolved??

I have a requirement to print a large document. The size of the html files is about 1.9MB. Firefox does not responds while printint this kind of large file. I have uploaded a sample file at http://www.4shared.com/document/riEKai1K/tt_online.html?refurl=d1url and https://dl.dropbox.com/u/71996963/tt.htm I tested this with firefox versions 14 and 15. But the problem is with all the versions. How can i get this resolved??

Modified by samjayander

All Replies (8)

more options

I was not able to download that file.

At what point does Firefox stop responding -- displaying print dialog, after clicking OK to print, rendering Print Preview, etc.?

more options

Hi,

I have uploaded the file to my dropbox and here is the link https://dl.dropbox.com/u/71996963/tt.htm

And firefox displays the print dialog on selecting print and upon clicking Okay it keeps on working for a long time.

Also, print preview is working for a long time. Is there any workaround to get this problem solved??

Thanks!!!

more options

Gah, I ran out of patience waiting for it to print after about 15 minutes.

Your table has 25,841 rows, which is pretty long. Firefox certainly is not optimized to deal with long tables. I'm not sure that tables half that size are part of the test suite...

(I tried deleting the style rules and COLGROUP from the page before previewing and Firefox seemed to struggle with it longer, i.e., there were active changes in memory use for much longer. But eventually it crashed.)

(For the record, I also tried Portable Firefox 9.0.1 with html5.parser.enable set to false and got the same result so I don't think it's unique to the HTML5 parsing engine.)

Other than printing from IE, I think you might have to break up the document. Assuming I can come up with an easy way to do that, would there be any problem with doing it, for example, is it an official record that can't be modified?

more options

By the way, if I delete all the rows after the first 2500, the page previews and prints, taking 70 (PDF) pages. If I try 5000 rows, Firefox crashes. So somewhere in there appears to be the limit, at least on my system.

To experiment with deleting rows, you can use this code in the Web Console. Press Ctrl+Shift+k, then paste the following line of code next to the caret (>) and press Enter to run it. group=1 yields rows 1-2500, group=2 yields rows 2501-5000, that's all I tested.


var group=1; var max = parseInt(group) * 2500; var t=document.getElementsByTagName("table")[0]; while (t.rows.length > max + 1) t.deleteRow(-1); while (t.rows.length > 2501) t.deleteRow(1);

If you want to see the row numbers, run this variant, which inserts a row number in the third column:


var group=1; var max = parseInt(group) * 2500; var t=document.getElementsByTagName("table")[0]; for(var i=0; i<t.rows.length; i++) t.rows[i].cells[2].textContent += " ... r=" + i; while (t.rows.length > max + 1) t.deleteRow(-1); while (t.rows.length > 2501) t.deleteRow(1);

By the way, opening the full document into Excel 2010 and printing quickly yields 528 pages. It's probably easiest to just do that if you have Excel.

Modified by jscher2000 - Support Volunteer

more options

You can also use CSS counters to insert a row number.
Then you can easily remove or change it by disabling or modifying the style.

Some examples:


table {counter-reset:links}
tr td:first-child:before{
 content:"[" counter(links) "] ";
 counter-increment:links;
}

table {counter-reset:links}
tr td:last-child:after{
 content:"...r:" counter(links);
 counter-increment:links;
}
more options

Hi,

Thanks for your time.

This issue is from silverlight. We are trying to print a report from silverlight. To do it we are dynamically creating a html document and passing that document for the browser to print it.

This logic works well in other browsers like IE and Chrome. In firefox we face this issue.

Is there any other way other than breaking of the document, because it is a report and need to be printed in one-shot.

Thanks and Regards, Sam.

more options

How do you feel about not using tables? Here's my "alternate layout" which uses <p> and <span> elements, fixing the width of the spans using display:inline-block. The :last-child pseudoclass was not supported in IE8 or earlier, but I think it should be okay (third "column" would be 25px wider on older IE's).

http://jeffersonscher.com/forumshots/alternate-layout.zip

I assume (?!) you can generate this layout, but I suppose it depends on how you're building the report.

more options

Hi, sorry for the late reply.

We are exporting the date from Grid control from silverlight and the Control renders the html content as table.

So new we need to check if we should iterate the values to get your layout without table.

Thanks for your help!!!!