QB64.org Forum

Active Forums => QB64 Discussion => Topic started by: Mad Axeman on November 12, 2019, 02:19:14 pm

Title: Creating PDF files
Post by: Mad Axeman on November 12, 2019, 02:19:14 pm
Hi Folks

Is there a simple way to create a PDF file with QB64? A nice add in library perhaps? Or even some commands that I haven't found yet? I'm guessing the answer is no but I just have to ask.
Title: Re: Creating PDF files
Post by: _vince on November 12, 2019, 02:27:04 pm
Probably possible with DECLARE LIBRARY and the countless pdf libraries or you could write your own PDF routines, depends how advanced are the pdf features you want. OPEN "x.pdf" FOR BINARY and go from there

The easiest way of making pdf reports that I can think of is generating html then using one of the various converter tools, some are command-line and can be integrated into your program with SHELL.
Title: Re: Creating PDF files
Post by: Mad Axeman on November 12, 2019, 03:01:26 pm
The shelling to an external prog isn't suitable. The program I'm writing will be distributed to others and I don't want to have to go to the hassle of getting other peoples permission to distribute their programs with mine especially as only a small percentage of users will need the function. 
Title: Re: Creating PDF files
Post by: luke on November 12, 2019, 08:42:33 pm
My approach would be to generate HTML then pass it through https://wkhtmltopdf.org/ . It has a sufficiently free licence (LGPL) that you can just include it in your distribution and put appropriate attribution in the documenting.
Title: Re: Creating PDF files
Post by: Mad Axeman on November 13, 2019, 08:33:25 am
I see they have a c library which may do what I want. I'll have to look into including c libraries into QB64. I can't use the online version as the util I'm writting can be used by people working out at places with possibly no net access.
Title: Re: Creating PDF files
Post by: SMcNeill on November 17, 2019, 02:02:44 pm
You might take a look at the small little program I did here, and see if it's basic enough to handle your needs: https://www.qb64.org/forum/index.php?topic=1858.msg111221#msg111221
Title: Re: Creating PDF files
Post by: Mad Axeman on November 18, 2019, 04:53:53 am
Thanks. I'll take a look when I get back from work later today.