PB IDE Plugin : Print colored sources from IDE

Applications, Games, Tools, User libs and useful stuff coded in PureBasic
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

PB IDE Plugin : Print colored sources from IDE

Post by Flype »

PureBasicPrint, a PureBasic IDE Tool for printing colored .PB files

This program is a tool to print colored source codes from the IDE.
You can easily add it to the ToolMenu and/or the ToolBar 8)

PureBasicPrint is nearly finished, so it is proposed here as a beta.

Download

Beta 1 : http://dl.free.fr/tOFlxLTL5
Beta 2 : http://dl.free.fr/oDx1fPTeZ

August Release (Source code provided) : http://dl.free.fr/gLxnfOf1k


PDF Sheet

http://dl.free.fr/mZiW3BHq1

Example of output sheets

http://dl.free.fr/r8Sn82RQl

PureBasicPrint is more or less inspired by these posts

http://www.purebasic.fr/english/viewtopic.php?t=17127
http://www.purebasic.fr/english/viewtopic.php?t=19876
http://www.purebasic.fr/german/viewtopic.php?t=5159


Image


PureBasicPrint output using a virtual printer (PDFCreator)

Image


Roadmap

Code: Select all

; 
; TODO :
; 
; [ ] Add       : Implements Line Spacing.
; [ ] Add       : Graphical User Interface (?).
; [ ] Add       : Installer (Copy files, ToolMenu, ToolBar, Shortcuts).
; [ ] Add       : Do not prints IDE Options at the bottom of the .PB file.
; [x] Add       : [ADDED] Better language support (English, Deutsch, Francais, Spanish).
; [ ] Add       : Linux/MacOS Compatible.
;                 Should be but the Syntax Hilighting SDK 
;                 is not available on Linux/MacOS at the moment.
; 
; [ ] Optimize  : Some redundant calculations can be optimized.
; [ ] Optimize  : Read IDE Options starting from end of .PB file.
;                 This should increase a bit the loading part especially with big files.
; 
; [ ] Known Bug : Line Wrapping do not works on large comments at the moment.
; [x] Known Bug : [FIXED] Color mistake when wrapping a line which is inside %CURSOR.
; [x] Known Bug : [FIXED] PageBreaks were processed even if outside of the %SELECTION.
; [x] Known Bug : [FIXED] Some problems with non-fixed fonts (line numbers).
; 


:)
Last edited by Flype on Thu Aug 27, 2009 1:24 pm, edited 12 times in total.
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
User avatar
Jacobus
Enthusiast
Enthusiast
Posts: 139
Joined: Wed Nov 16, 2005 7:51 pm
Location: France
Contact:

Post by Jacobus »

It is a magnificent work. Thank you for it Flype. :)
But the usefulness seems me limited to a programmer code changes almost constantly. This will do the quantities of printed pages to keep up-to-date. However, for a backup of the rights and keep the paternity of source code, why not. It only remains that you do there a sacred job, yet bravo! :wink:
PureBasicien tu es, PureBasicien tu resteras.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Looks great Flype - some excellent work.

Thanks. 8)
I may look like a mule, but I'm not a complete ass.
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

Post by Flype »

Thank you jacobus and srod.

It's still work in progress and there are some bugs.

If someones can quickly help me, I need to know :

Bytes -> Translation for Francais -> Octets
Bytes -> Translation for Deutsch -> Bytes :?:
Bytes -> Translation for Spanish -> Octetos :?:

FormatDate() for English -> YYYY-MM-DD
FormatDate() for Francais -> DD-MM-YYYY
FormatDate() for Deutsch -> YYYY-MM-DD :?:
FormatDate() for Spanish -> YYYY-MM-DD :?:
Last edited by Flype on Sun Aug 02, 2009 1:26 pm, edited 3 times in total.
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

Post by Flype »

Jacobus wrote:But the usefulness seems me limited to a programmer code changes almost constantly.
This will do the quantities of printed pages to keep up-to-date.
However, for a backup of the rights and keep the paternity of source code, why not.
Yes of course, printing 50 pages of PB codes is more wasting paper than useful.
But i think, it is especially useful for me when i print just a little part (some procedures, some importants routines) of the source code using %SELECTION argument.
And then i read it at lunch, in train, where i do not have computer but wanted to check/annotate some parts of my code.
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
walker
Enthusiast
Enthusiast
Posts: 634
Joined: Wed May 05, 2004 4:04 pm
Location: Germany

Post by walker »

Flype wrote: Bytes -> Translation for Deutsch -> Bytes

FormatDate() for Deutsch -> DD-MM-YYYY
that's it for german... If you need further help.....let me know :)
we use the english word for bytes too and the date is formated usually as in french :wink:
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Post by ts-soft »

