Copying syntax highlighted code to Word/Outlook/Browser?

This forum is user-to-user based and not regularly monitored by IDM.
Please see the note at the top of this page on how to contact IDM.

Copying syntax highlighted code to Word/Outlook/Browser?

Postby neil » Thu Aug 26, 2004 9:54 pm

Is there a way to get UltraEdits syntax highlighting into a Word document?

Thanks.
User avatar
neil
Newbie
 
Posts: 5
Joined: Wed Aug 25, 2004 11:00 pm
Location: ireland

Re: Copying syntax highlighted code to Word/Outlook/Browser?

Postby rstewart » Fri Sep 10, 2004 3:02 pm

Using syntax highlighting to assist in reading Cobol files. Works great.

Can even print in color.......even better, however I need to take this one step further and copy the code into MS Word while retaining the syntax highlights.

Can this be done?
User avatar
rstewart
Newbie
 
Posts: 1
Joined: Thu Sep 09, 2004 11:00 pm

Re: Copying syntax highlighted code to Word/Outlook/Browser?

Postby Manni » Mon Sep 13, 2004 2:03 pm

If you absolutely need such a feature, I suggest you look at some printer and pseudo-printer drivers. After all, UEdit can _print_ the syntax highlighting. E.g., you could use the driver of a Postscript printer and print to file. Of course, that still wouldn't be usable in Word, but there might be similar options or a converter program (ps2rtf?).

Manni
User avatar
Manni
Advanced User
Advanced User
 
Posts: 58
Joined: Thu Jul 15, 2004 11:00 pm
Location: Europe

Re: Copying syntax highlighted code to Word/Outlook/Browser?

Postby neil » Wed Feb 09, 2005 9:25 pm

Is this found in any of the new features of recent UE versions? If not, is it even planned?
User avatar
neil
Newbie
 
Posts: 5
Joined: Wed Aug 25, 2004 11:00 pm
Location: ireland

Re: Copying syntax highlighted code to Word/Outlook/Browser?

Postby pbleyer » Fri Feb 11, 2005 4:03 pm

When I need small chunks of highlighted code to include in a document I print the file to a PDF (with 'Print Syntax Highlighting' on, of course), open the file in Acrobat reader, copy the text and then paste it in Word or OpenOffice or whatever application that accepts formatted RTF text from the clipboard (sometimes available as 'Paste special'). However you usually lost your indentation. :?

To print to a PDF I use Ghostscript with RedMon. Works like a charm.

Perhaps the UE team could add an 'Export to HTML' or a 'Copy special' option to avoid all the hassle. It shouldn't be difficult since the color and indentation information is already there.

Cheers.
User avatar
pbleyer
Newbie
 
Posts: 1
Joined: Mon Jul 19, 2004 11:00 pm

Re: Copying syntax highlighted code to Word/Outlook/Browser?

Postby neil » Fri Feb 11, 2005 5:11 pm

Thanks alot pbleyer, seems like the best option and will try it soon, just had a few beers in me at the mo so I'd probably mess somethin up.
User avatar
neil
Newbie
 
Posts: 5
Joined: Wed Aug 25, 2004 11:00 pm
Location: ireland

Re: Copying syntax highlighted code to Word/Outlook/Browser?

Postby neil » Sat Feb 12, 2005 6:19 pm

Can anyone tell me how that ghostscript/redmon technique works? Any decent tutorials?
User avatar
neil
Newbie
 
Posts: 5
Joined: Wed Aug 25, 2004 11:00 pm
Location: ireland

Re: Copying syntax highlighted code to Word/Outlook/Browser?

Postby neil » Tue Feb 15, 2005 7:20 pm

illico wrote:( I supposed copy from the Acrobat output print pdf file)

Do you know how to do what pbleyer was illustrating before with ghostwrite and redmon?

Cause I'd really like to see somekind of guide to operate this, as their readme doesn't say an awful lot.
User avatar
neil
Newbie
 
Posts: 5
Joined: Wed Aug 25, 2004 11:00 pm
Location: ireland

Re: Copying syntax highlighted code to Word/Outlook/Browser?

Postby illico » Wed Feb 16, 2005 3:14 am

