Script to convert records to PDF


(Chrissy h Roberts) #1

Several of my users have asked me if there is a simple way to convert individual records from ODK in to PDF files. This is pretty useful if you are running ODK for scientific research studies where ethics boards insist that data collection sites retain hard copies of data forms.

I've written these scripts for my own use but thought that they might be useful to some others who have similar need. They are a pair of R scripts, one in R markdown. The first will download everything via java ODK briefcase tool and create a csv file. Then they iteratively work through the csv file, sending calls to the markdown script and telling it to make a report in pdf, binding the data together with any images captured in the media folder.

I'm no hardcore programmer, so these scripts are rough around the edges. Feel free to mod, improve and repost.

You'll need to install latex and pandoc. I used homebrew, but many options for this.
Also, remove the .txt extensions before use

Scripts
ODK_hardcopy_in_pdf.R.txt (2.7 KB)
pdfmaker copy.Rmd.txt (769 Bytes)

Example Pdf attached
2017-01-31_12_21_53_TMIH_example.pdf (239.0 KB)


(Abel Melquiades Callejo) #2

This is great @chrissyhroberts. Just a suggestion.... You can put this on GitHub. Other people might want to improve it further. :slight_smile:


(Chrissy h Roberts) #3

Hi Abel,
Good point, It's upnow


(Joseph E. Flack IV) #5

Hey @chrissyhroberts. Thanks for sharing.

I kind of wish I had posted our project and app, PPP many months ago. I am wondering if it should be useful for your project(s). I just posted about it here in the showcase as well.Better late than ever, I suppose. Check it out and let me know what you think, and also let me know if there are any features that your script provides that PPP currently does not.