summaryrefslogtreecommitdiffstats
path: root/filters/kword/pdf/DESIGN
blob: d2d5bb0891632035bdf9de424134feb02247877a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78

The design of this filter is a bit complicated due to the use of XPDF (which
is not done for use as a library).

PDFImport implements the KoFilter class and is the starting point in the
process:

PDFImport::convert
 |
 |- Dialog: ask for import options
 |
 |- Document::paperSize/pageQt::Orientation: extract paper size/orientation
 |
 |- for each page
 |   |
 |   |- Document::treatPage -> [XPDF]PDFDoc::displayPage
 |      which calls the following methods as appropriate
 |       * Device::startPage -> new Page
 |       * Device::endPage -> FilterPage::endPage
 |          |
 |          |- [XPDF]TextPage::coalesce
 |          |
 |          |- Page::createParagraphs
 |          |
 |          |- Page::checkHeader
 |          |
 |          |- Page::checkFooter
 |       * Device::updateFont/... -> TextPage::updateFont
 |       * Device::beginString -> new String -> new TextString
 |       * Device::drawChar -> TextPage::addChar -> String::addChar
 |          |
 |          |- checkLigature
 |          |
 |          |- TextString:addChar
 |          |
 |          |- checkCombination
 |       * Device::endString -> Page::endString -> TextPage::endString
 |         -> Page::addString
 |          |
 |          |- checkCombination
 |          |
 |          |- TextPage::addString
 |       * Device::drawLink -> Page::addLink
 |       * Device::drawImage(Mask) -> Device::initImage -> Device::addImage
 |       * Device::stroke/fill/... (ignore at the moment)
 |
 |- Document::init -> FilterDevice::init: compute and set body, header, and
 |  footer rectangles for all pages
 |
 |- for each page
 |   |
 |   |- Document::dumpPage -> FilterDevice::dumpPage
 |       |
 |       |- Data::initPage
 |       |
 |       |- Page::dump
 |           |
 |           |- Page::prepare
 |           |   |
 |           |   |- associate links
 |           |   |
 |           |   |- Page::initParagraph: compute tabs, indents and alignments
 |           |   |
 |           |   |- Page::fillParagrap: remove hyphen/eol, add tabs, add text 
 |           |   |
 |           |   |- Page::checkSpecialChars -> Page::checkSpecial
 |           |   |
 |	     |   |- Page::coalesce(par)
 |           |    
 |           |- Page::dump(par)
 |           |
 |           |- add tab, indents, offsets, flows, text and format
 |           |
 |           |- Data::createParagraph
 |
 |- Data::endDump
 |
 |- write XML to KoStoreDevice