Archive for February, 2013

JLSN – Creating an Editable PDF file

February 27, 2013 Leave a comment

I needed to create a pdf file that allows one to fill in some details, save the changes and email the changed file.


After searching on google, I found the following instructions that worked perfectly for me. 2 Writer – how to create a PDF form you can fill in
1. Open a new blank writer document.
2. Type a phrase to use as a label (Example: Last name)
3. View > Toolbars > Form Controls (Checked)
4. Move the cursor over the Form Control Toolbar until the tooltip shows Text Box. Click the icon.
5. Drag the cursor over the location where you want to insert the text box.
If necessary, resize it using the handles or move it while the cursor shows a plus shape.
(Optional): Right-click the text box and change options – name, submission type etc….
6. Repeat for all the fields to enter.

If you want a default value for some or all of the fields, Click the Design Mode On/Off icon on the Form Control Toolbar to toggle off the design mode, then fill in the default values for the appropriate field(s).
7. File > Save As PDF
Save it.
Open PDF document using Adobe Acrobat.

I did this on Debian Squeeze and I can fill in the pdf when using Document Viewer, xpdf and ePDFViewer do not seem to be able to allow that to work. So it works well with Document Viewer, but fails on Windows with Adobe Acrobat 9.

Looks like it is a known issue Now my problem is that 100% of the users this was intended for are on Windows and are going to use Adobe Acrobat. I guess I am going to have to use a word document after all.

After more searching


sorttable – Make all your tables sortable

February 27, 2013 Leave a comment

Library that helps you have tables on you web page that can be sorted by column.

Quick Note – convert 1 to 4 as 1,2,3,4

February 5, 2013 3 comments

With GNU bash version 4.1.5

$seq 1 4 | tr '\n' ',' | sed 's/,$/\n/'

With awk (mawk version 1.3.3)

$seq 1 4 | awk -f transpose.awk | sed 's/^,//'

What transpose.awk looks like.

    for(i in _)
        print _[i] 


Categories: awk, bash

mdb – Getting data from Microsoft Access *.mdb files

February 1, 2013 Leave a comment


I had to get data from a Microsoft Access database but I do not have MS Windows installed.

What worked for me was mdb-export and mdb-tables which are both part of the mdbtools suite in linux.

I wrote a script to extract all the data.


_date="$(date +'%F')"

cd $WDIR/

# Get the tables.
mdb-tables $DATABASE | tr ' ' '\n' > db-tables.csv

sed '/^$/d' db-tables.csv | \
while read table
    echo $table
    mdb-export $DATABASE $table > dumped_${table}_${_date}.csv

# Clean up
rm db-tables.csv