-
Notifications
You must be signed in to change notification settings - Fork 474
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to preserve formatting for CustomProperty value. #357
base: master
Are you sure you want to change the base?
Conversation
…serve formatting for CustomProperty value.
Hi EduardBlees, document.AddCustomProperty( new CustomProperty( "Formatted", $"First Line{Environment.NewLine}Second Line{Environment.NewLine}Third Line" ) ); Then displaying all the custom properties of the document with: showed the "Formatted" property value with the "\n" displayed in 3 lines. Thank you |
My bad, missed important detail in issue description - I already have a document that has some custom property, which value is inserted in a lot of places throughout the document. So, by calling AddCustomProperty with the same CustomProperty Name, I'm just updating its value, and Xceed.Document.NET.Document.UpdateCustomPropertyValue updating all insertions. In this scenario, it's very handy to have ability to preserve formatting in Xceed.Document.NET.Document.UpdateCustomPropertyValue. |
Hi, |
Hi, In example branch you can find DocumentSample.FormattedCustomProperties example. |
Hi, Thank you for you clear explanation. I will use your idea, but modify it to make all CustomProperties formattable. |
Issue:
Formatting in CustomProperty.Value wasn't preserved, because it's added as string value to xElement.
PR:
Parameter withFormatting to Xceed.Document.NET.Document.UpdateCustomPropertyValue method. When true, CustomProperty.Value is formatted using HelperFunctions.FormatInput.