问题:
word中表格 采用的是百分比,上下表格是对齐的。转成pdf之后,就错位了,这个是转换的代码:
MegaResponse<string> response = new MegaResponse<string>();
try
{
FontSettings fontSettings = new FontSettings();
fontSettings.SetFontsFolder("C:\\Windows\\Fonts", true);
LoadOptions loadOptions = new LoadOptions();
// loadOptions.FontSettings = fontSettings;
var doc = new Aspose.Words.Document(wordFilePath);
var pdfPath = wordFilePath.Replace(".docx", ".pdf");
PdfSaveOptions saveOptions = new PdfSaveOptions();
saveOptions.PageMode = PdfPageMode.UseOutlines;
saveOptions.OutlineOptions.HeadingsOutlineLevels = 2;
doc.Save(pdfPath, saveOptions);
response.Data = pdfPath;
}
测试-Koss Limited.zip (986.2 KB)