I'm using unoconv to convert an Excel file to PDF. The converted PDF retains the correct scaling when converting from an .xls file, however the PDF scaling reverts to 100% when converting from an .xlsx file. In other words, unoconv converts the same file, albeit with different extensions and Excel format, differently.
Operating system is Ubuntu. I'm running unoconv from the command line. I've scoured the web for a solution and have found none. I believe it's a bug in unoconv, i.e. unoconv does not seem to support maintaining the scaling when converting from .xlsx as it does when converting from .xls
Has anyone else encountered this and, if so, is there a workaround?
You could convert .xlsx files directly from Excel
File>Save As > Browse. change file extension to pdf from drop down menu.
or
File>Save as Adobe PDF and follow the dialog
this is at Office 2013
Related
I have a script that takes a csv and does something with it.
I'd like this script to be agnostic to the spreadsheet file type (xlsx, xls, ods for instance), and always convert the file to csv for processing. Is there a way to do this without corrupting the data in any way?
You can use a headless version of the open-source software, Libreoffice, to convert the same extensions that Libreoffice can normally do within in the GUI. This solution does require you to install the whole office suite which may be overkill depending on your particular situation.
However, via the command line, you can call Libreoffice to do this conversion:
soffice --headless --convert-to csv <input_file> --outdir </path/to/dir>
This example is under the assumption that you are using a Unix-like machine, however there should be a similar version for Windows as well (e.g. soffice.exe). Replace the <input_file> with your file name and the </path/to/dir/> to the path to the directory you want to have your output (the output directory option is opional). You can use the wildcard * as the input file, which would convert all the files in the directory to csv.
I am having problems to save a CSV file for Core Data using my Mac, works if I save in Windows computer but not in the MAC. I am using Excel. Every time I run the CSV file saved in MAC there are different errors in the Xcode.
In my experience when you save CSV files in a Mac computer it is always a mess. I had several problems dug in the forums and realize only could save CSV in PC with windows. If you are using UTF-8 in your coreData you can workaround with this, I am doing this for some time and never had problem again in my Mac.The way I do:
Save the .CSV file (comma delimited) in Excel.
Open the .CSV file with (http://www.sublimetext.com/2
File > Save with Encoding > choose the one you want.
Done.
If you have to edit or open the file in Excel, you have to save in Sublime Text 2 again before you drag to your Xcode project.
Forget Windows computers :)
Hope this solve your problem.
I download a lot of excel files for my job. But the "dashboard" we use outputs everything in older file formats (97-03) than my current version of Excel uses (2013). As a result, I have to "Enable Editing" and "Convert" every time I download a file. This wouldn't be a problem, but can be troublesome when I download larger datasets. I was wondering if there was a way for the file to be converted at the browser level, upon download. This way, when I open it in excel, it is already converted.
I'm trying to convert a .xls file to .pdf using LibreOffice via command line on Ubuntu. I have a kind of report on the .xls file with some colors in the background of the cells and etc.
The problem is when I convert the .xls file, the .pdf loses the original format. Each page is broken almost in the half and the content of one page is displayed in two different pages.
Does anybody know how to convert the .xls file to .pdf via command line with keeping the original format?
Or some trick to set the size of the .pdf page to not break pages? (Also via command line)
The code I used to make the conversion was:
soffice --headless --convert-to pdf:"impress_pdf_Export" filename.xls
If you use LibreOffice to convert Microsoft Excel (XLS) files to PDF documents, this is a two-step process (even if your command does look like it is a one-step process):
Import the XLS into LibreOffice (even if started with --headless).
Export the PDF from LibreOffice.
If the result does not look like you expect (not similar enough to Excel's native PDF export), then start with debugging the first step from above:
Open the XLS file with LibreOffice in a GUI. Does it look like you expect it to look? Or are some formatting options looking weird?
Export the PDF from there (with the GUI). Are the page dimensions as you expect? Did you set them up how you prefer? The margins like you want them? etc.pp. ...
If you are working on Windows, you may also want to consider OfficeToPDF.exe. It is hosted on CodePlex, licensed with the Apache 2.0 License and available in binary and in source code.
It requires a working Office 2013, Office 2010 or Office 2007 installation. But then it can commandline- and batch-convert to PDF various MS Office-based file formats, including XLS(X), PPT(X), DOC(X), VSD(X) and PUB as well as Libre/OpenOffice-based ODT, ODS and ODC files.
Although this is a little bit off from the initial question (you don't _really need Office Libre if you have the Office suite and on a Windows machine)
I do appreciate the follow-up provided by Kurt. It prompted me to post the following Gist offering some clear instructions on how to go about using the .exe in a for loop.
https://gist.github.com/einsty/2189cae4175f619cff0f
Try copying appropriate font file (for me it's
a simsun.ttc file) to your libreoffice installing directory like '/opt/libreoffice4.2/share/fonts/truetype'.But if the width of a single excel sheet is too much for a print page(sth like 'A4'),it'll still collapse.
Is there any type of automation available where I can use OpenOffice Calc to open Excel files and convert them to CSV or tab-delimited files?
I'm currently using PHPExcel to open the files and iterate through them and import each row into a database but have begun to run into memory issues with large files and need another alternative.
These are xls and xlsx files so it has to work for all of them.
If there is, how would I go about programming this in PHP?
If you have other alternatives, please feel free to suggest them.
OpenOffice can be run in server mode and used to convert files between a number of supported formats.
I have used this mainly with Java thru the JODConverter library available at http://www.artofsolving.com/opensource/jodconverter
A quick websearch brought up http://sourceforge.net/projects/phopo-org/ which claims to be a PHP implementation