Aspose.pdf for .NET 将PDF文件转换为HTML时,可以不将样式文件和HTML文件分开吗?

if (Directory.Exists("D:/RWWordToHtml/") == false)//如果不存在就创建file文件夹
                {
                    Directory.CreateDirectory("D:/RWWordToHtml/");
                    Directory.CreateDirectory("D:/RWWordToHtml/Images/");
                }
                string part = "D:/RWWordToHtml/";
                string filename = "output_WordToHTML.html";
//创建Document实例
                Document mydoc = new Document();

                #region word转换为html
                //加载示例Word文档
                mydoc.LoadFromFile(strFile);
                //保存为HTML
                string file = Path.Combine(part, filename);
                mydoc.SaveToFile(file,Spire.Doc.FileFormat.Html);
                mydoc.Dispose();

                #endregion

74D{EUG@8@]16GZTEEZMBKC.png (90.2 KB)
UTBHPHQ5%TNZ]$GL_L$_%Y1.png (47.3 KB)

意思就是样式不放在css文件内,而是作为行内样式显示在HTML文件里面

@yfgpc,

请原谅我的语言,但我正在使用谷歌将英文翻译成中文。

如果我理解正确,你不想嵌入文件,比如样式。 HtmlSaveOption 类中有一个选项可以执行此操作。希望这就是您所需要的。

HtmlSaveOptions saveOptions = new HtmlSaveOptions();
saveOptions.PartsEmbeddingMode = PartsEmbeddingModes.NoEmbedding;

doc.Save($"{PartialPath}_output.html", saveOptions);