You can use Acrobat Writer to create PDF file.
But you can find many free software : CutePDF, PDF995, PDF4free...

You can also use as "pbleyer" the ghostscript and Redmon tools.
There were many tutorials for install and use them in the web:
http://kenchiro.tripod.com/howtoPDF.html
http://sebsauvage.net/pdf/pdfgratuit.pdf in french
http://www.tutoriels.com/imprimer.php?type=1&id=20 in french
http://www.stat.tamu.edu/~henrik/GSPSprinter/GSPSprinter.html
http://www.cs.wisc.edu/~ghost/
User avatar
illico
Basic User
Basic User
 
Posts: 12
Joined: Thu Oct 14, 2004 11:00 pm
Location: FRANCE

Re: Copying syntax highlighted code to Word/Outlook/Browser?

Postby theansweris_42 » Wed May 11, 2005 4:50 am

Hi all!
I love this syntax highlighting of UE, and it would be great e.g. for documentation purposes to be able to keep the colours when copying text passages from UE to Word or any other program.
In the VIM editor you can save highlighted text as HTML and insert that to Word, which would be fine as well.

:?: Has anyone an idea how to bring the coloured syntax to any HTML-able program?
Any other than doing screenshots, and more comfortable than printing to file as PS, converting to PDF and copying the text to Word...
User avatar
theansweris_42
Newbie
 
Posts: 1
Joined: Tue May 10, 2005 11:00 pm

Re: Copying syntax highlighted code to Word/Outlook/Browser?

Postby Mofi » Sun May 22, 2005 10:21 am

Not really. The best method at the moment is to use a printer driver, which can ouput RTF or XPS files, for example:

LEADTOOLS ePrint printer driver
Microsoft XPS Document Writer
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 3936
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: Copying syntax highlighted code to Word/Outlook/Browser?

Postby tomrausch » Fri May 19, 2006 6:54 pm

To print UltraEdit code to a PDF in color, try CutePDF (http://www.cutepdf.com). It is free.
User avatar
tomrausch
Newbie
 
Posts: 1
Joined: Thu Jul 22, 2004 11:00 pm
Location: Long Grove, IL

Re: Copying syntax highlighted code to Word/Outlook/Browser?

Postby bsvee » Thu Sep 20, 2007 2:24 pm

When I copy Java code out of editors like Eclipse and IDEA and paste it into Word the colors go with it. I do this all the time while producing design documentation. I can paste XML from UltraEdit into Eclipse and then copy it out of Eclipse and into Word but this is a pain. I think a Copy With Syntax Color option on the Edit menu would be a reasonable and useful feature to add.
User avatar
bsvee
Newbie
 
Posts: 1
Joined: Wed Sep 19, 2007 11:00 pm

Re: Copying syntax highlighted code to Word/Outlook/Browser?

Postby ugar_k » Thu Sep 27, 2007 10:50 pm

UltraEdit does not currently support the feature of being able to copy and paste syntax highlighting, however, I ran across this utility for Visual Studio and wondered if this could be a similar solution for UltraEdit:

http://www.jtleigh.com/CopySourceAsHtml

"Code is exponentially more readable when certain parts of that code are differentiated from the rest by using a different color text. Reading code in Visual Studio is generally much easier than trying to read code in an editor like Notepad.

Chances are you may have your own blog by now, or at least have spent some time reading them. Normally, when you try to post a cool code snippet to your blog it ends up being plain old text, which isn't the easiest thing to read. This is where the CopySourceAsHTML add-in comes in to play. This add-in allows you to copy code as HTML, meaning you can easily post it to your blog or Web site and retain the coloring applied through Visual Studio."
User avatar
ugar_k
Newbie
 
Posts: 1
Joined: Wed Sep 26, 2007 11:00 pm

Re: Copying syntax highlighted code to Word/Outlook/Browser?

Postby Jane_S » Sun Sep 30, 2007 4:29 pm

I'd like to support ugar_k's suggestion. The other methods suggested are ingenious, but not really a long term solution...
User avatar
Jane_S
Newbie
 
Posts: 1
Joined: Tue Jul 17, 2007 11:00 pm

Next

Return to UltraEdit General Discussion