Trying to parse newline characters inPdfSharp in Powershell

Here is my function. I want to be able to pass \n to the Body parameter to create a line shift.
It does not seem to be working as is. I get a document created, but with a \n printed instead of creating a new line.

function Set-PDFDocument {
	<#
    .SYNOPSIS 
		Writes a pdf document
    .EXAMPLE
		Set-PDFDocument -Title "Title goes here" -Heading "This is the page header" -Filename "D:\pdfs\myFile.pdf" -Body "This is where the text goes." -PdfPluginPath "D:\PowerShellAddons\PdfSharp.dll"
	#>
	param(
		[alias("Title")] [Parameter(Mandatory=$True,Position=0)] [String] $strTitle,
		[alias("Heading")] [Parameter(Mandatory=$True,Position=1)] [String] $strHeading,
		[alias("Filename")] [Parameter(Mandatory=$True,Position=2)] [String] $strFilename,
		[alias("Body")] [Parameter(Mandatory=$True,Position=3)] [String] $strMessageBody,
		[alias("PdfPluginPath")] [Parameter(Mandatory=$True,Position=4)] [String] $strPdfSharpPath
	)
	Add-Type -Path $strPdfSharpPath
	$doc = New-Object PdfSharp.Pdf.PdfDocument
	$doc.Info.Title = $strTitle;
	$page = $doc.AddPage();
	$gfx = [PdfSharp.Drawing.XGraphics]::FromPdfPage($page)
	$tf = New-Object PdfSharp.Drawing.Layout.XTextFormatter($gfx);
	$fontHeader = New-Object PdfSharp.Drawing.XFont("Copperplate Gothic", 22, [PdfSharp.Drawing.XFontStyle]::Bold)
	$fontBody = New-Object PdfSharp.Drawing.XFont("Arial", 12, [PdfSharp.Drawing.XFontStyle]::Regular)
	$rectHeading = New-Object PdfSharp.Drawing.XRect(0,0,$page.Width, 50)
	$rectBody = New-Object PdfSharp.Drawing.XRect(0,51,$page.Width, $page.Height)
	$gfx.DrawString($strHeading, $fontHeader, [PdfSharp.Drawing.XBrushes]::Black, $rectHeading, [PdfSharp.Drawing.XStringFormats]::TopCenter)
	$tf.DrawString($strMessageBody, $fontBody, [PdfSharp.Drawing.XBrushes]::Black, $rectBody, [PdfSharp.Drawing.XStringFormats]::TopLeft)
	$doc.Save($strFilename);
}

Open in new window

LVL 2
itniflAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jeremy WeisingerSenior Network Consultant / EngineerCommented:
In powershell it is a backtick.

E.g
"Line one`nLine two"

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
itniflAuthor Commented:
Oh, offcourse it is. Thank you.
0
Jeremy WeisingerSenior Network Consultant / EngineerCommented:
No prob!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Powershell

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.