Creating a PDF from a console app?

I have a console app that I need to be able to create a PDF with text information info and maybe a logo (not important) and the ability to be able to specify the output path/filename. I was going to use TurboReport which I have used on desktop apps but just realised it is not a class but a control container which I cant us in the console app.

Can anyone suggest a way to do this, Turbo Report was really easy to use so something similar would be good. This is going to be a Windows only console app so could use a third party ActiveX if needed. I did look at the MBS option but may be a bit overkill for what I need and I did see BKeeney is creating something but not yet available.

Your needs seem pretty simple. Try this https://github.com/roblthegreat/rsfpdf it has a friendly license as well.

I wrote a whole article on how to do this in xDev 11.1 (http://www.xdevmag.com/browse/11.1/11107/).

Probably 80% of the things I wonder (can Xojo do this?) is either in the forum, the XDev mag or has a plugin for it. Pretty cool!

DynaPDF Starter will do this.
And very efficient with font subsetting, optimized image handling (no duplicates in file), various compressions and color space support.

Thanks everyone for the help and suggestions. I decided to see if I could get my head around converting a container class to a normal class (I am still trying to get my head around classes etc) so I started to hack apart TurboReport and have about 99% of it working (just the tables to look at now). It wasnt that hard to do but to be honest it is nowhere near as clever as the MBS PDF but for what I need right now it should be fine.

The MBS PDF looks really good for complex stuff but with an (over) 800 page manual I think I need to leave that for another day when I have some time to work my way through it :wink:

If it is not going to be run as a service, then could a normal desktop app with the window set invisible do it ?

to draw simple PDF, you can simply change an example and get it done with 20 commands.

Hi Christian… Personally I use either MBD+DynaDPF from RS/Xojo or DynaPDF from c… Great support as you & Jens as you implemented Userunits to enable me to make properly scaled very long images ( I now save image scans well over 10m long to PDF ).

Err, I meant MBS, not MBD, in the above

Ok, I decided to take the plunge and start reading the MBS PDF manual, well I gave up after a few pages and looked at the examples instead. After 20 minutes playing I have now binned the TurboReport hack and am using MBS PDF in my console project as it is easy to get things going (still a little confused with the positioning but getting there). Anyone looking at PDF for console apps should look at the MBS PDF plugin and dont be put off my the manual, once you start playing with the examples them manual makes more sense. Next thing is to play with tables and then adding images. Hmm, probably the best Euro 149 I will spend this week. :wink:

Nathan,

I found bkshorts very helpful for reports coupled with dynapdf for PDF generation.

For my simple needs I’ve used some old open source pure Xojo PDF classes from a product before the author took it commercial.

That product was abandoned for awhile and was acquired a few months back by Bob Kenney. Don’t know what his plans for them are… I think (not sure) that version might work in console apps. Not sure the ones I have do.

BTW PDF support in Xojo itself feature request:
<https://xojo.com/issue/10701>
has been " scheduled for development" since Sep 15, 2011 at 12:06 PM…

Guess they are really organized and schedule WAY out! :wink:

  • Karen