天天看点

aspose pdf 转成html,使用Aspose.PDF for .NET将PDF转换为HTML格式示例解读:以光栅格式保存图像...

// 文档目录的路径。

string dataDir = RunExamples.GetDataDir_AsposePdf_DocumentConversion_PDFToHTMLFormat;

//源PDF文件

Document doc = new Document(dataDir + "input.pdf" );

//使用测试的功能创建HtmlSaveOption

HtmlSaveOptions saveOptions = new HtmlSaveOptions;

saveOptions.FixedLayout = true ;

saveOptions.SplitIntoPages = false ;

saveOptions.RasterImagesSavingMode = HtmlSaveOptions.RasterImagesSavingModes.AsExternalPngFilesReferencedViaSvg;

//将输出保存为HTML格式

doc.Save( dataDir + "SaveImages_out.html" , saveOptions);如果您有任何疑问或需求,请随时加入Aspose技术交流群( 642018183 )讨论