PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sat Apr 27, 2024 12:43 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 12 posts ] 
Author Message
PostPosted: Thu Feb 18, 2010 5:18 pm 
Offline

Joined: Thu Feb 18, 2010 5:08 pm
Posts: 13
I would like to add a little bit of Horizontal Spacing to the Style definitions of my document Headings.
Something like: style.ParagraphFormat.HorizSpace = 3;
In this way each Heading could have its own Horizontal Space from the Left.

How can this be done with Migradoc?


Top
 Profile  
Reply with quote  
PostPosted: Mon Feb 22, 2010 8:44 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3096
Location: Cologne, Germany
Horizontal space is at top and bottom, vertical space is left and right.

To get a default style:
Code:
Style style = Document.Styles[StyleNames.Heading1];
style.ParagraphFormat.SpaceBefore = 2;
style.ParagraphFormat.SpaceAfter = 2;

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Mon Feb 22, 2010 1:23 pm 
Offline

Joined: Thu Feb 18, 2010 5:08 pm
Posts: 13
Horizontal Spacing if Left/Right like Horizontal Tabs.

How do I add Horizontal Spacing (Left/Right) to Headings?


Top
 Profile  
Reply with quote  
PostPosted: Tue Feb 23, 2010 9:09 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3096
Location: Cologne, Germany
Use LeftIndent, RightIndent, and FirstLineIndent.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Tue Feb 23, 2010 1:33 pm 
Offline

Joined: Thu Feb 18, 2010 5:08 pm
Posts: 13
Can these be used in Headings?

What doe the code look like?


Top
 Profile  
Reply with quote  
PostPosted: Tue Feb 23, 2010 2:01 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3096
Location: Cologne, Germany
Code:
Style style = Document.Styles[StyleNames.Heading1];
style.ParagraphFormat.SpaceBefore = 2;
style.ParagraphFormat.SpaceAfter = 2;
style.ParagraphFormat.FirstLineIndent = "4mm";
style.ParagraphFormat.LeftIndent = "2.5cm";
style.ParagraphFormat.RightIndent = "30mm";

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Tue Feb 23, 2010 2:12 pm 
Offline

Joined: Thu Feb 18, 2010 5:08 pm
Posts: 13
Does LeftIndent, RightIndent, and FirstLineIndent provide Horizontal Spacing in the Heading or in the Text paragraph that follows the Heading?

How can I provide Horizontal Spacing in the Heading ?


Top
 Profile  
Reply with quote  
PostPosted: Tue Feb 23, 2010 2:47 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3096
Location: Cologne, Germany
dbaechtel wrote:
Does LeftIndent, RightIndent, and FirstLineIndent provide Horizontal Spacing in the Heading or in the Text paragraph that follows the Heading?


They provide space in the paragraph where they are used. Just like the similar settings you have e. g. in Word and other word processors.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Tue Feb 23, 2010 2:56 pm 
Offline

Joined: Thu Feb 18, 2010 5:08 pm
Posts: 13
How can I provide Horizontal Spacing in the Heading ?


Top
 Profile  
Reply with quote  
PostPosted: Tue Feb 23, 2010 4:29 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3096
Location: Cologne, Germany
Use LeftIndent, RightIndent, and FirstLineIndent.

Are you talking about the Heading styles or the page Header?

Either way: you have a paragraph and can set LeftIndent, RightIndent, and FirstLineIndent.

Code:
style = styles[StyleNames.Header];
style.ParagraphFormat.SpaceAfter = 12;
style.ParagraphFormat.FirstLineIndent = 0;
style.ParagraphFormat.LeftIndent = 0;
style.ParagraphFormat.RightIndent = "30mm";

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Tue Feb 23, 2010 7:57 pm 
Offline

Joined: Thu Feb 18, 2010 5:08 pm
Posts: 13
You said that LeftIndent, RightIndent, and FirstLineIndent "provide space in the paragraph where they are used".

The Heading line is not a paragraph, is it?

It the Heading lin is not a paragraph, how do I provide Horizontal Spacing in the Heading line?


Top
 Profile  
Reply with quote  
PostPosted: Wed Feb 24, 2010 10:02 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3096
Location: Cologne, Germany
A Heading is a paragraph.
A Header contains paragraphs. LeftIndent works for Headings and for paragraphs in Headers.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 387 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group