Hi,
I have a situation where I need to put in a fixed amount of space between words on occasion. For table of contents and such like this:
Chapter 1 12
Chapter 23 39
Any suggestions how to do this with any granularity? The space could be measured in inches, picas, millimeters, ems, etc, so it needs to be precise.
I've thought of trying to insert obscure unicode spacing characters according to this site: https://www.cs.tut.fi/~jkorpela/chars/spaces.html, but figured I ask here first before beating my head against the wall any more than I already have.
PS I'd like to avoid tracking X position and overlapping/fragmenting TextAreas if possible. But if that's the only way, then...
Thanks,
Aaron
Font em Width & Spacing
Re: Font em Width & Spacing
Support · Aug 11, 2015Hello Aaron,
You can set the spacing between words using empty space and add it to the PDF using TextArea page element of DynamicPDF API. Below is the code sample for it. There is no other way for setting spacing between words in page element.
Document document = new Document();
Page page = new Page();
//Adding text contetns to the TextArea including white space between words.
TextArea area = new TextArea("Chapter 1 12", 0, 10, 500, 30);
page.Elements.Add(area);
document.Pages.Add(page);
document.Draw(@"C:\Temp\MyDocument.pdf");
Also note that you will need to keep track of X ,Y positions accordingly to place the page elements on PDF page without overlapping of the contents.
Thanks,
ceTe Software Support Team.
Re: Font em Width & Spacing
Forum member · Aug 11, 2015I wish my problem was that easy. Thanks for your help.