Private Sub TextToPdf(m As Map)
Dim pdf As cPDF
'initialize with mm unit
pdf.Initialize("mm")
'set properties
pdf.sProperty(pdf.PropertyAuthor,"spsp"). _
sProperty(pdf.PropertyTitle,m.Get("ms_gpt_01_05").As(String).Trim). _
sProperty(pdf.PropertyKeywords,"B4X,PDF,Cross platform")
'add a page
pdf.pageAdd(pdf.pageSizeA4PortraitWidth,pdf.pageSizeA4PortraitHeight)
'set current position 10mm from the left, 287mm from the bottom
pdf.sX(10).sY(287)
Dim s As String
s=m.Get("ms_gpt_01_05").As(String).Replace(" ",Chr(32)).Replace(Chr(34),"").Trim
Log(s)
pdf.sFont(pdf.fontHelvetica,pdf.fontNormal,14,pdf.colorBlack)
pdf.outtextflow(10,200,pdf.AlignCenter,s)
'save to file with compression if data compressed are smaller
savePDF(pdf,"test.pdf",pdf.CompressAlways)
'open with default viewer
openPDF("test.pdf")
End Sub