Код: Выделить всё
//Create path for PDF
String pathPDF = DocumentHandler.Document.FullName;
pathPDF = System.IO.Path.ChangeExtension(pathPDF, ".pdf");
if (System.IO.File.Exists(pathPDF))
{
System.IO.File.Delete(pathPDF);
}
//Save as PDF (ISO19005_1 -> PDF/A-1)
DocumentHandler.Document.ExportAsFixedFormat(OutputFileName: pathPDF, ExportFormat: WdExportFormat.wdExportFormatPDF, UseISO19005_1: true, OptimizeFor: WdExportOptimizeFor.wdExportOptimizeForOnScreen);
log.Info($"PDF successfully exported to {pathPDF}");
Код: Выделить всё
System.Runtime.InteropServices.COMException (0x80004005): c. Das Dokument konnte nicht für den Export vorbereitet werden.
//(in English this would be roughly: The document could not be prepared for export.)
(эти ошибки возникают в MS365, Word версии 2406 (сборка 17726.20160 «нажми и работай») , в виртуальной среде и при большом количестве антивирусов)
мы заметили, что эта ошибка в последнее время также возникает при сохранении документа:
Код: Выделить всё
System.Runtime.InteropServices.COMException (0x800A14CA): Unzureichender Arbeitsspeicher oder nicht genügend Speicherplatz. Die gewünschte Schriftart kann von Word nicht angezeigt werden.
//(in English this would be roughly: Insufficient memory or not enough storage space. Word cannot display the desired font.)
большое спасибо заранее, буду очень благодарен за помощь!
Подробнее здесь: https://stackoverflow.com/questions/787 ... on-0x80004