Tuesday, January 26, 2016

LibHaru is a Wash

When push came to shove, embedded libharu with lua binding was a wash. I could not generate decent reports for it despite hours of work writing utility routines in Lua for it. I tried everything until I realised the library is just nothing but a collection of crude primitives that you can create a .PDF file with as a server stream. An impressive toy but under real use at work it fell apart.

My original idea for reporting was printing a report as a block formatted HTML paginated browser view and then figuring out how to send this to the printer or PDF. This means on thin clients it has to have a printer server connected or at least some kind of PDF server. There is a really good open source PDF server I switched to but it complicates reporting in Vault-OS which ideally was intended to be an all-in-one. The PDF has to run as a utility which the Lua executes with the HTML as an argument and then dumps it into a cache. This is my solution at work but I think I am going to hatch something else for Vault-OS. I may keep looking for a compact embeddable library that can stream to a web page but mainly converts HTML on the fly to .PDF where possible.

Any ideas from anyone else, seriously, much appreciated. Reporting in Vault-OS is a biggie. You have to be able to print out a shopping list to go the supermarket and top up your wishlist and expired or rotated list. It is really important functionality in a survivalist inventory manager. The barcoding solution I solved so elegantly it is beyond belief, also as an HTML trick to print barcode 39 straight from the browser. If anybody knows an embeddable solution in ANSI C I could compile directly into my code like LibHaru that outputs to .EPS, .PDF or LaTex and permits complex chart and table functionality with ease I would be really interested. Anything that once it is output can be displayed to the browser window directly or else sent to the printer. I know it sounds like a big ask and it is complicated but I have already turned so many huge problems into simple solutions with Vault-OS I know there is something out there that would work for this. The ideal solution would be to create a report as HTML and send it to .PDF like I am doing at present except this code would be compiled right into it. Incidentally I tried removing Libharu and the current build instantly shrunk from 2.1 megs to 1.28 megs, again small enough to fit on a floppy.

My solution for work requires a binary command utility to be present in the bin directory under the server, a good answer for my current requirements but a little too specific for Vault-OS. Any help from anyone will be much appreciated. Remember, ANSI C cross platform code is best. (I know this sounds ridiculously difficult to satisfy but somebody out there may know of another way of thinking about the problem of printing formatted reports altogether.)


bicebicebice said... nice skull

MycroftJones said...

It isn't ANSI C, but have you considered Pandoc? As an uber-super-genius, I'm interested in your take on Haskell anyway. I stopped at LISP; Haskell was just a bit beyond me.

Sam said...

Uh...cough...cough. Rebol has a program called pdf maker.

PDF Maker
A dialect to create PDF files from REBOL.
author: Gabriele Santilli
PDF Tables
Create tables with the PDF Maker
author: Gabriele Santilli

I came up with a brilliant idea but you're not going to like it. It will rub up against your "run everything perfectly on a floppy" ethos. I was looking for my Hiren's Boot Disk and couldn't find it. Horror.

It saved my bacon one time. I was installing PCBSD and even though the booted live CD told me that I was writing to a prepared partition it actually wasn't. I had changed my boot preference in the bios but the format tool ignored the bios and formatted according to the actual hardware connection. Arrrgh!!!! Lost my C drive and only with Hirens and a back up I made of the C drive was I able to get it back.

Anyways. Hiren's has everything. It's a mini XP Live CD,(Bart PE I believe). It's also customizable It's a 595MB CD that can also be written to a USB drive. Put vault OS on the CD with all your tools or write to a USB stick. You could use full sized free programs. Open office with some custom templates would do for all database and excetra. You're done. No it doesn't run on a floppy but I just can't see you ever getting everything on a floppy that will be of much use. People want GUI's that are detailed enough so that they can poke around and find stuff. I mean who the hell remembers a book full of DOS commands. The only people who remember DOS and other command line utilities commands are people who do it day after day all the time. Hiren's is already set up. People know how to use windows and Linux is not going to be any smaller. Maybe QNX would be but then you have to write all the software to get it to work. Hiren's is the best alternative.

An aside. I found that when you save a Windows partition it will NOT save the boot portion of the partition and restore it. Took me a long time to figure out how to boot it again. What I did was quick install windows to the drive I wanted THEN overwrite that partition with the Windows back up that I saved. Works also to move a present installation of windows to a new drive.

Sam said...

You really should look at Rebol/RED. See this page here.

I screwed up the link to the useful sticky's documents. It's below.

Start out with Rebol 2. It's all packaged together. Maybe use the RED from the Red Programming page link but realize it's newer and may be off in a few spots. Follow Nick's easy exercises and you'll have the basics of the whole thing. Rebol and RED are almost the same so learning with Rebol will be easier as it's been around a while. When RED gets finished in six months or so you can use it. I apologize for bleating about Rebol and RED so much but it's amazing what it can do and it's capabilities are as deep as your intellect is capable of going. With the advent of a compiled Rebol, through RED, I can see no reason to learn anything else unless you need stuff for work or just like learning languages for fun. tutorials and articles

useful sticky's documents

You might also look at Haxe

From Nick. This thing is huge and detailed. I just ran across it. I had an old copy but this ones updated. Look at the bottom at "24. Beyond REBOL" it's where I got the Haxe link.

Now here's a great one for Tex. Here's a whole consignment store software free download written by Nick (Is there anything this guy can't do?). Uses off the shelf CCD scanners for inventory. The whole works including the kitchen sink (if you got one to sell).

Sam said...

"...It weighed almost 1700 tons and contained somewhere around 900 tons of solid gold..."

I can't believe this. For the simple reason that if you found all this gold would you tell anyone? Hell no.

Using online RPN calculator

and melt value of coins

900 ton x 2000 lbs/ton x 16 oz/lbs x $1123.70/oz=$32,362,560,000

Come on. I'm an honest guy but everyone has there breaking point. Well maybe Saints don't but I'm not Saint. I wouldn't tell a soul.

Takudzwa Aywok said...

Tex, did you know that melons invaded Ireland too, with the Tuathe de Dannan?
Some of them intermarried.
How could it be that they lost, motherfuck?
It seems the Tuatha actually could manage to raise armies.
But the problem is, whenever they'd have a part fomorian king.. he wouldn't last long on the trone because avarice.

Everything seems to correlate perfectly and indicate that those were melons.

I read on some book of which the title I don't recall that the Tuathe de danann mastered sound and music and that this is how pyramids n shit were built, and that the "annunakis and the tuatha combined their technology".

That bres, a fully fomorian guy was considered as "Beautiful" seems to confirm the idea that the original melons had as well a nordic and gracile appearance.

>"the undersea ones"
Reminds me of the "rod that gives off light when shaken" thang

Russell said...

Have you looked into ImageMagick? It converts all sort of formats into others. There's a Raphael exporter that uses it.

Takudzwa Aywok said...

An interesting prophecy for the Tuatha de danann

"It is said to be a time when symbols will be more real than the things they represent, when people no longer have thoughts of their own and their minds are stronger than their instincts"

" I shall not see a world that will be dear to me.

Summer without flowers,
Kine will be without milk,
Women without modesty,
Men without valour,
Captures without a king.

... ... ...

Woods without mast,
Sea without produce,

... ... ...

Wrong judgments of old men,
False precedents of brehons,
Every man a betrayer,
Every boy a reaver.
Son will enter his father's bed,
Father will enter his son's bed,
Everyone will be his brother's brother-in-law.

... ... ...

An evil time!
Son will deceive his father,
Daughter will deceive her mother.[11]"

And also that they will return from the sidh for one last apocalyptic battle of which they will be the victors.

cbenediccengi said...

check out the twitter feed of the newly elected socialist, prime minster of Canada. You can't write comedy this golden. His daddy opened up our borders to non-whites

Michael Deloatch said...

When the son hits your eye like a big pizza pie, that's Fomh├│raigh.

Sam said...

"...Uh...cough...cough. Rebol has a program called pdf maker..."

Oops. I goofed. I read this post,

"...Generating a PDF from HTML or filling out forms sounds like kind of a turnkey thing that you might want to call to an externally maintained tool for. But there is a project out there by Gabriele Santilli which generates legal PDF files from a Rebol PDF dialect:

I assumed that pdf-maker converted html to pdf by reading a few things quickly. This is not so. I gleaned after reading the docs further. Apologies.

I guess the only way you could make this work to to convert the HTML into the dialect (part I missed) which wouldn't necessarily an easy task. Of well.