Printing Source Code

I’ve read a few of the threads on the topic but still not quite what I was looking for, so here goes:

I’d like to be able to print the source code for a whole project into a plain text file.
I’ve set up a generic printer and tried printing to that but it prints out illegible characters, the entire file is only about 1k and not readable
I’ve installed a PDF printer but it seems that XOJO prints and ‘image’ of the code. So I am not able to select parts and paste into other XOJO projects

Anybody else have this one in the bag?

Dave has one that’ll print XML projects, and Arbed does binary projects.
Were those two solutions not what you were looking for?

If they were missing something, what are you looking for?

I downloaded the Arbed and briefly tried it and it’s HTML, I was looking for for plain old ASCII

RB use to do it, but it seems to have gone away

http://www.rdS.com/xjprint/index.html

Only supports VCP Michel

You did not mention you could not save as Xojo Code (Text).

Then I guess all you can do is select all and copy from the IDE, and paste into a text editor.

What’s wrong with HTML? You can select all, copy, and paste the HTML page into TextEdit in plain text mode if you’re heart set on clearing the formatting.

True Tim. This just seems overly complicated. Why doesn’t XOJO just output text files ie Save As

(just a few seconds behind!)

It does! You just need a full desktop license for version control format.

Ahh ok, well that ain’t gonna happen, not with the CDN->US exchange rate :0

Use Arbed, generate HTML and load it into a browser, then print from the browser ?

You can print all to PDF and then copy and paste from it. Or if you really want to, you can create your own side program that does this (i.e. takes the PDF output and converts it to text; you may be even able to script the whole thing).

[quote=304927:@Brent Eamer]I’ve read a few of the threads on the topic but still not quite what I was looking for, so here goes:

I’d like to be able to print the source code for a whole project into a plain text file.
I’ve set up a generic printer and tried printing to that but it prints out illegible characters, the entire file is only about 1k and not readable

I’ve installed a PDF printer but it seems that XOJO prints and ‘image’ of the code.
[/quote]
select everything in your project (or NOTHING which you can do by cmd-clikcing any selected items)
File > Print

[quote=304927:@Brent Eamer]So I am not able to select parts and paste into other XOJO projects
Anybody else have this one in the bag?[/quote]
Yeah just copy & paste items from one project to another
No need to go the route of printing to do that

Norman, In my minds eye, I was thinking of have one big ascii file open in one monitor and the current project I am working on in another. Rather than hopping between project windows and hunting and fishing for the cool way I did a certain thing. With the text file I can rapidly scroll up and down, text search, etc. Unless I need a paradigm shift and get to know the Xojo IDE a little better
I’ve written a pretty complex HL7 Generator for our e-health system and I’m finding myself to write something a tad different. So in a nutshell, if you think I can have two projects open and hop around…maybe I need to dust off my normalcy bias cap :slight_smile:
I know the old versions, ie) 2010 I use to be able to set up a generic printer, and print to an Ascii file. Just frustrated that functionality is gone now

This old dog is rather set in his ways.

@Langue, I tried that but when I selected the PDF it just selected the whole page as if it were an image, I was not able to select individual chunks of code

Do you have issues when you have two IDE windows open?
I frequently grab snippets from other projects I’ve worked on.

That’s because you installed a third party pdf printer. I don’t know if you’re on Mac, but Mac can make PDFs of anything you can print. If you Print to PDF from Xojo, the text is selectable.

Yeap. Windows (8 & 10) are the same way. And if you are using Acrobat or Primo it also comes out as text. Although I don’t think you can beat two IDE windows side-by-side (if it is just for copying).

We’ve done nothing to remove this that I can think of

But there is an issue thats already on the TO DO list where printing on Windows render as a gigantic graphic and NOT as selectable text from 2016r4 and 4.1

Brent:

Do not select any entry in the Navigator.

Print to PDF from the File Menu.

You will get a pdf file (with or without window image) that have the code as text. I was fortunate, two days before I made a test to answer your same question. THe generated PDF was on a different disk.

I followed that road last year after I lose by error a hard disk contents to recreate (update an old version) the original project.

That said, I believe you are running Windows (pre Windows 10). I never tested that in WIndows. Maybe your PDF creator does not do the same job as the macOS one.