Convert Impress ODP Presentation to several JPG images from command line - libreoffice

I would like to use openoffice or libreoffice to convert a presentation made with Impress ( odp file, but might be powerpoint ppt, too ) to jpg images.
My point is: I have an odp presentation file, composed with 10 slides, then I would receive 10 jpeg images, one for each slide.
I tried with :
soffice --headless --convert-to jpg presentation.odp
This works perfect, but I just receive the very first slide of my presentation, not all. I do need all of them.
I don't know if there's an option to tell soffice to convert all the slides instead of the first one.
I know there are other ways like converting to pdf and then use IM, but I want to solve this using soffice. Im doing everything under Ubuntu Linux.
Thanks in advance.
Juan

Im going to reply my own answer.
To convert, massively, from .odp to images, under Linux using CLI, I'll do:
soffice --headless --convert-to pdf presentation.odp
Then:
convert -density 400 converted.pdf -resize 800x600 my_filename%d.jpg
This solution works, but it needs some improvements to make it faster and to prevent it from failing due to lack of hardware resources.
But, if your odp is not that big, you converted from odp/ppt/pptx/whatever to images, massively, it is scriptable, and using just CLI.

Related

How to convert .SFF file format to .BMP or .PNG or .JPG?

I need to convert my SFF file to PDF, then i need verify the document. i.e SFF file and converted file.
For that, I think to convert SFF file to image file and PDF file to image file.
Then comparing the both file using image processing.
To do this method:
Im searching for a program to convert SFF to BMP
Does anyone know such a program or has another idea how to do the job?
Thank you in advance...
Looks like you need reaConvertor. It appears to be a matured tool you can rely on. There is an online version of the tool here
I think:
https://github.com/Sonderstorch/sfftools
will do what you need (convert sff -> tiff/jpeg/..) and then you can use imageMagic (for example) to go to PDF.
Clearly not a current well used image format, however if you have legacy.sff Structured Fax Format, they are similar (not exactly identical) to a Monochrome G4 format.
By far the simplest programmable method to convert is using IrfanView which can Read Modify and Resave as other formats in batches.
Out put can be any other modern image type including Mono.BMP, G4.fax or as PDF (with or without GhostScript)

TCL fileutil::magic::mimetype not recognising Microsoft documents or mp3

I'm wondering if this is a limitation of fileutil::magic::mimetype, or whether something has gotten messed up in my installation. TCLLIB 1.15/TCL 8.5
Take an ordinary Microsoft Word .doc file and pass it to fileutil::magic::mimetype e.g.
package require fileutil
package require fileutil::magic::mimetype
set result [fileutil::magic::mimetype "/tmp/test.doc"]
It returns empty string. Same for mp3, plus other file formats. It does recognise GIF, PNG, TIFF and other image formats.
Calling fileutil::fileType returns binary for the Word document.
Standard Linux command file -i returns "application/msword" for the same file.
Can anyone confirm if this expected behaviour? I'm a little confused about the relationship between the fileutil and fumagic libraries, so maybe I've broken something in my install around that area.

SVG to PDF (with Perl Cairo?)

In a perl script, I try to convert svg files to pdf. This works great by just refering to Inkscape:
system "inkscape -D -z --file=$in --export-pdf=$out";
But it is enormously slow even for little 100 KB files, I mean it can be minutes per file, causing the script to fail when running with a time-out constrain, eg. on a webserver.
To speed up, I have read about svg2pdf as a standalone, but never found a binary for Win7 or managed to compile it, even with the libcairo dlls present.
My last idea now is to use the CPAN module Cairo. It makes me hoping that it can convert an svg file to pdf, but in the documentation I only find drawings and surfaces, but no method to write/convert.
Has anyone experience with that?
Making my comment an answer: You could try rsvg-convert which is part of the librsvg library. It's probably faster than Inkscape but it's still an external command.

Cannot import colors from Adobe Illustrator ai-file to Inkscape

When I import *.ai file to Inkscape, then colors become corrupt.
This means that these colors look like 4-bit indexed colors of early-era of 4bit color monitors.
Here is a sample:
( http://landkey.net/sand/questions/inkscape-and-adobe/inkscape-has-different-colors.png ).
File and objects' paths apparently do import correctly.
I use Inscape 0.48.3.1 r9886 on Ubuntu 12.04.4.
The same problem happens in GIMP 2.6 on Ubuntu 10.4
When I am reading this *.ai file in Acrobat reader, colors are fine.
When I am getting this file in PSD format in GIMP 2.6, then colors are fine, but I probably lose paths.
How to fix this problem for ai file?
I don't have AI to experiment. I receive files from remote team. If solution is found, i can make an advice.
Thank you.
The way around a problem was to ask team members to save files as SVG from Adobe program.
Apparently, this is how to do this: http://www.quintaldesigns.com/articles/articles/svg-files-in-adobe-illustrator
This, however, did not solve problem completely.
It was already 3 months gone, but in my memory "Adobe" sometimes generated too huge svg-files, 5 Meg, or 25 Meg, and there was no way to import them into Inkscape.
( http://forums.adobe.com/message/6219387 )
The final solution was still to use PSD files in the interteam exchange.

PDF output from MATLAB and inclusion in LaTeX

I'm printing some figures in MATLAB in PDF form, and can view them fine with the Evince PDF viewer on Fedora 16.
When I try to include them in LaTeX (TeXLive 2011), however, I get an error
!pdfTeX error: /usr/local/texlive/2011/bin/x86_64-linux/pdflatex (file ./caroti
d_amp_mod_log.pdf): xpdf: reading PDF image failed
However, I can take an example PDF image generated in Mathematica and include it just fine, which tells me that the problem is with the PDF's generated by MATLAB and not with PDF's in general.
Might it have something to do with the set(0,'defaultfigurepaperpositionmode','auto')I put in my startup.m file so that pages would auto-fit the images?
EDIT: I just tried using saveas(figure(1), 'filename.pdf') instead of print(figure(1), 'filename.pdf') and it worked fine, but the PaperPositionMode property is ignored. Any way around this?
Finally found the problem. The correct way to print images is to use the print(handle, '-dformat', 'filename') syntax.
So, for PDF's, we need print(figure(1), '-dpdf', 'myfigure'). See MATLAB documentation on graphics file formats for more information.
Using print(figure(1), 'filename.pdf') still produces a valid PDF for viewing, but it can't be included in LaTeX.
You can try using
pdfpages
or
pgf
to include pdf files. However, you need to use pdflatex only, as you are doing right now.