C# 使用OpenOffice从HTML转换为PDF时第一页空白
在将HTML从最基本的HTML转换为PDF时,输出的PDF总是第一页空白。如何解决这个问题? 我是否错过了任何特定的属性C# 使用OpenOffice从HTML转换为PDF时第一页空白,c#,html,pdf,openoffice-writer,C#,Html,Pdf,Openoffice Writer,在将HTML从最基本的HTML转换为PDF时,输出的PDF总是第一页空白。如何解决这个问题? 我是否错过了任何特定的属性 xComponent = InitDocument(aLoader, PathConverter(inputFile), "_blank"); SaveDocument(xComponent, inputFile, PathConverter(outputFile)); private static void SaveDocument(XCompon
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删除第一页来解决问题,但删除后,它显示文档页面树有无效节点。主要问题:第一页为空。第二个问题:使用PDFsharp删除第一页时出错。由于您没有包含与次要问题相关的示例代码和示例PDF,因此我认为删除PDFsharp标记是合适的。好的,我将创建单独的问题