Wednesday, March 7, 2012
Painting, odt and pdf
Anyway, I got started, got a form and validated the input and somehow found out some code to write it to an odt file too. Now here comes the dealbreaker - we want it to be formatted just so and so, and we (again) don't care which hour it is! Right, so I use our dear friend, beholder of finding obscure things from the haystack called Internet i.e. google and after some (furious) searching found out that what I am trying to do is not done before and there's couple of percent chance that I may be able to do it. I like any chance than zero percent so I dug in my heels and dived deeper. A few frustrated hours later I was back at the document with no formatting, almost all links in google exhausted, and cursing Qt's stuffed up support of handling ODF and the general lack of quality tutorials.
I am not one to leave it at that though, so I said fine, can they have pdf and use it, and the answer was yes. So once again I went through all the above paragraph and finally ended up getting a pdf ready. It was not without pains though. I had to mess up the layout by manually adjusting things and then there was the file redirection where the function to disable immediate printing was missing. I had to set printer name to something invalid so that the app would just put things inside the pdf. And last but not least I was stuck for two and half hours at the printer object problem where it had to be initialised at start but then I had an idea about using a pointer for that and it was solved. And so after some further tweaking, I had the application ready.
Testing it was another hell though, and I don't want to depress you more about the often looked over dark parts of everyday software.