Skip to main content
Participating Frequently
Jan 27, 2020 8:44 AM UTC
Question

Color code problem

I want to copy past code example made in C++ into Framemaker but when I do it, whatever the way used (importing from word, special paste, ...) the color code once copied in Framemaker is not respected compare to the source code and then it makes no sense anymore. someone has an idea as I tried all what I know?

This topic is closed to new replies. Start a new post to keep the conversation going.

10 replies

Participating Frequently
Jan 29, 2020 9:09 AM UTC

No

Translate
Inspiring
Jan 28, 2020 12:41 PM UTC

You can do this with Smart Paste.

But you will have to write your own XSLT for Smart Paste and add it to the relevant Structured Application.

Translate
Hezy A
Inspiring
Jan 28, 2020 9:58 AM UTC

Will making a screen capture of the code be helpful? 

I used this in the past, just to show the user what the code should look like.

Translate
Participating Frequently
Jan 28, 2020 11:54 AM UTC

Not possible in may case as I was the user to be able to copy past the examples

Translate
Klaus Göbel
Legend
Jan 28, 2020 8:11 AM UTC

I was trying to reproduce that.
I copied code from Notepad++ to Word, but there were no colors either.
What happens if you copy this code from Word and paste it into FrameMaker?

Translate
Participating Frequently
Jan 28, 2020 8:25 AM UTC

From Notepad++ to Word = No problem but from Notepad++ to Framemaker or from word to Framemaker, the colors change

Translate
Bob_Niland
Community Expert
Community Expert
Jan 27, 2020 12:19 PM UTC

What does "color" mean in this context?

Translate
Participating Frequently
Jan 27, 2020 12:39 PM UTC

By color I mean: green for a comment, orange for a value, ... Here is an example

 
Translate
Bob_Niland
Community Expert
Community Expert
Jan 27, 2020 7:52 PM UTC

No example visible.

What app is the colored code being copied out of?

If a C++ editor, chances are that editor is applying the colors only for the edit window, and is not exporting the colors in the metadata for copy\paste.

If the editor has the ability to export or print the prettified code, you may be able to grab it from that workflow.

 

Then the normal code issues arise: constant width fonts needs to be applied. Tabs need to be interpreted or replaced. Spaces need to be preserved. And whatever strategies are used has to be compatible with the ultimate document workflow (PDF, Ps, print, XML, HTML, eBook, etc.)

Translate