Welcome Guest Search | Active Topics | Sign In | Register

pdf fonts Options
sometimes
Posted: Monday, April 23, 2012 1:27:56 PM
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;

eo_support
Posted: Monday, April 23, 2012 1:36:02 PM
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!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.