Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/83.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 使用OpenOffice从HTML转换为PDF时第一页空白_C#_Html_Pdf_Openoffice Writer - Fatal编程技术网

C# 使用OpenOffice从HTML转换为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

在将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删除第一页来解决问题,但删除后,它显示文档页面树有无效节点。

主要问题:第一页为空。第二个问题:使用PDFsharp删除第一页时出错。由于您没有包含与次要问题相关的示例代码和示例PDF,因此我认为删除PDFsharp标记是合适的。好的,我将创建单独的问题