I am trying to append text onto a PDF document using Aspose.Pdf for .NET following this tutorial on Aspose’s own website.
So far so good until this line:
TextFragment textFragment = new TextFragment("main text");
I have added Aspose.Pdf for .NET via NuGet and the following using statement:
using Aspose.Pdf;
My problem is that I can’t find the TextFragment class. Do I need to add another Aspose reference via NuGet, or is this a native .Net class somewhere else in the framework? I have ReSharper, and it hasn’t suggested adding any references. This is a .Net 4 Client Framework Console Application.
My name is Nayyer. I am working as a Support Developer/Technical Evangelist at Aspose.
Pleae note that TextFragment class is present under Aspose.Pdf.Text namespace. In order to reference it in your code, you may add the complete namespace reference i.e. using Aspose.Pdf.Text; or you can provide the complete class path such as Aspose.Pdf.Text.TextFragment. See the following code line
Aspose.Pdf.Text.TextFragment textFragment = new Aspose.Pdf.Text.TextFragment("main text");Please take a look over the following image which shows the suggestions from VisualStudio intellisense.
@JMK, Aspose.Words for .NET supports the feature to Create/Manipulate MS word documents and it also offers the feature to render Word files into PDF format. So for that reason, there are some classes such as PdfCompliance, PdfTextCompression, PdfPermissions etc but I am afraid PDF class is not present in Aspose.Words for .NET. In fact Pdf class is present under Aspose.Pdf.Generator namespace of Aspose.Pdf for .NET.