We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

ASPOSE PDF Generator class to be upgraded

Dear Sir,

We were using previous version of ASPOSE.Pdf now want to shift to latest version so doing code modifications for Generator class. Below is our current code for various type files. How this can be written in new version?

I am referring to this old post but it looks no more Aspose.Pdf.Image class

Pdf NullPdf = new Pdf();

static TextInfo CreateCustomTextInfo(string strFont, float fSize, AlignmentType alignment, bool IsBold)
{
TextInfo ti = new TextInfo();
ti.FontName = “Simsun”;
ti.FontSize = fSize;
ti.Alignment = alignment;
ti.IsTrueTypeFontBold = IsBold;
ti.IsUnicode = true;
ti.TruetypeFontFileName = IsBold ?
Properties.Settings.Default.FONTSBOLD : Properties.Settings.Default.FONTS;// “c:/windows/fonts/SIMSUN.ttc,0”;
return ti;
}

public void Append(string content)
{
Segment seg = new Segment(content);
itxt.Segments.Add(seg);
}

@weigang

The Aspose.Pdf.Generator is old generator and obsolete now. Please use new Aspose.PDF DOM approach. It is more improved and efficient. In new DOM approach, Page object is similar as Section in generator.

To work with text, please read following article.
Working with Text in PDF using C#