News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Printing code from c::b produces a weird misaligned mess

Started by Stuart R, September 08, 2013, 01:46:17 PM

Previous topic - Next topic

Stuart R

I seem to be getting some strange results when I try to print from c::b. Different parts of the text seem to be misaligned in different ways depending on how c::b is classifying it (punctuation, keywords etc). However, this doesn't seem to be a common problem so I suspect my own system.  Sadly, I don't understand enough about c::b and printing to know where to start. I'm using c::b 12.11 on Ubuntu 13.04 - I attach an image of the output.  Any help would be appreciated.
Thanks
Stu R

[attachment deleted by admin]

Alpha

I am not exactly sure what your problem is, but you could try changing fonts (Settings->Editor).  If this issue only shows up when you print directly from Code::Blocks, you could try exporting as a PDF, and printing that.

Stuart R

Thanks Alpha, changing the font didn't change anything (other than the font of course!).  The output remains just like the jpg in the attached file. I can print directly and easily from gedit etc but would have found it easier to print from within c::b. I'm not sure whether it's related, but how do I export to PDF - I would have expected an Export under File but don't have that option.


oBFusCATed

Select a pdf printer, you should have it by default.

Does printing from Scite works correctly?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Stuart R

Now that seems to be helping. I installed Scite, loaded the same file and tried to print and got:

>a2ps "Game.cpp"
sh: 1: a2ps: not found
>Exit code: 127

Also - I don't seem to have a pdf printer (sceenshot attached).

While this obviously suggests that I need a2ps, do you know whether this indicates that a wider set of utilities is missing? Apologies if this is straying from c::b.

Alpha

Quote from: Stuart R on September 08, 2013, 07:35:58 PM
I'm not sure whether it's related, but how do I export to PDF - I would have expected an Export under File but don't have that option.
Although not related to your original problem, the Source Exporter plugin (from the contrib plugins package) provides that menu entry.

oBFusCATed

(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Stuart R

Thanks oBFusCATed and Alpha.  I've installed the codeblocks-contrib package which allows me to export the code in pdf (with no mangling). I also installed a2ps - Scite now works. I also installed the pdf printer from the link which will come in handy in the future but the output is just as mangled as before. I now have a reasonable work-around at least.

oBFusCATed

Another test you can do is to compile wxGTK-2.8 manually, go to the stc sample and try to print with it.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]