For Germany you can use: DD.MM.YYYY or the international Form YYYY-MM-DD
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

Post by Flype »

thanks guy :wink:

and for 'Page X' ? should be 'Seite'...
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
walker
Enthusiast
Enthusiast
Posts: 634
Joined: Wed May 05, 2004 4:04 pm
Location: Germany

Post by walker »

yes... that's correct
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

Post by Flype »

Beta 2 - See 1rst post.

Code: Select all

; [x] Add       : [ADDED] Better language support (English, Deutsch, Francais, Spanish).
; [x] Known Bug : [FIXED] Color mistake when wrapping a line which is inside %CURSOR.
; [x] Known Bug : [FIXED] PageBreaks were processed even if outside of the %SELECTION.
; [x] Known Bug : [FIXED] Some problems with non-fixed fonts (line numbers). 
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

Post by Flype »

First post updated.

August Release with Source code provided

http://dl.free.fr/gLxnfOf1k

-------------

QUICK GUIDE

Feel free to do what you want with this package.
It's a PureBasic communauty gift.

-------------

If you want to test this package,


You'll need :


1/ PureBasic 4.3+
2/ Open "PureBasicPrint.pb"
3/ Go to compiler options -> executable arguments
4/ "PureBasicPrint.pb" MAGNIFICATION=1.5 COLORMODE=IDE PAGEBREAKS=1
5/ Read the PureBasicPrint.PDF sheet to learn more


-------------

Supported Command Line Arguments :

Parameter: "%FILE"
Parameter: "%TEMPFILE"

Parameter: CURSOR=%CURSOR
Parameter: SELECTION=%SELECTION

Parameter: REQUESTER=0|1
Parameter: PAGEBREAKS=0|1
Parameter: MAGNIFICATION=3
Parameter: MARGINS=LEFTxRIGHTxTOPxBOTTOM
Parameter: COLORMODE=IDE|IDEONWHITE|BLACKONWHITE

-------------

PureBasic IDE TOOL - Example of command line argument :

"%FILE" "%TEMPFILE" CURSOR=%CURSOR SELECTION=%SELECTION MAGNIFICATION=3 PAGEBREAKS=1 COLORMODE=IDE MARGINS=80x80x80x80

-------------
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
User avatar
flaith
Enthusiast
Enthusiast
Posts: 704
Joined: Mon Apr 25, 2005 9:28 pm
Location: $300:20 58 FC 60 - Rennes
Contact:

Post by flaith »

:D Nice one Flype, but just a little suggestion: my background's IDE colour is gray, and when i print my code, a lot of ink is used :?
I know source code is provided, but there is a lot of code to read :wink:
And what about a requester before printing ? (i know it's almost in your todo list)

Thanks :wink:
“Fear is a reaction. Courage is a decision.” - WC
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

Post by Flype »

flaith wrote::D Nice one Flype, but just a little suggestion: my background's IDE colour is gray, and when i print my code, a lot of ink is used :?
I know source code is provided, but there is a lot of code to read :wink:
And what about a requester before printing ? (i know it's almost in your todo list)

Thanks :wink:
Hi flaith,

Both requested features are yet implemented.


my background's IDE colour is gray
--> use COLORMODE=IDEONWHITE inside the command line argument.


requester before printing
--> use REQUESTER=1 inside the command line argument.


from previous post :
5/ Read the PureBasicPrint.PDF sheet to learn more


:wink:
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
User avatar
flaith
Enthusiast
Enthusiast
Posts: 704
Joined: Mon Apr 25, 2005 9:28 pm
Location: $300:20 58 FC 60 - Rennes
Contact:

Post by flaith »

Flype wrote:Hi flaith,

Both requested features are yet implemented.

my background's IDE colour is gray
--> use COLORMODE=IDEONWHITE inside the command line argument.

requester before printing
--> use REQUESTER=1 inside the command line argument.

from previous post :
5/ Read the PureBasicPrint.PDF sheet to learn more

:wink:
:lol: As usual, i really need to read more precisely, reading in diagonal is not the best way - Sorry Flype and thanks for answer me :D
“Fear is a reaction. Courage is a decision.” - WC
akj
Enthusiast
Enthusiast
Posts: 668
Joined: Mon Jun 09, 2003 10:08 pm
Location: Nottingham

Post by akj »

@Flype:

I am having trouble downloading your PureBasicPrint source code and .PDF file [perhaps due to a problem I'm currently experiencing of finding it impossible to enable cookies on my PC - possibly a virus].

Is there any other location from which I can download your source code and .PDF file. Alternatively could you provide them to me via a private message?

Thanks
Anthony Jordan
Post Reply