Skip to main content
Participating Frequently
January 27, 2020
Question

Color code problem

  • January 27, 2020
  • 5 replies
  • 1853 views

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 has been closed for replies.

5 replies

Participating Frequently
January 29, 2020

No

Inspiring
January 28, 2020

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.

Hezy A
Inspiring
January 28, 2020

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.

Participating Frequently
January 28, 2020

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

Klaus Göbel
Legend
January 28, 2020

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?

Participating Frequently
January 28, 2020

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

Bob_Niland
Community Expert
Community Expert
January 27, 2020

What does "color" mean in this context?

Participating Frequently
January 27, 2020

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

 
Bob_Niland
Community Expert
Community Expert
January 27, 2020

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.)