public
Description: A unicode aware PDF writing library that uses the ruby bindings to various c libraries ( like cairo, pango, poppler and rsvg ) to do the heavy lifting.
Homepage: http://rubyforge.org/projects/pdf-wrapper
Clone URL: git://github.com/yob/pdf-wrapper.git
pdf-wrapper / DESIGN
100644 48 lines (38 sloc) 1.454 kb
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
#############################################################
# Various thoughts on design issues
#############################################################
 
*************************************
* Overarching Design Principles
*************************************
- low level canvas drawing API
  - add text
  - add shapes / images
 
- higher level "widget" API
  - text boxes
  - form helpers ( check boxes, etc)
  - water mark
  - repeating elements (page numbers, headers/footers, etc)
  - image boxes
  - lists
  - tables (port simple table?)
  - add pages from existing PDFs
 
*************************************
* Thoughts on the table API
*************************************
 
FPDF::Table
- .table(data = [], columns = [])
- http://source.mihelac.org/2006/6/19/creating-pdf-documents-with-tables-in-ruby-rails#comments
 
PDF::SimpleTable
- .table(data = [{}], columns = []
 
XHTML?
- .table(data = String, opts = {})
 
 
*************************************
* API consistency
*************************************
 
When placing objects onto the canvas, 2 styles
- func(data, opts)
  - positioning details default to sensible defaults. x,y the current cursor location, w,h the distance from the cursor to the right and bottom borders
  - positioning options can be overridden in opts
- func(x, y, w, h, opts)
  - when default positioning can't be sensibly inferred (shapes, text cells, etc)
  - forces user to choose details when they call it