Good day.

Faced a nontrivial task - to write a program for editing a document (estimated program) with the subsequent printing of the result (provided there is no Internet). I decided to make a browser-oriented solution, but I started to catch the “feils” at the stage of printing the document.

I use localStorage to store editable versions, but when I try to print, I start “katavasiya” - each browser tries to define the rules and markup of the printed sample in its own way, @media print does not save, Opera on MacOS does not want to print more than one page at all.

Gradually, I came to the conclusion that you need to either send data to a third-party class to generate PDF (because this format is ideal for printing), or to make a-la screenshot of the entire page in *.png/*.bmp/*.tiff . But the trouble is that all the solutions found are tied to a POST server, and it’s critical for me to use the local version without having to install a web server.

In general, if you come across something similar or have fresh ideas, I will be glad to advice.

  • To avoid confusion, configure the print settings for the user once, in all browsers it will be the same (just the defaults are different, so the markup goes). I mean jobs need to be configured, browsers. - Yura Ivanov
  • And did, half a pack of SvetoCopy already exhausted, probably trying to achieve similarity. Especially with Opera. But all the same, even if this issue is resolved, during pagination on printing, a “ladder” appears from the first line on new pages. - Realetive__

1 answer 1

As an option rtf? Do the styles themselves fly? Print to print without styles, tables.

  • 1) how to automate HTML (+ CSS) in rtf? 2) Estimated large, 160 points. Table and display. Invariably, a ladder appears in some of the first lines on new pages when splitting. - Realetive__
  • There is already Google to help, the transfer of lines and formation. and no matter how big it is. As an option towards excel, I did not look? - bes_dimm
  • Alas, it is important to know which line to move, you need to know exactly where the page break will be. Writing rules for all browsers somehow does not smile (and even more so to calculate these rules). I used to use the TCPDF class PHP (example at alphatrust.ru/nashi-uslugi/prajs ), everything was delicious, the output was Orthodox .pdf without problems with pagination. But now you need to do the same, but without the server part. By the way, page-break also turned out to be a useless thing. - Realetive__
  • Now using the spear method, I found out that the problem occurs only when drawing a frame from the table (and it is needed). Without it, the string is not "floating." - Realetive__
  • that is, if the frame is that all the rules? and page-break can be scored for example on 30 (only there is a probability that the gap in the last page of the curve will be) - bes_dimm