View previous topic :: View next topic |
Author |
Message |
tcruise7771
Joined: 12 Apr 2013 Posts: 24
|
Source printing? Export source to png?jpg? |
Posted: Thu Jun 20, 2013 8:43 am |
|
|
Hello i have program that i want to copy some of the fragments/parts of it into a .doc file and keeping the formatting and colors of the text. So far i have been doing such thing by making a print screen of the PIC C CCS window, but that takes too long time and it isnt very rational.
Is there some way for me to export the text with the formatting as a png/jpr or to a text file with formatting and colors ?
Thanks, and sorry if this question sounds noob. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19513
|
|
Posted: Thu Jun 20, 2013 9:21 am |
|
|
I'd probably try printing to a pdf file, assuming you have a 'virtual' printer that can support this setup. Make sure you tick the boxes 'syntax print', and 'print colours'. You can get it as an 'image' (but much bulkier), using ImagePrint as your output device.
Best Wishes |
|
|
tcruise7771
Joined: 12 Apr 2013 Posts: 24
|
|
Posted: Thu Jun 20, 2013 1:32 pm |
|
|
Ttelmah, your advice led me to the idea of choosing Microsoft XPS Document Writer and all text is saved with the formatting and colors.
Weirdly all the virtual pdf printers i found reported some kind of suspicious adware or potentionally unwanted app, anyway the XPS file copies fine to a doc.
Thanks for always being helpfull. |
|
|
jeremiah
Joined: 20 Jul 2010 Posts: 1349
|
|
Posted: Thu Jun 20, 2013 2:02 pm |
|
|
For pdf printing, I find cutepdf to be reliable, but you also need to install ghostscript for it to work (they provide a link on the webpage). No virus warnings from either AVG or Avast on my end.
One thing I do, is open the code in visual studio and copy/paste from there into word and that seems to work. There is a free version available at the microsoft website. It has a lot of limitations, but if all you need it is for grabbing text and copying, it is a fast way to do it as well. The downside to this method, is some CCS specific types/keyword don't always come out in color, but it hasn't been anything I cared a lot about. |
|
|
gpsmikey
Joined: 16 Nov 2010 Posts: 588 Location: Kirkland, WA
|
|
Posted: Thu Jun 20, 2013 2:25 pm |
|
|
One of my favorite tools for such things is "Snagit" by Techsmith. Very handy utility that allows you to grab any part of a screen etc and either save it as a file or simply paste it into something. No connection with them other than being a satisfied user for a number of years.
mikey _________________ mikey
-- you can't have too many gadgets or too much disk space !
old engineering saying: 1+1 = 3 for sufficiently large values of 1 or small values of 3 |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19513
|
|
Posted: Fri Jun 21, 2013 12:37 am |
|
|
Anyway, glad you got the output you needed. It is one of those 'not instinctively obvious' things in many applications, that the easiest way to get a reproduction of 'what you see, is to print to a virtual printer.
I've always had the Adobe pdf writer on systems, so no problems with adware.
Best Wishes |
|
|
tcruise7771
Joined: 12 Apr 2013 Posts: 24
|
|
Posted: Fri Jun 21, 2013 9:46 am |
|
|
From all the variants i found out the best was PDF. My initial idea was making too much mess of the document. The only problem of PDF is that for example #include <PIC16F877A.h> becomes < PIC16F877A . h >
Weirdly where the font is italic, for example // comments all is fine .... how great it had adition Word(with formatting) saving to all the cool tools it offers, thought i know value of such tool to the programmer is close to 0. |
|
|
|