I have an RDLC report created via Webforms.LocalReport that uses a few custom fonts that I have installed on my dev machine. This works well, and embeds the fonts in the PDF so that others don't need the font installed to view.
My problem is, when deploying to our production environment, there are a number of machines that may run the report. I don't want to have to install the font on each 'potential' machine - is there a way to attach the (.TTF) font file to the (VB.NET) solution, and have the font pulled from here, rather than from the local machine?
Hope this makes sense!!
If it helps, below is a sample of the code I'm using
Dim PDFfile As FileInfo
Dim deviceInfo As String = String.Empty
Dim PDF() As Byte
Dim reportParams As List(Of ReportParameter)
Using report As New LocalReport
' Set up report
' Report device information to create PDF with A4 sized pages
deviceInfo = "<DeviceInfo>" & _
" <OutputFormat>EMF</OutputFormat>" & _
" <Orientation>Portrait</Orientation>" & _
" <PageWidth>21cm</PageWidth>" & _
" <PageHeight>29.7cm</PageHeight>" & _
" <MarginTop>0cm</MarginTop>" & _
" <MarginLeft>0cm</MarginLeft>" & _
" <MarginRight>0cm</MarginRight>" & _
" <MarginBottom>0cm</MarginBottom>" & _
"</DeviceInfo>"
With report
.DisplayName = "Display Name"
report.ReportEmbeddedResource = "ReportName.rdlc"
' Add all necessary parameters
reportParams = New List(Of ReportParameter)
reportParams.Add(...)
.SetParameters(reportParams)
End With
PDF = report.Render("PDF", deviceInfo)
PDFfile = New FileInfo("C:\")
Using stream As FileStream = PDFfile.Create
stream.Write(PDF, 0, PDF.Length)
End Using
End Using
Thanks in advance!