Aspose.PDFを使用して特定のXPSファイルを変換しようとするとExceptionが発生します。
XPSファイルは、ExcelからAspose.Cellsを使用して作成したものです。
不具合であれば修正をお願いします。
参考までに、変換処理に使用しているソースコードを記載します。
▽Excel→XPS:Aspose.Cells(Version:25.1.1)
var workBook = new Aspose.Cells.Workbook(orgFile);
Aspose.Cells.XpsSaveOptions xpsSaveOptions = new Aspose.Cells.XpsSaveOptions();
xpsSaveOptions.EmfRenderSetting = Aspose.Cells.EmfRenderSetting.EmfPlusPrefer;
if (workBook != null && workBook.Worksheets != null && ignorePrintAreas)
{
foreach (var sheet in workBook.Worksheets)
{
var pageSetup = sheet.PageSetup;
pageSetup.PrintArea = "";
}
}
workBook.Save(xpsPath, xpsSaveOptions);
workBook.Dispose();
▽XPS→PDF:Aspose.PDF(Version:24.11)
// XPSファイルを読み込む
var pdfDocument = new Document(inputPath, new XpsLoadOptions());
// PDFファイルに変換する
pdfDocument.Save(outputPath, Aspose.Pdf.SaveFormat.Pdf);
pdfDocument.Dispose();
▽Exceptionの内容
System.IO.FileLoadException: ‘Supplied XPS file or stream is corrupt and cannot be parsed!’
▽変換に使用しているファイル
test.zip (50.1 KB)