Export to PDF works strange with russian symbols

Added by Aleksey Ryazhskih almost 11 years ago

I faced with such problem:

Issue description card to PDF export result

russan symbols are rendered wrong in pdf.
How to resolve this problem?

redmine_pdf_bug.png - Issue description card to PDF export result (31.1 KB)

Replies (48)

RE: Export to PDF works strange with russian symbols - Added by Maxim Krušina almost 11 years ago

There is already ticket describing this problem... It's problem f PDF generation vs Fonts used vs UTF-8....
(cannot find releated issue right now)

RE: Export to PDF works strange with russian symbols - Added by Chaoqun Zou almost 11 years ago

You can have a look at #1170, but I think there is some difference between Russian and Chinese. Maybe your russian problem is caused by the font used in pdf.

RE: Export to PDF works strange with russian symbols - Added by clawfrown clawfrown almost 11 years ago

I have the same problem, but while trying to setup new redmine installation, suddenly faced similar problems when tried to setup the database in latin1 charset.
And it seems that this is not redmine or PDF generation problem.
This is the problem of the charset you use in the database. Convert your database to UTF8 and it will work well (I didn't tried as I cant find the proper way to do it with my MySql 5.0 ).

RE: Export to PDF works strange with russian symbols - Added by Michael Baikov almost 11 years ago

This problem does not related with encoding in mysql database. The problem is in PDF generation.

RE: Export to PDF works strange with russian symbols - Added by Michael Baikov almost 11 years ago

I don't have one yet, but i am working on it :)

RE: Export to PDF works strange with russian symbols - Added by Michael Baikov almost 11 years ago

Ok, i got russian letters to display correctly in PDF output using this version of rfpdf http://github.com/edwinmoss/rfpdf/tree/master and with several magic tricks.

RE: Export to PDF works strange with russian symbols - Added by Thomas Lecavelier almost 11 years ago

Interesting but, what was the magic tricks?

RE: Export to PDF works strange with russian symbols - Added by Michael Baikov almost 11 years ago

  • git version of rfpdf
  • FreeSans font (i changed default font in ifpdf_helper.rb)
  • two obvious fixes, that was needed to make git version of rfpdf to work

RE: Export to PDF works strange with russian symbols - Added by Alex Aktion almost 11 years ago

Still not fixed? Im really suffering from this =(

RE: Export to PDF works strange with russian symbols - Added by Thomas Lecavelier almost 11 years ago

@Michael: could you precise what are the "two (not so) obvious fixes" please? :)

RE: Export to PDF works strange with russian symbols - Added by Alexey Chepurnykh almost 11 years ago

Are there any changes on this issue? I see that many people are interested for it to be solved.

RE: Export to PDF works strange with russian symbols - Added by Thomas Lecavelier almost 11 years ago

All advancement is here. I'm trying to work on it on my spare time, but that late piece is missing :)

RE: Export to PDF works strange with russian symbols - Added by Michael Baikov almost 11 years ago

I will try to make patch with those obvious fixes today later :)

RE: Export to PDF works strange with russian symbols - Added by Thomas Lecavelier almost 11 years ago

That would be a true pleasure, you don't imagine the number of issue it would close once in trunk. :)

RE: Export to PDF works strange with russian symbols - Added by Michael Baikov almost 11 years ago

Ok, here are those patches

difff - patch for new version of rfpdf (1.79 KB)

RE: Export to PDF works strange with russian symbols - Added by Alexey Chepurnykh almost 11 years ago

Thank you, Michael. I tested the fix. It works well.

RE: Export to PDF works strange with russian symbols - Added by Harry Yamamoto over 10 years ago

Hello.
I tested the fix but error accured when I restarted the server.
---error info---
C:/Programs/ruby/rubyprojects/redmine/vendor/rails/activesupport/lib/active_supp
ort/dependencies.rb:263:in `load_missing_constant': uninitialized constant Actio
nView::Template (NameError)
from C:/Programs/ruby/rubyprojects/redmine/vendor/rails/activesupport/li
b/active_support/dependencies.rb:453:in `const_missing'
from C:/Programs/ruby/rubyprojects/redmine/vendor/plugins/rpdf/environme
nt.rb:19
from C:/Programs/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
27:in `gem_original_require'
from C:/Programs/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
27:in `require'
from C:/Programs/ruby/rubyprojects/redmine/vendor/rails/activesupport/li
b/active_support/dependencies.rb:496:in `require'
from C:/Programs/ruby/rubyprojects/redmine/vendor/rails/activesupport/li
b/active_support/dependencies.rb:342:in `new_constants_in'
from C:/Programs/ruby/rubyprojects/redmine/vendor/rails/activesupport/li
b/active_support/dependencies.rb:496:in `require'
from C:/Programs/ruby/rubyprojects/redmine/vendor/plugins/rpdf/init.rb:4
:in `evaluate_init_rb'
... 39 levels...
from C:/Programs/ruby/rubyprojects/redmine/vendor/rails/railties/lib/com
mands/server.rb:39
from C:/Programs/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
27:in `gem_original_require'
from C:/Programs/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
27:in `require'
from script/server:3

RE: Export to PDF works strange with russian symbols - Added by Michael Pirogov over 10 years ago

Harry Yamamoto

Have you update rfpdf to the latest git version?

RE: Export to PDF works strange with russian symbols - Added by Harry Yamamoto over 10 years ago

I get the latest version from the URL below .Is it the same latest version as the one from git ?
http://github.com/edwinmoss/rfpdf/zipball/master

RE: Export to PDF works strange with russian symbols - Added by Dmitry K about 10 years ago

Same problem with russian language :(
Does anybody fixed this bug?

RE: Export to PDF works strange with russian symbols - Added by Mykhaylo Sorochan about 10 years ago

1. Replace the rfpdf plugin with the one http://github.com/edwinmoss/rfpdf/zipball/master
2. Apply the attached patch to {REDMINE}/lib/redmine/export/pdf.rb

pdf.rb.patch Magnifier (1.92 KB)

RE: Export to PDF works strange with russian symbols - Added by Alex Aktion about 10 years ago

Kidding? I have no idea how to apply patch. Is it possible to have it included in the next release please?

RE: Export to PDF works strange with russian symbols - Added by Mykhaylo Sorochan about 10 years ago

You can apply it manually. Click on the patch link. You need to replace red coloured lines with the green ones in your pdf.rb file.

1 2 (1-25/48)