将HTML(最基本的HTML)转换为PDF时,输出PDF始终为第一页空白。怎么解决这个? 我是否会错过任何特定的房产?
xComponent = InitDocument(aLoader, PathConverter(inputFile), "_blank");
SaveDocument(xComponent, inputFile, PathConverter(outputFile));
private static void SaveDocument(XComponent xComponent, string sourceFile, string destinationFile)
{
var propertyValues = new PropertyValue[2];
// Setting the flag for overwriting
propertyValues[1] = new PropertyValue { Name = "Overwrite", Value = new Any(true) };
//// Setting the filter name
propertyValues[0] = new PropertyValue
{
Name = "FilterName",
Value = new Any("writer_pdf_Export")
};
((XStorable)xComponent).storeToURL(destinationFile, propertyValues);
}
我尝试使用PDFsharp删除第一页来解决方法,但删除后,它显示“文档页面树有无效节点”。