Answer the question
In order to leave comments, you need to log in
RTF to PDF conversion in C#, strictly free components, who knows about them?
subject actually. nothing special to add. So far, only COM automation of ArcobatRider has been found. bummer, there is about the components of the combat Acrobat, and not the reader,
I will be grateful for the tips, if anyone knows
Answer the question
In order to leave comments, you need to log in
as a result of intensive searches, I have to admit that all completely free tools try to render to html and only then to pdf
if, according to the conditions of the task, I am allowed to use the upd office - it all comes down to automating the print job to a pdf printer. if not, let's simplify the task to rendering html, and it's not forbidden to use browsers for sure))
internal static bool wordAsConverter(string rtf, string pdf, bool verb = true, bool clean = true)
{
$"\t..try convert to pdf...".print();
var res = false;
var app = new Application();
try
{
var doc = app.Documents.Open(rtf);
doc.ExportAsFixedFormat(pdf, WdExportFormat.wdExportFormatPDF);
doc.Close(false);
res = true;
var fn = Path.GetFileName(rtf);
if (verb) $"\t{fn} converted to pdf".print();
if (clean)
{
File.Delete(rtf);
if (verb) $"\t{fn} deleted".print();
}
}
catch (Exception e) { e.Message.print(); }
finally { app.Quit(false); }
return res;
}
// привычка, для уменьшения многословности кода
internal static void print(this string s) => Console.WriteLine(s);
consider the MigraDoc & pdfSharp option, if my memory serves me, then the MIT license
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question