Close

Spreadsheet to form filler

A project log for Silly software wishlist

Motivation to do some software projects by writing them down.

lion-mclionheadlion mclionhead 10/10/2023 at 18:470 Comments

The general idea is to import a PDF which is not a fillable form & specify arbitrary locations to draw hundreds of individual spreadsheet cells on the form.  Lions have only seen solutions that require the PDF to be a fillable form.  In more general terms, it would be a spreadsheet to image overlay.  The PDF would be converted to a set of generic images & the spreadsheet cells would be drawn using a table of X, Y, SIZE entries.


It most certainly would require a GUI.  The 1st idea was to just export an open/libre office spreadsheet to a CSV file & read cells from that in a native program, but how tedious it would be to export a new CSV file for every change. 

It might be a good fit for a web app that ingested data from a goog sheet.  There are ways to import an image in a goog doc, then enter text on top of it.  There's a floating option for the image called "behind text".  As usual nowadays, the only way to see any of the options is to click on it or mouse over it.  Positioning text over it requires spacing, carriage returning over, & it's not very precise.  There might be a way to paste ranges of cells from a spreadsheet in a goog doc, but it doesn't work for lions.  This used to be a basic word processor function.

There is a javascript library which accesses goog sheet data.  At this point, any web app that ingests hundreds of individual cells from a goog sheet seems incredibly slow.  It would have to cache the data & only update it when the user hit reload.  It couldn't be done with a pure cookie database.   It seems best suited to a server focused workload with the browser as a very dumb GUI.  The browser would just query the server for text & images to draw while just doing the drawing.

 It would need a server based database of PDF files, decoded images from the PDF files, spreadsheet links, cached spreadsheet data, text locations.  Maybe all the goog doc interfacing & PDF decoding could be done on the server.  It would not decode the PDF in the browser.  Lions are pretty sure the goog PDF viewer outputs images.  The text overlays would be drawn in the browser.

The web app would just show the PDF with the text overlays.  There would be a cropping tool & a text insert tool.  The text boxes would have popups with a font size & decimal format.  There might be an export option to generate a set of PNG images but it might be easiest to use the browser's print to PDF function.  A PNG export would require 2 different rendering routines.

Lions still get a bad taste from using a goog spreadsheet, but it's easier to access the data than open/libre office.  

There's long been a need for a general apartment server to serve programs like this.  Other tasks for it are formatting weather station data, controlling desks, formatting hackaday data.  It might have to run on the router & that means stepping up the router speed, increasing the router storage, improving the enclosure.  A lot of programs these days create their own web server & require a browser as the GUI, so it's not that ridiculous even thought it's a lot more complicated than the old days.

Discussions