У меня возникли проблемы с преобразованием Word Document в PDF. В моем документе слова, шрифт это (Times New Roman):Как сохранить свойства шрифта текстовых документов при преобразовании в PDF
но при преобразовании в PDF, он стал:
Я использовал следующий код:
Word._Application oWord = new Word.Application();
// Make this instance of word invisible (Can still see it in the taskmgr).
oWord.Visible = false;
// Interop requires objects.
object oMissing = System.Reflection.Missing.Value;
object isVisible = true;
object readOnly = false;
object oInput = Application.StartupPath+"\file.docx";
object oOutput = Application.StartupPath+"\file.docx".Replace(".docx", ".pdf");
object oFormat = Word.WdSaveFormat.wdFormatPDF;
// Load a document into our instance of word.exe
Word._Document oDoc = oWord.Documents.Open(ref oInput, ref oMissing, ref readOnly,
ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing,
ref oMissing, ref oMissing, ref isVisible, ref oMissing, ref oMissing, ref oMissing, ref oMissing);
// Make this document the active document.
oDoc.Activate();
// Save this document in Word 2003 format.
oDoc.SaveAs(ref oOutput, ref oFormat, ref oMissing, ref oMissing, ref oMissing,
ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing,
ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing);
// Always close Word.exe.
oWord.Quit(ref oMissing, ref oMissing, ref oMissing);
Что я буду делать, чтобы преобразовать документ Word в PDF, сохраняя его свойства шрифта?
Я переустановил все свои PDF-ридеры и заменил свой код на этот код. Теперь это совершенно исправлено.^_^спасибо тонну. , , – ThEpRoGrAmMiNgNoOb
Не проблема. Я обнаружил, что работа с Word и PDF иногда может быть немного сложной. – SimTrooper