Project

documenter

0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
This gem uses OpenOffice and pdftk to convert, split, join, fill and copy files. It may be usefull if you have many documents to work with. It is not realy fast solution and it depend on istalled software
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

>= 0.8.2
 Project Readme

documenter¶ ↑

Documenter is small collection of scripts to work with different format of documents It includes:

  • Odf and Odt classes to fill forms, tables and e.t.c

  • File format convertor based on JodConvertor. To work with it, you need to have open office istalled localy

  • Pdf worker based on pdftk. You should install it too

  • Csv class to work with csv more easely

Installation¶ ↑

% gem install documenter

Example¶ ↑

Csv¶ ↑

Load data from file into two demetions array data = File.open(‘test.csv’).csv(:cell_split => ‘;’)

Export data to csv file data.to_csv(:file => ‘myout.csv’, :header => [‘a’,‘a+100’], :cell_split => ‘;’)

Convertor¶ ↑

Convertor.convert ‘test.xls’, ‘test.pdf’

Pdf¶ ↑

Join files together

Pdf.cat [‘a.pdf’,‘b.pdf’], ‘output.pdf’

Split pdf to pages second parameter - string that would be used as a pattern to save each page

Pdf.burst ‘hello.pdf’, ‘doc/page_%.6d.pdf’

#opening existing document doc = OdtFile.new ‘custom_register.odt’ #set value of form field doc.text.fill_form(‘number’ => ‘test’) #search for table and yield first row copy for each data row doc.text.edit_table(:name => ‘posts’, :data =>posts) do |row, content|

#replace form fields
row.replace_form(content)
#we shoul return row back
row

end doc.save ‘out.odt’ #you should use close to delete temporary files doc.close