How to indent with TTMSFNCWXDocx

Hi,
Couldn't find possibility to indent paragraph with TTMSFNCWXDocx. Is it there?
docx.js should support it

Hi,

This is not yet supported in the component. We will consider adding this to a future version when we can allocate some time.

OK, i managed to add robust implementation myself, so i can have my document generated.

btw. I was wondering last Friday would it be possible to create word with delphi directly and googled it.
First hit. TMS. Of course :smiley: Thanks. (just wondering that whow an earth I have missed that)

1 Like

Another question,
how should paragraph borders be used.
I tried this and it didn' work.

     para.Border.Borders :=  [boBottom];
     para.Border.Bottom.Value := bsThick;
     para.Border.Bottom.Space := 1;
     para.Border.Bottom.Size:=6;
     para.Border.Bottom.Color := 'auto';

Hi, i added your code to the advanced demo and it seems to work just fine on my machine. Could you provide some more insight on your code. This is the code snippet that i used

 Paragraph := Section.AddParagraph;
  Paragraph.Heading := hlHeading1;
  Paragraph.Alignment := taLeft;
  Paragraph.AddText('Invoice');
  Paragraph.Border.Borders :=  [boBottom];
  Paragraph.Border.Bottom.Value := bsThick;
  Paragraph.Border.Bottom.Space := 1;
  Paragraph.Border.Bottom.Size:=6;
  Paragraph.Border.Bottom.Color := 'auto';

which generates this segment:

I'll check today, thanks

It worked from demo on my machine also. After ripping my hairs of my head, I noticed that one difference in demo generated paragraph was that it had also heading.
So after I added heading to document title it started to work (required only para.Heading := hlTitle; to title)

kuva

me happy :slight_smile:

demo

new docx.Paragraph({alignment: docx.AlignmentType.LEFT, 
heading: docx.HeadingLevel.HEADING_1, 
border: {bottom: {color: "auto", space: 1, value: docx.BorderStyle.THICK, size: 6}}, 
shading: {type: docx.ShadingType.CLEAR},                       
spacing: {lineRule: docx.LineRuleType.AT_LEAST}, 
outlineLevel: 0, 
children: [new docx.TextRun({ text:"Invoice, font: "Segoe UI", size: 24, color: "#000000", shading: {type: docx.ShadingType.CLEAR} }),]})

mine

new docx.Paragraph({alignment: docx.AlignmentType.LEFT, 
border: {bottom: {color: "auto", space: 1, value: docx.BorderStyle.THICK, size: 6}}, 
shading: {type: docx.ShadingType.CLEAR}, 
indent: {left: 1440}, 
spacing: {lineRule: docx.LineRuleType.AT_LEAST}, 
outlineLevel: 0, 
children: [new docx.TextRun({ text:"[KEH-3818]  Kassaan tositeselaukseen hinnaton A4-lähete -nappi | Priceless referral button in WKassa receipt browsing", font: "Segoe UI", size: 22, color: "#000000", bold: true, shading: {type: docx.ShadingType.CLEAR} }),]})

Deleting the heading line doesn't affect the border here, so it should work without setting a heading. Could you provide a full code snippet of this paragraph so we can test this further here?

Let me check, if I can isolate it from my versio history report app ...

Don't know what I have done but now I can't repeat the error. :face_with_raised_eyebrow:
I get borders all the time when I need it