Copy link to clipboard
Copied
We have an app written with Delphi 2006 and using Rave Reports to generate PDFs. A Japanese user of our software cannot open the PDFs (with Acrobat reader) our software produces when they run our software on a Japanese version of Windows (probably Win7). I have the same problem if I try to open the same PDF (which they have sent us) with Acrobat reader on an English-language Win XP machine :
There was an error processing a page. There was a problem reading this document (109).
.
Ctrl-OK produces "object label badly formatted"
PDF files produced on English installations of our software read fine on our PCs and on the Japanese user's PC
Does anyone have any idea where this error is coming from?
Thanks,
Ross
Copy link to clipboard
Copied
I do not know Rave Reports; is this part or an extension of Delphi?
I remember a few years ago when I worked on a Delphi project, I always compiled the Japanese version of the software with the Japanese Delphi version. I do not exactly remember why, but it may have been a fonts issue.
Do you have Acrobat available? If so, if you open that faulty PDF with Acrobat, then re-save it, does that fix the problem? If yes, then you may be able to find out what the difference is between the two files.
Copy link to clipboard
Copied
Rave reports is an extension bundled with delphi. I only have adobe reader,
which doesn't load the offending document. I was able to load it with foxit
reader and it displayed correctly! But when i saved it from foxit, the
resulting pdf was identical to the original.
Copy link to clipboard
Copied
If the PDF does not contain any confidential information, can you send it to me, so I can try to open it with Acrobat?
I will send you a PM with my email address.
Copy link to clipboard
Copied
ThanksPat. Done.
Copy link to clipboard
Copied
I have received your docs; I will have a look at them later today.
Copy link to clipboard
Copied
I am very sorry; Acrobat gives me the exactly same error as you get in Adobe Reader.
I have even tried to open it with Acrobat XI (beta), but I am still getting the same error.
Since the failure only occurs when the document is issued on Japanese Windows, do I assume correctly that the document may contain Japanese characters?
If so, are there provisions in your Delphi software and/or Rave Reports that multibyte / wide characters are handled correctly? Are there specifications for Japanese (or Unicode) fonts?
Sorry, this is about all I can think of.
Copy link to clipboard
Copied
Hi Pat,
Thanks for looking at this.
Yes, there are almost certainly Japanese characters. If you look at the second (readable) version I sent you can see where part of the date has been rendered incorrectly - this is because they have their regional settings arranged so that the Japanese year character is used, and the version of Delphi we use doesn't support those multibyte characters.
It seems unreasonable for Acrobat Reader to choke on this however.
Here'a binary dump of the relevant part of the file
Copy link to clipboard
Copied
rossmcm wrote:
It seems unreasonable for Acrobat Reader to choke on this however.
It is possible that earlier Reader versions (8 or 9) may open the documens without errors, but of course it will still not show the Japanese timestamps correctly.
Copy link to clipboard
Copied
Hi Pat,
I removed the offending characters with a binary editor and it still fails to load, same error. I'll send you the repaired version in the hope that you have access to some diagnostic tool that will point to what's upsetting it.
Copy link to clipboard
Copied
Hi Ross,
I will be able to have a look at it tomorrow.
Copy link to clipboard
Copied
I was unable to open the "repaired" PDF with Acrobat; I am still getting the same error (as you get with Adobe Reader).
I am currently not even sure if it is the Japanese characters that are causing the error. And I do not know enough about the internal structure of PDF documents to analyze it. (I have even downloaded PDF-Analyzer, but that doesn't really tell me anything about your doc.)
I don't know how you obtain the timestamps in your application, but would it be possible to obtain these timestamps in a plain ASCII format?
Copy link to clipboard
Copied
Hi Pat,
The time and date in our application are formatted using the user's "Regional Settings" date format. I'm pretty sure that if the Japanese users set their date format to use a Romaji (i.e. english) date formats instead of Japanese characters the funny date characters will go away, but as you said this isn't the (only) problem, given that the file still faults when I scrub them out.
Weird
Copy link to clipboard
Copied
I think it's worth a try (to use a romaji date format), as it may have font implications.
I have played with Acrobat Preflight this afternoon, but even Preflight is unable to open your document.
I have also downloaded a PDF Repair tool, which in fact was able to repair your PDF. But then when I compared the two PDF files with a hex compare tool, the two files are dramatically different. But the section where the timestamps appear are still identical (mojibake).
So it appears as if it is not the Japanese characters per se that make the document unreadable, but something else - related to it.
This case is really intriguing!
Copy link to clipboard
Copied
*** Update ***
Acrobat Reader 9 is unable to open the document either (same error -109)
Copy link to clipboard
Copied
Yes, I tried Reader 9.x, 8.x, and 7.x - all give the same error.
Copy link to clipboard
Copied
I just had a look at the second document you sent me (Foxit output), and it appears that there are timestamps that contain Japanese characters (but are rendered as "mojibake" garbage characters).
That seems to prove that multibyte / wide characters are not handled, either in your software, or in Rave Reports.
A Japanese timestamp would properly look like 2012年8月6日 18:54:20
Copy link to clipboard
Copied
P.S. some reading: http://www.inter-locale.com/whitepaper/DelphiI18NCookbook.html