开发者

formatted PHP code in Microsoft Word

I would like to save my php code from nusphere phped colour coded to mi开发者_开发问答crosoft word. How can I do that?


i know one way.

open this page: http://qbnz.com/highlighter/demo.php

the above link is the php syntax highlighter on web,

(1) copy and paste your php code to the text area labelled 'Input via a text field:'

(2) go to the 'Options' selectbox below that text area, and choose 'Line numbers: none'

(3) click the 'Highlight!' button at the bottom of the page

(4) the highlighted php code will be shown

(5) select, copy this highlighted code, and paste it into Word. u will see the colored code in your Word document

those' are the detailed steps

hope this may help


Take a look at this post here: How do you display code snippets in MS Word preserving format and syntax highlighting?

I'm not sure you can do it from that specific IDE, maybe there is a plugin for it. However, this question has been asked before.


Your color formatting will not carry over. You have a choice, Take a screen shot and paste it as an image (making it un-editable) or lose your color coding and have something functional just not pretty.


Try to use this: http://php.net/manual/en/function.highlight-file.php It should copy over.


nusphere doesn't retain the colour coding data in copy+paste. Nor do most (any) other IDEs.

You might find some luck pasting the code into an online site that does colour coding, and then using copy+paste from there, since it'll have been generated into static HTML, which will retain the colour coding when you copy+paste.

The question form in this very site would be an example of a site that works that way, although I wouldn't suggest pasting code here just to paste them into Word -- it won't make you popular around here! ;) But there are other sites that may be better suited to that, or you could grab a freeware web app that does it and host it locally for your own use.


A simple way to accomplish this to copy your source into a syntax highlighter on line such as http://www.tohtml.com/ and then produce the html based highlighting, when you copy the highlighted text from the html page word will read and understand the colours.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