[Solved] AOO API to convert Office formats to image
Posted: Tue Feb 12, 2019 1:12 pm
Hello,
I'm attempting to write a command line application that will allow me to convert most popular office formats to both PDF and JPG (or any image format). I found an awesome little project called PDFVert (https://github.com/dmazz55/Pdfvert) which uses the OO API to convert popular formats to PDF, and I have downloaded and tested that and it works wonderfully. This is the first time I will be using the API, but looking at the source code for PDFVert answers a lot of questions.
From what I can tell, I need to find the Open Office filter names for different formats in order to tell the application to tell OO what format to save/convert the file as/to. For example, if PDFVert is converting a .doc file it uses the Open Office filter "writer_pdf_Export" to tell the Open Office API to use Writer and export as PDF.
Is there a filter I can use for resaving as an image? I understand image saving/exporting may not be included in OO by default, but there are some extensions that could help like this one (https://extensions.openoffice.org/en/pr ... s#releases). If I install an extension like that, is there any way for me to utilize it via the Open Office API in my app, or is it only accessible when using the Open Office applications normally, not through the API?
To increase the number of formats I can convert to an image file, I was also thinking I could use PDF as an intermediary format since thanks to PDFVert I already can convert most formats to PDF right now. This extension (https://extensions.openoffice.org/en/pr ... openoffice) enables Open Office to import PDF's, so it could be possible to use it to import a PDF and then use the first extension to save as an image, but again I would need some way to interface with this extension via the Open Office API, is that possible? Is there a filter name these extensions adds?
I found some more filters at this project (https://gist.github.com/psd/268550/faca ... 517c3e2167), but they are for resaving as office formats, not images.
Any tips to point me in the right direction would be amazing.
Edit, found a larger filter list here (https://stackoverflow.com/questions/117 ... le-formats) haven't tried any yet
I'm attempting to write a command line application that will allow me to convert most popular office formats to both PDF and JPG (or any image format). I found an awesome little project called PDFVert (https://github.com/dmazz55/Pdfvert) which uses the OO API to convert popular formats to PDF, and I have downloaded and tested that and it works wonderfully. This is the first time I will be using the API, but looking at the source code for PDFVert answers a lot of questions.
From what I can tell, I need to find the Open Office filter names for different formats in order to tell the application to tell OO what format to save/convert the file as/to. For example, if PDFVert is converting a .doc file it uses the Open Office filter "writer_pdf_Export" to tell the Open Office API to use Writer and export as PDF.
Is there a filter I can use for resaving as an image? I understand image saving/exporting may not be included in OO by default, but there are some extensions that could help like this one (https://extensions.openoffice.org/en/pr ... s#releases). If I install an extension like that, is there any way for me to utilize it via the Open Office API in my app, or is it only accessible when using the Open Office applications normally, not through the API?
To increase the number of formats I can convert to an image file, I was also thinking I could use PDF as an intermediary format since thanks to PDFVert I already can convert most formats to PDF right now. This extension (https://extensions.openoffice.org/en/pr ... openoffice) enables Open Office to import PDF's, so it could be possible to use it to import a PDF and then use the first extension to save as an image, but again I would need some way to interface with this extension via the Open Office API, is that possible? Is there a filter name these extensions adds?
I found some more filters at this project (https://gist.github.com/psd/268550/faca ... 517c3e2167), but they are for resaving as office formats, not images.
Any tips to point me in the right direction would be amazing.
Edit, found a larger filter list here (https://stackoverflow.com/questions/117 ... le-formats) haven't tried any yet