-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Printing (physical page rendering) support #147
Comments
I do not know if that has relationship with this issue, but just a historical reference about how Google Docs works http://web.archive.org/web/20101202060733/http://googledocs.blogspot.com/2010/05/whats-different-about-new-google-docs.html |
Actually, I've just realised that I lied to you – just like the doc says, GDocs is using a custom DOM-based layout engine. That engine is controlling each word and perhaps letter separately. Obviously that gives them the power to do whatever they want as long as it's not killing the browser (in terms of performance), but it's has its serious downsides such as it's going to break miserably in uncontrolled environment, you can't style it through a stylesheet, it's not gonna work on mobiles, etc. Plus, obviously, it's a huge amount of work and tones of code. CKEditor 5's architecture allows plugging in a different rendering engine, because it's layered and event based. But we're not planning to even try to prototype a custom layout engine at the moment. It just doesn't make sense for CKEditor, because that would mean building a very different kind of application. |
What is possible at this momentTo start off, there are several techniques available to control the print layout of the web page:
Check out the "Document Editor" sample: What could help us in the futureCSS Regions is a working draft, which (in theory) would give developers a very firm control over the flow of the document, especially in the context of printing and layout management. This feature is far from being mature but I managed to create some sample in Safari anyway. Despite the broken table rendering on the second page, it shows the general potential of the regions, offering an experience similar to the native text processors like MS Word. Unfortunately, at this moment it is available only in Safari, IE11, and Edge, where Apple implemented it partially and Microsoft limited it even more. The status of regions in Google Chrome is "No longer pursuing", which probably means that even if Google decided one day to implement it, it would probably take years anyway before developers can use it in production. The truth is, as CKEditor developers, we're at the mercy of web browser vendors in this matter because there's no way we could provide a decent print layout editing experience unless we decide to follow the Google Docs philosophy, which means abandoning contenteditable completely in favor of a custom rendering engine. And by doing so, CKEditor would lose its web page "WYSIWYG–ness", which is quite out of question for obvious reasons. I do really hope some day web browsers (CSS) will provide useful tools to manage printing and layouts in general and we'll be able to offer our users the best experience to work with. Sadly, there's no way to tell when would that happen, and if, given that CSS Regions Module draft have been proposed in 2011 and it's still quite unpopular. |
Cleaning up old discussions. See #186. |
More details: ckeditor/ckeditor5#1054 (comment) |
Sorry to interfere, but I see a relation between this issue and this ckeditor/ckeditor5#1121 CSS Regions are unfortunately not a thing anymore in Webkit. And that would be really awesome ! (that may not be the goal of the cksource team, but this comment makes a +1 to ckeditor/ckeditor5#1121 ) |
The problem is that enforcing (or rather, encouraging) the browser to split a contet when printing it is one thing. CKEditor 4 allows inserting page breaks. But this is completely manual job. What people would like to have are real page breaks in the content. Page breaks which are updated live and which are able to split things like images, tables, lists, etc. Unfortunately, without implementing a custom rendering system (which e.g. Google Docs did) that's not doable today. So, the best way around this, currently, is implementing easily accessible preview of PDFs generated via a tool like Prince. You edit the content in CKEditor 5 in one place, press some button and you can see how the content will be printed. Then you need to get back to the editor to edit the content further. Of course, it's far from perfect, but that's the reality today. |
Sinde the last comment on this was 6y ago, where do we stand today? This is still a feature i would love however not much to find about |
The question is whether CKEditor may support physical page layouts like MS Word or Google Docs.
The use case of such feature is clear I guess – being able to create documents for print.
The problems are quite clear as well:
So, while this is an interesting feature to have, there serious technical challenges. CKEditor is focused on web content and we don't want to use canvas like Google Docs does (otherwise, we'd be duplicating GDocs functionality). We're using native DOM and it's not made for printing... yet.
The text was updated successfully, but these errors were encountered: