OpenOffice command line PDF creation

后端 未结 5 2112
耶瑟儿~
耶瑟儿~ 2020-12-14 03:26

I have some documentation written in OpenOffice, and I would like to include some of it as PDF files in the final build deliveries. I would like to do this with the automate

5条回答
  •  离开以前
    2020-12-14 03:49

    Art of Solving has also a very good API to perform the conversion in Java. It is a little slow but it is simple enough. This is how I use it:

            File inputFile = new File("C:\\oreyes\\hola.doc"); 
            File outputFile = new File("C:\\oreyes\\hola.pdf"); 
            OpenOfficeConnection connection = new SocketOpenOfficeConnection(8100);
            try { 
                connection.connect(); 
            } catch(Exception e) {}
    
            DocumentConverter converter = new OpenOfficeDocumentConverter(connection);
            converter.convert(inputFile, outputFile); 
            connection.disconnect(); 
    

    You can create a jar with that and process it from the command line.

提交回复
热议问题