Howdy,
I hate to resurrect and old thread, but I'd rather do that than start a new that's really an extension of this one.
The advice about Alt-255 has gotten me further along -- thank you! -- but I am still losing white space in lines that, normally, are created as such:
Code:
longInfo = string.Format("{0,-25}{1,-15}{2,-8}{3,-8}{4,-7}{5,-5}{6,-5}{7,-10}{8,-5}{9,-7}{10,-7}{11,-20}{12,-25}{13,-8}{14,-100}{15}",
sInfo[0],sInfo[1],sInfo[2],sInfo[3],sInfo[4],sInfo[5],sInfo[6],sInfo[7],
sInfo[8],sInfo[9],sInfo[10],sInfo[11],sInfo[12],sInfo[13],sInfo[14],"\r\n");
Now, this is fine for the RTF documents that are produced, but the MigraDoc PDF output, of course, strips out the trailing spaces. I have tried:
Code:
longPDFInfo = sInfo[0].PadRight(25,' ') + sInfo[1].PadRight(15,' ') +
sInfo[2].PadRight(8,' ') + sInfo[3].PadRight(8,' ') + sInfo[4].PadRight(7,' ') +
sInfo[5].PadRight(5,' ') + sInfo[6].PadRight(5,' ') + sInfo[7].PadRight(10,' ') +
sInfo[8].PadRight(5,' ') + sInfo[9].PadRight(7,' ') + sInfo[10].PadRight(7,' ') +
sInfo[11].PadRight(20,' ') + sInfo[12].PadRight(25,' ') + sInfo[13].PadRight(8,' ') +
sInfo[14].PadRight(100,' ') + "\r\n";
Now this, to me, seems a touch cumbersome and there is probably a better way, however, for now, the issue is that the space that is in the .PadRight(xx,' ') is indeed an Alt-255 and I'm still getting text in the produced PDF with no trailing white spaces.
My question revolves around whether I need to make a specific call to the
PdfDocumentRenderer. I have tried both
Code:
PdfDocumentRenderer pdfRenderer = new PdfDocumentRenderer(true, PdfSharp.Pdf.PdfFontEmbedding.Always);
and with unicode set to false, and neither has output what I need. So, with my logic, it's either how I'm feeding it or what I'm telling it when it saves it out to the PDF. I am using monospaced fonts (either Quick Mono or Raavi) and both seem to support the Alt-255 spacing when I tested. So, I'm kind of at a loss. Any help would be greatly appreciated.
Phil