Hi,
Patrick Law wrote:
Hi,
I have written a XPI command line module that it lets you to print a
page to
a postscript file and convert it to PDF using ps2pdf.
Linux only, I'm assuming, but cool.
What I found is that
the printing engine creates very different result than the on-screen
rendering engine and of course many of the print CSS style like
page-break-after:always is not being used in the on-screen version.
Eli, I am curious how page breaks would work with "dump screen output is to
use
<canvas> with drawWindow and toDataURL to get a raster image of a
webpage", does the on-screen version (not paginated version) has the notion
of the page?
No.
If not, can you give me some hint on how to cut the raster image web page
into pages?
You can just cut the page into pieces arbitrarily. The downside to this
approach is rather obvious, but it could be good enough depending on
what you're doing. This is the approach that print selection takes for
pagination in Gecko (there is a bug filed to make it use real pagination).
Also, I am trying to implement *page-break-after:avoid*, if anyone can give
me a hint how to do this that would be great.
What I am thinking is that using the *nsSimplePageSequence::**Reflow* to
detect when Reflow thinks it needs a page break, it would call *
CreateContinuingPageFrame* to create a new page, then go into that page and
found whether the last child of the last frame has the
page-break-after:avoid style set, if so, move that frame into a new page
and
put that last child into the page.
I'm not that familiar with the block reflow code, so my advice here
might be a bit off. The concept sounds right; I'm not completely sure
that's the best place to put it, though, considering that it's all
block-specific code. You probably want to take advantage of the
pagination stuff that's already there. Also, by the time you're in the
SimplePageFrame reflow, you might not have enough information,
especially when you start dealing with tables.
Any help is appreciated!
Many Thanks
Patrick
-Eli
_______________________________________________
dev-tech-layout mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-layout