Add "Style" tag to Doc Composer

Rather than having a “style” attribute in selected tags, I would like to see a “Style” tag, independent of them, with some additional features.

The reason I’m asking for this is that I’ve run into a problem with the “Image” tag when generating a Word document: the image and the paragraph break I put after it use the “Normal” style, but for my document I have a custom style I would like to apply to image-based paragraphs. Also, when mixing “Text” and “Property” tags, it can be tedious to repeat the style when composing a template. What I’d like to see is something like this:

<Style name="My Custom Style" alignment="center" bold="true">
  <Text>The diagram name is: </Text>
  <Property property="name"/>
  <ParagraphBreak/>
  <Image/>
  <ParagraphBreak/>
</Style>

Hi KDean,

Sounds like a way to improve the reusability of Styles’ definition. I have shared your suggestion with our development team. If we decide to support it, I will let you know.

Best regards,
Jick Yeung

Hi KDean,

I am glad to inform you that Visual Paradigm 17.0 is out. It supports defining style element like this:

<ParagraphStyle name="Title">
	<Property property="name"/>
	<ParagraphBreak/>
	<Image/>
	<ParagraphBreak/>
</ParagraphStyle>

With this code, ‘Title’ style will be applied to the value of the name and the image.

Best regards,
Jick Yeung

Wonderful! I’ll update my custom templates and let you now how it goes!

Alright… good start, but not enough, and not working properly anyway.

The Text and Property elements support the following attributes:

  • style
  • isBold
  • isItalic
  • isUnderline
  • fontFamily
  • fontSize
  • foreColor
  • alignment
  • numberingLevel
  • margin
  • margin-top
  • margin-right
  • margin-bottom
  • margin-left
  • keepWithNext

It should be possible to use all of these in the ParagraphStyle element. I just tried name+isBold, but isBold isn’t supported. I should be able to use ParagraphStyle without a name if I’m using the others to set the output style.

As for the “not working” part, here’s my custom image template:

<?xml version="1.0" encoding="UTF-8"?>
<AnyBaseInitiationBlock>
	<ParagraphStyle name="GS1_Body">
		<Image alignment="center" maxWidth="28000"/>
		<ParagraphBreak/>
		
		<HasValueChecker property="description">
			<Text>Description: </Text><Property property="description"/>
			<ParagraphBreak/>
		</HasValueChecker>
	</ParagraphStyle>
</AnyBaseInitiationBlock>

The image comes out with the GS1_Body style and is centred, but the text comes out with the Normal style.

Nope. Totally broken. Some of my image/description combinations come out with the right GS1_Body style, some come out with the Normal style. I’ve tried the following with totally inconsistent results:

<?xml version="1.0" encoding="UTF-8"?>
<AnyBaseInitiationBlock>
	<ParagraphStyle name="GS1_Body">
		<Image alignment="center" maxWidth="28000"/>
		<ParagraphBreak/>
	</ParagraphStyle>
		
	<ParagraphStyle name="GS1_Body">
		<HasValueChecker property="description">
			<Property property="description"/>
			<ParagraphBreak/>
		</HasValueChecker>
	</ParagraphStyle>
</AnyBaseInitiationBlock>

and

<?xml version="1.0" encoding="UTF-8"?>
<AnyBaseInitiationBlock>
	<ParagraphStyle name="GS1_Body">
		<Image alignment="center" maxWidth="28000"/>
		<ParagraphBreak/>
	</ParagraphStyle>
		
	<HasValueChecker property="description">
		<Text style="GS1_Body">Description: </Text><Property property="description" style="GS1_Body"/>
		<ParagraphBreak/>
	</HasValueChecker>
</AnyBaseInitiationBlock>

The ParagraphStyle element is unusable right now.

Im facing similar problems here. At the moment all my header formating is gone and neither “relative” identification of an header element via @header+ nor the absolute naming of an header does work in my word doc template