Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to convert an encoded text file into a pdf one #262

Closed
TomDmitriev opened this issue Jun 19, 2015 · 8 comments
Closed

How to convert an encoded text file into a pdf one #262

TomDmitriev opened this issue Jun 19, 2015 · 8 comments
Labels

Comments

@TomDmitriev
Copy link

I have been trying to convert a cp1251 text file into pdf using unoconv and I am quite suripised that I have not been able to do that in an almost an hour. It seems that my encoding parameter is just ignored. This is what I have tried:

unoconv -f pdf --export FilterOptions=cp1251 rus.txt
unoconv -f pdf --export FilterOptions=cp-1251 rus.txt
unoconv -f pdf --export FilterOptions=Windows1251 rus.txt
unoconv -f pdf --export FilterOptions=Windows-1251 rus.txt
unoconv -f pdf --export 'Character Set'='cp1251' rus.txt
unoconv -f pdf --export 'Character Set'='cp-1251' rus.txt
unoconv -f pdf --export 'Character Set'='Windows1251' rus.txt
unoconv -f pdf --export 'Character Set'='Windows-1251' rus.txt
unoconv -f pdf --export 'Character Set'='Windows-1251 (Cyrillic)' rus.txt

I am pretty sure the export params are just ignored because if I try something like FilterOptions=whatever I get no warning or error. My unoconv installation:

unoconv 0.6
Written by Dag Wieers dag@wieers.com
Homepage at http://dag.wieers.com/home-made/unoconv/

platform posix/linux
python 3.3.2 (default, Mar 21 2015, 19:05:23)
[GCC 4.8.2]
LibreOffice 4.3

@dagwieers
Copy link
Member

The documentation has a link to this website:
http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/Spreadsheets/Filter_Options

According to that list you should be using:

unoconv -f pdf --export FilterOptions=34 rus.txt

Does that work ?

@TomDmitriev
Copy link
Author

Nope. For those who might be interesting as a workaround I use iconv to
convert a cp1251-encoded file into a utf8-encoded one.

@dagwieers
Copy link
Member

Sorry, I got it all wrong, we should have been using the import filters instead as we are importing a CP-1251 document. So:

unoconv -f pdf --import FilterOptions=34 rus.txt

Could you try that instead ?

@TomDmitriev
Copy link
Author

In this case I get the following error

Warning: Option cannot be parsed, ignoring.
unoconv: file `FilterOptions=34' does not exist.

@dagwieers
Copy link
Member

Alright, you found another issue that I just fixed bd0f756

Can you try this instead:

unoconv -f pdf -i FilterOptions=34 rus.txt

(Or get the fix from the commit above. Sorry for that...)

@TomDmitriev
Copy link
Author

unoconv -f pdf -i FilterOptions=34 rus.txt

Unfortunately, it did not work either.

On 26 June 2015 at 23:08, Dag Wieers notifications@github.com wrote:

Alright, you found another issue that I just fixed bd0f756
bd0f756

Can you try this instead:

unoconv -f pdf -i FilterOptions=34 rus.txt

(Or get the fix from the commit above. Sorry for that...)


Reply to this email directly or view it on GitHub
#262 (comment).

Yours sincerely,
Artyom Dmitriev

@dagwieers
Copy link
Member

I have been investigating this issue today and apparently the import FilterOptions are only support for the spreadsheet-type documents. I couldn't find any info supporting a claim that text-documents are supported by this :-(

I always assumed it was the case, but even my own documentation clearly states these are spreadsheet import options: https://github.com/dagwieers/unoconv/blob/master/doc/filters.adoc

Sorry for wasting your time.

@napasa
Copy link

napasa commented Mar 27, 2017

kind man

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants