TrustTheVote-Project / horatio-server

Turns JSON absentee ballot requests into PDFs and delivers them to registrars.
MIT License
1 stars 3 forks source link

Store provided data in the SBE PDF #29

Closed waldoj closed 9 years ago

waldoj commented 9 years ago

Under the law, must we provide registrars with a PDF? Or can we give them something else? If they're just going to copy and paste it, would they prefer a plain-text file?

If a PDF, then we need to edit the PDF they've created to add the provided data. That sounds like a real pain.

waldoj commented 9 years ago

Maybe use mPDF?

waldoj commented 9 years ago

Yes, we must provide a PDF.

waldoj commented 9 years ago

Seems like the writeCell() method is the way to go.

waldoj commented 9 years ago
waldoj commented 9 years ago

OK, I think pages are imported with ImportPage, after being loaded with SetSourceFile.

waldoj commented 9 years ago

I've got ugly, janky code, but it works. I have the coordinates recorded for every field. It remains to figure out the font size and kerning for each. Also, to figure out how to handle answers that aren't textual, but spatial, e.g. checking off the record text box. (I know how to handle that in the abstract, but I want to know how to do it nicely.) Right now, the code is only dropping in the field name (e.g., more_info_email_fax), so I also need to map the provided fields to the form fields.

waldoj commented 9 years ago

I took the janky code and turned it into JSON, adding font size and kerning control, although that size and kerning doesn't have any connection to the application layer.

waldoj commented 9 years ago

Bingo—the form is being completed, flowing in data from JSON.

form

waldoj commented 9 years ago

It remains to lay everything out nicely. We need to adjust some fields' kerning and type sizes.