Script to convert records to PDF

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)

6 Likes

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

3 Likes

Hi Abel,
Good point, It's upnow

3 Likes

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.

1 Like

Hello. Can someone help me with this? I am urgently needing to convert records to pdf. I have them exported to Excel. I'm not a programmer. How do I do it?

It would be great if we could generate a PDF and then get it to automatically send via email whenever a completed form is submitted