encoding problem concerning umlauts etc.

18 views
Skip to first unread message

MfS

unread,
Mar 25, 2012, 8:51:19 AM3/25/12
to origami-pdf
Hello there,

I am currently working on a Ruby project which uses Origami to create
PDF pages out of UTF-8 Strings coming from a SQLite database. This
works well as long as the String does not contain umlauts like ä,ö,ü.
The umlauts in the resulting PDF page look like "^/" or so. Is there a
way to get correct umlauts into the PDF?

Thank you for your help!
mfs

A sample ruby script illustrating the problem:

# coding: utf-8
require 'origami'
include Origami
OUTPUTFILE = "new.pdf"
# Creating a new file
pdf = PDF.new
s=String.new("ä")
contents = ContentStream.new
contents.write s, :x => 250, :y => 750, :rendering =>
Text::Rendering::FILL, :size => 30
pdf.append_page Page.new.setContents(contents)
pdf.save(OUTPUTFILE)
Reply all
Reply to author
Forward
0 new messages