Quantcast
Channel: Aspose.Pdf Product Family
Viewing all articles
Browse latest Browse all 3131

txt to pdf conversion issue

$
0
0
When trying to convert txt file using below code snippet I get this exception:

"Could not load file or assembly 'Aspose.HtmlOld, Version=17.1.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56' or one of its dependencies. The system cannot find the file specified."



using (var fileStream = new FileStream(@"c:\\aa\\test.txt", FileMode.Open))

{

using (var sr = new StreamReader(fileStream, Encoding.UTF8))

{

string line;

var pdf = new Aspose.Pdf.Generator.Pdf();

pdf.PageSetup.PageHeight = Aspose.Pdf.Generator.PageSize.A4Height;

var section = pdf.Sections.Add();


while ((line = sr.ReadLine()) != null)

{

var paragraph = new Aspose.Pdf.Generator.Text(section, line);

section.Paragraphs.Add(paragraph);

}

var b = pdf.GetBuffer();

}

}



I'm using the latest Aspose dlls available for .NET 3.5 (17.1.0.0)


Edit: The same happens when converting tif, png, jpg, gif or bmp to pdf.



Best regards,
Bartek

Viewing all articles
Browse latest Browse all 3131

Trending Articles