Rank: Newbie Groups: Member
Joined: 4/23/2012 Posts: 1
|
Hi,
I'm converting a url to PDF, using HtmlToPdf.ConverUrl. The BaseUrl is set to the hostname of my site. In the pdf the images are visible, but the custom font isn't formatting the text.
var opt = new HtmlToPdfOptions { BaseUrl = hostName, OutPutPageSize = PDFOptions.PageSize.A4, PageMargins = new[] { 0f, 0f, 0f, 0f }, AutoFitX = PDFOptions.AutoFitMode.ScaleToFit, AutoFitY = PDFOptions.AutoFitMode.ScaleToFit, URLToConvert = txtUrl.Text, AutoAdjustForDPI = true };
HtmlToPdfResult doc = HtmlToPdf.ConvertUrl(opt.URLToConvert, outputStream, opt); doc.PdfDocument.EmbedFont = true;
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
The font must be installed on the server and they must be TrueType font. You do not need to set BaseUrl when using ConvertUrl. When you use ConvertUrl, the BaseUrl is automatically derived from the Url you pass in.
Thanks!
|