相关疑难解决方法(0)

如何通过 Python + Windows 使用 LibreOffice API (UNO)?

这个问题主要针对 Windows + LibreOffice + Python 3。

我已经安装了 LibreOffice (6.3.4.2),并且 pip install unoconvpip install unotoolspip install uno另一个不相关的库),但在之后我仍然收到此错误import uno

ModuleNotFoundError:没有名为“uno”的模块

更一般地说,作为 UNO 使用的示例,如何使用 LibreOffice UNO 打开 .docx 文档并将其导出为 PDF?

几天来我对此进行了广泛的搜索,但我还没有找到可在 Windows 上运行的可重现的示例代码:

python openoffice.org uno libreoffice

8
推荐指数
1
解决办法
1万
查看次数

使用C#将.doc转换为.docx

我使用PDFFocus.net dll将PDF文件转换为word文件。但是对于我的系统,我需要.docx文件。我尝试了不同的方法。有一些可用的库。但是那些不是免费的。这是我的pdf到doc转换代码。

    Using System;
    Using System.Collections.Generic;
    Using System.Linq;
    Using System.Text;
    Using System.Threading.Tasks;
    Using iTextSharp.text;
    Using iTextSharp.text.pdf;

    namespace ConsoleApplication
    {
          class Program
          {
               static void main(String[] args)
               {
                    SautinSoft.PdfFocus f=new SautinSoft.PdfFocus();
                    f.OpenPdf(@"E:\input.pdf");

                         t.ToWord(@"E:\input.doc");
                }
          }
    }
Run Code Online (Sandbox Code Playgroud)

这项工作成功。然后,我尝试使用以下代码将.doc转换为.docx。但这给了我错误。

//Open a Document.
Document doc=new Document("input.doc");
//Save Document.
doc.save("output.docx");
Run Code Online (Sandbox Code Playgroud)

谁能帮我。

c#

4
推荐指数
1
解决办法
1万
查看次数

如何将 docx 转换为 PDF?

我想问一下是否可以使用R将文本文件(例如word文档或文本文档)转换为PDF?我想使用此代码将其转换为 .rmd,然后转换为 PDF

require(rmarkdown)
my_text <- readLines("C:/.../track.txt")
cat(my_text, sep="  \n", file = "my_text.Rmd")
render("my_text.Rmd", pdf_document())
Run Code Online (Sandbox Code Playgroud)

但它不起作用显示此错误:

> Error: Failed to compile my_text.tex.
In addition: Warning message:
running command '"pdflatex" -halt-on-error -interaction=batchmode "my_text.tex"' had status 127 
Run Code Online (Sandbox Code Playgroud)

还有其他解决方案吗?

pdf r package text-files shiny

3
推荐指数
2
解决办法
5815
查看次数

标签 统计

c# ×1

libreoffice ×1

openoffice.org ×1

package ×1

pdf ×1

python ×1

r ×1

shiny ×1

text-files ×1

uno ×1