summaryrefslogtreecommitdiff
path: root/Docs
diff options
context:
space:
mode:
authorJohn Tytgat <joty@netsurf-browser.org>2008-08-18 20:02:59 +0000
committerJohn Tytgat <joty@netsurf-browser.org>2008-08-18 20:02:59 +0000
commitfebfb54585fb9d7a0ef804fc22a93c3579704829 (patch)
tree2e5e4f0e5c8a20b1089b61a44a158407db9f9f1b /Docs
parent0e78a116f66773b56a2b3044af6f575092786258 (diff)
downloadnetsurf-febfb54585fb9d7a0ef804fc22a93c3579704829.tar.gz
netsurf-febfb54585fb9d7a0ef804fc22a93c3579704829.tar.bz2
Pencils-down last merge from Adam Blokus's PDF branch for his GSoC project.
Merged revisions 5118-5155 via svnmerge from svn://svn.netsurf-browser.org/branches/adamblokus/netsurf ........ r5130 | adamblokus | 2008-08-15 20:43:43 +0200 (Fri, 15 Aug 2008) | 2 lines Added docs for loosening and adding paged output. ........ svn path=/trunk/netsurf/; revision=5156
Diffstat (limited to 'Docs')
-rw-r--r--Docs/07-loosening31
-rw-r--r--Docs/08-printing58
2 files changed, 89 insertions, 0 deletions
diff --git a/Docs/07-loosening b/Docs/07-loosening
new file mode 100644
index 000000000..b9c3dd55e
--- /dev/null
+++ b/Docs/07-loosening
@@ -0,0 +1,31 @@
+Loosening content for printing
+==============================
+
+The role of functions placed in loosen.c is rearranging the printed content in
+such a way that it will fit in the page width. The methods were chosen
+according to the look of different pages after applying them, not on the base of
+any standards.
+
+
+Loosening passes
+----------------
+
+The page content is loosened in three passes. The next pass is applied only
+if the previous didn't give a satisfying result. The later a pass is applied
+the bigger interference in the page arrengement it means.
+
+In the first pass the changes are applied to those elements which don't have
+a chance to get entirely into the visibile scope of width - words which are
+too long for the available page width, objects positioned beyond the page
+borders and objects to big to fit a page.
+
+The second pass handles too big tables. The tables can be divided into two kinds
+- those responsible for page layout and those used only for holding data. For
+both of them some routines are used. Text in the cells is shrunken and broken,
+if this doesn't help the table cells are changed into inline containers as the
+table is problably a layout one.
+
+The third pass removes all margins and paddings. This saves a lot of space but
+makes also the page much less readable, for this reason it is the last step of
+loosening.
+
diff --git a/Docs/08-printing b/Docs/08-printing
new file mode 100644
index 000000000..772c29030
--- /dev/null
+++ b/Docs/08-printing
@@ -0,0 +1,58 @@
+Adding paged output
+===================
+
+This document is supposed to be a short guide of adding paged output to Netsurf.
+Currently the two pieces of code using the print implementation are PDF export
+and GTK printing.
+
+
+printer.h
+---------
+The first thing the new paged output has to do is implementing the printer
+interface located in printer.h. It consists of four elements:
+
+- plotter. This are the plotters which will be used while redrawing the
+content.
+
+- print_begin. This function is called right after the set up and should
+manage all the remaining user-specific initialisation stuff.
+
+- print_next_page. This function is called before the actual printing of each
+page allowing to prepare the content to be printed.
+
+- print_end. This function is called right before the printing routines clean
+after themselves and should be used for saving the output to a file, freeing
+previously allocated memory, relesing document handles etc.
+
+
+print.h
+-------
+The provided print interface consists of a set of functions which can be used
+seperately and one integrating them all making the print a matter of one call.
+If it is enough you can just call print_basic_run and wait for it to return.
+However, for the case you can't accompish the printing task this way the print
+interface gives you the possiblity of calling the print steps individually.
+
+Only if you are using print_basic_run you can omit specifying the print settings.
+If this is the case the default ones will be used.
+
+As you will notice the functions correspond to those you had to implement in the
+printer. The reason for this is adding some flexibility to the system which
+occured necessary i.e in the GTK print implementation.
+
+- print_set_up. This sets the printing system up and calls print_begin
+- print_draw_next_page. Here after calling print_next_page one full page of the
+dimensions given in the print settings is plotted
+- print_cleanup. This function is responsible for freeing all used resources
+right after calling print_end
+
+
+Settings
+--------
+This is where the besic information about the print job is held. You can use one
+of the predifined sets(DEFAULT and OPTIONS) or add your own. In order to do that
+you have to follow this steps:
+
+- add your entry to the print_configuration enum
+- add handling of it to the switch in print_make_settings
+- add the entry name to this document \ No newline at end of file