[Gambas-user] Question about gb.cairo

willy at ...3474... willy at ...3474...
Mon May 23 16:31:51 CEST 2016


Hi all,

I have written a function to make a pdf from data in a mysql database.
This function is in a library. A command line application 
'PrintKwartaal' uses this function.
Goal is to print the pdf on a quarterly base using a cron job on Debain 
server. The cron job starts the Gambas application 'PrintKwartaal', that 
has to make the pdf and print it and next quit.

To write the function is started coding in a GUI environment (Gambas 
3.6.2 on Linux Mint 17.1 Rebecca), so I could check the layout more 
easily and adjust.

When I run the function in a GUI application, it renders the pdf to the 
location required (and I used Desktop.Open(sPdfFile) to get a preview of 
the pdf to check for layout adjustment).
So, using Gambas 3.6.2 om Linux Mint 17.1 Rebecca the pdf does get made 
on location sPdfFile

Once I was fine with the layout I wrote the 'PrintKwartaal' application 
using the same function from the library.
In the function. the 'Desktop.Open(sPdfFile)' was replaced with 'Shell 
"lpr " & sPdfFile Wait' as it is of little use to do a preview of a pdf 
in a non-gui environment.
And the need is for a printed version of the quarterly overview of the 
table content.
This change is past the Cairo.End and should be of no influence on the 
rendering of the pdf.
That is all that changed in the function.

When I run the function in a commandline application 'PrintKwartaal' on 
a non-gui system (Gambas 3.6.2 on Debian 7.10 Wheezy server), it doesn't 
renders the pdf to the location required.
So, using Gambas 3.6.2 on Debian 7.10 Wheezy the pdf never gets made on 
location sPdfFile

Could it be gb.cairo can be selected as component for a non GUI 
application, but will not work when run in a non GUI environment?
Or could something else be wrong.

Kindest regards,

gbWilly




More information about the User mailing list