Community

How to enable "background color" attribute when I export xml Answered

Hi,

I am using c# to recognize pictures and export the result using xml file. I need character color as well as background color in my project, so I tried to set XMLExportParams.WriteCharFormatting to true and XMLExportParams.WriteCharAttributes to XMLCharAttributesEnum.XCA_Extended. However, I can only get font color in this case, and I have tried ohter XMLExportParams but in my exported XMLs, I still cannot get background color attribute. How can I set them in my program to get it (background color of line/word/etc)? Thanks in advance.

0

Comments

3 comments

  • Avatar
    Oksana Serdyuk

    Sorry for the delay in the response. I am consulting with the developers concerning your request and I will return with any news as soon as possible.

    0
  • Avatar
    Oksana Serdyuk

    I am extremely sorry for a long silence. Unfortunately, the determination of a background color for the XML export format is not supported anymore. The documentation will be updated in the next release of the program.

    As to possible workaround, you can extract a background color via API:

    • you can either use the GetTextBackgroundColor method of the ImageDocument object;
    • or after the synthesis stage has been performed, the BackgroundColor properties of the Block and ParagraphParams objects become meaningful. And you can use them to get a background color for a single block or a paragraph correspondingly.
    1
  • Avatar
    okaizi

    Thank you so much for the reply!

    0

Please sign in to leave a comment.