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
|
# File 'lib/asposepdfjava/Text/addhtml.rb', line 3
def initialize()
data_dir = File.dirname(File.dirname(File.dirname(File.dirname(__FILE__)))) + '/data/'
doc = Rjb::import('com.aspose.pdf.Document').new
page = doc.getPages().add()
title = Rjb::import('com.aspose.pdf.HtmlFragment').new("<fontsize=10><b><i>Table</i></b></fontsize>")
margin = Rjb::import('com.aspose.pdf.MarginInfo').new
margin.setBottom(10)
margin.setTop(200)
title.setMargin(margin)
page.getParagraphs().add(title)
doc.save(data_dir + "html.output.pdf")
puts "HTML added successfully"
end
|