i am using Aspose.pdf for .Net 4.0 - version 24.2.0.0 (Evaluation version)
There are some issues i have idendified.
- Some words are getting overlapped.
- Only few words are converted to specific font(is this due to Evaluation version)
- is it possible to change the font with different font style (Bold, Light) in a single document
- Is there any limitation base on file size or number of pages
Following are the code snippet
Document doc = new Document(@“D:\Tests\SampleReport.pdf”);
string ret = string.Empty;
FontRepository.Sources.Clear();
// add font folder path
String fontFolderPath = @"C:\Windows\Fonts\";
FolderFontSource fs = new FolderFontSource(fontFolderPath);
FontRepository.Sources.Add(fs);
TextFragmentAbsorber absorber = new TextFragmentAbsorber(new TextEditOptions(TextEditOptions.FontReplace.RemoveUnusedFonts));
Aspose.Pdf.Text.Font font = Aspose.Pdf.Text.FontRepository.FindFont("Mulish-Black");
for (int i = 1; i <= doc.Pages.Count; i++)
{
doc.Pages[i].Accept(absorber);
foreach (TextFragment textFragment in absorber.TextFragments)
{
textFragment.TextState.Font = font;
}
}
// Save document
if (File.Exists(@"D:\Tests\output.pdf"))
{
File.Delete(@"D:\Tests\output.pdf");
}
doc.Save(@"D:\Tests\output.pdf");