Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Color code problem

New Here ,
Jan 27, 2020 Jan 27, 2020

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?

TOPICS
Feature request
1.9K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 27, 2020 Jan 27, 2020

What does "color" mean in this context?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 27, 2020 Jan 27, 2020

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

 
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 27, 2020 Jan 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.)

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 27, 2020 Jan 27, 2020

I take it from NotePad++ or VisualBasic. When I copy it to MS Word, I have no problem at all. I have the problem only with Framemakere. Here is an example of code.

Code example.jpg

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jan 28, 2020 Jan 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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 28, 2020 Jan 28, 2020

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jan 28, 2020 Jan 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 28, 2020 Jan 28, 2020

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 28, 2020 Jan 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 29, 2020 Jan 29, 2020
LATEST

No

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines