0

The PDFs work fine when linked in a page, or just opened from the file system. We have a web app in three different languages: English, Spanish, and Chinese. The English and Spanish PDFs in the DB open just fine. The Chinese version uses Arial Unicode MS, the others are just Arial.

All three languages open just fine outside of the DB. All three versions use the same code to open from the DB (VB.Net). I'm assuming at this point it's the font and Oracle doesn't like it being stored in its DB.

I've also used other Chinese fonts (FangSong, SimSum) with the same results.

We also use Crystal Reports and do not have a problem with displaying Arial Unicode MS Chinese characters in a PDF report (although that took a bit to figure out).

Anyone encounter this problem?

EDIT: The PDF opens in Firefox, but not in IE (7, 8, 9, 10), Chrome, Safari, or Opera. And as much as I'd like to tell users to use Firefox, I can't!

Thanks!

tahdhaze09
  • 2,220
  • 1
  • 21
  • 36
  • 2
    how do you know the chars in db are corrupt? Whats your oracle db character set? How are you storing the unicode data? (in nchar fields?) Need more info on your db setup – tbone Aug 22 '13 at 15:40
  • Can you save the pdf from within ie, Chrome, Safari, or Opera and inspect the saved file? – mkl Aug 25 '13 at 06:41
  • @mkl - The file can't be saved since it comes up as broken. It's a binary stream so no opportunity to save. – tahdhaze09 Aug 28 '13 at 17:30
  • @tbone - I'll get the info. Something tells me it may be the way the stream is being sent down along with the character set. A Response.End() may not be in the code... – tahdhaze09 Aug 28 '13 at 17:32
  • Can't you "save as..." the link instead of simply opening it? – mkl Aug 28 '13 at 21:06

1 Answers1

1

Do your response headers contain the right Content-Type? Eg: Content-Type: 'application/pdf'

$ curl -I http://www.example.com/path/to/chineese.pdf

You can also set Content-Disposition: attachment; to force a download. It's up to the user to open the file in his favorite pdf-client. You can also supply a filename:

Content-Disposition: attachment; filename="fname.ext"
allcaps
  • 10,945
  • 1
  • 33
  • 54