“WdExportOptimizeFor” Namespace missing in UiPath
however Namespace is available in visual studio
namespace FileToPdfConverter
{
public class PDFConverter
{
public string TextToPDF(string textFilePath)
{
try
{
string outputDirectory = Path.GetDirectoryName(textFilePath);
string outputFileName = Path.GetFileNameWithoutExtension(textFilePath) + “.pdf”;
string outputFilePath = Path.Combine(outputDirectory, outputFileName);
string textContent = File.ReadAllText(textFilePath);
Microsoft.Office.Interop.Word.Application wordApp = new Microsoft.Office.Interop.Word.Application();
Microsoft.Office.Interop.Word.Document doc = wordApp.Documents.Add();
doc.Range().Text = textContent;
doc.SaveAs2(outputFilePath, Microsoft.Office.Interop.Word.WdSaveFormat.wdFormatPDF, Microsoft.Office.Interop.WdExportOptimizeFor.wdExportOptimizeForPrint);
Library already imported in UiPath
Thanks in advance for any help & suggestions.