2

It's possible using alivepdf to write a Unicode pdf?

I see a Unicode.as class, but when I try, the pdf created cannot be opened by adobe reader.

Could you please suggest me some code snippet to create a unicode string?

[EDIT]

I have made some investigations. I think the problem is on putcidfont0 method on UnicodePDF.as class.

The problem is that I think the font metrics are not parsed well and many characters are displayed with the default font width.

I cannot say how to fix this...

Tropicalista
  • 3,097
  • 12
  • 44
  • 72

3 Answers3

1

Try delcaring a new UnicodePDF() or setting the isUnicode bit to true (see documentation)

I dealt with this a month or two ago. My issue was that certain characters I would pass to AlivePDF would result in a broken PDF.

In my case I still had issues and my research turned up no promising results, although someone else had a strikingly similar issue that may be worth reading in your case.

The AlivePDF library hasn't been updated in a few years, and with my experience it seems like it doesn't play entirely well with unicode / other languages, although I have used it for English content without issue.

Since my target was desktop Flash and I was generating the PDF content from an external XML file, I eventually just wrote a helper utility app using C# and PDFSharp, which may or may not be an option in your case.

ToddBFisher
  • 11,370
  • 8
  • 38
  • 54
  • I should read some json. Can I format the json and then output a well formatted pdf? SO for example, can I format some chinese text and pass it to alivepdf? – Tropicalista Jul 08 '13 at 20:29
0

There was a big discussion here

Also I noticed that online PDF to Doc converters read UnicodePDF() files well.

Hope it helps.

Community
  • 1
  • 1
ZuzEL
  • 12,768
  • 8
  • 47
  • 68
  • I've already read that discussion. My problem is that my unicode pdf cannot be open by adobe reader, foxit reader instead can read.I'm trying to modify the library, but after a look to pdf reference, it seems too hard to get a decent result with unicode, so I was searching for a help from other developer... – Tropicalista Jul 08 '13 at 20:27
  • The strange thing is that I can output an inline pdf with unicode characters well formatted, except some character that add an extra space, like c cedilla. Cannot say if it's a map problem or other issue – Tropicalista Jul 08 '13 at 20:32
0

It seems that some characters, as greek accented, some polish and many other characters are not available trough cid fonts, so the only way is to embed font in pdf.

Tropicalista
  • 3,097
  • 12
  • 44
  • 72