Unicode PDFs generated by TD 5.1 spat out by GhostScript

Discussion forum about all things Report Builder (all versions).
davidpritchard
Spain
Posts: 46
Joined: 11 Sep 2018, 11:29
Location: Madrid, Spain

Unicode PDFs generated by TD 5.1 spat out by GhostScript

Post by davidpritchard » 11 Dec 2009, 13:47

After applying the patch EMP5191, I am now able to generate Unicode PDFs using SalReportPrintToFile (without the patch, special characters appear as placeholder boxes).

However, if I try to merge several PDFs generated by SalReportPrintToFile using GhostScript (v8.61), GS rejects the PDFs as invalid, and spits out the following error:

GPL Ghostscript 8.61: Unrecoverable error, exit code 1

Error: /undefinedresource
in findresource

Operand stack:
--nostringval-- --dict:6/15(L)-- F2 12 --dict:6/6(L)-- --dict:6/6(L)-- ArialMT --dict:11/12(ro)
(G)-- --nostringval-- --dict:8/8(L)-- --dict:8/8(L)-- Adobe-Identity CIDFont Adobe-Identity
Execution stack:
%int
erp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval
-- --nostringval-- false 1 %stopped_push 1905 1 3 %oparray_pop 1904 1 3 %oparray_pop 1888 1 3 %o
parray_pop --nostringval-- --nostringval-- 2 1 1 --nostringval-- %for_pos_int_continue --nostringval-- --nostr
ingval-- --nostringval-- --nostringval-- %array_continue --nostringval-- false 1 %stopped_push --nostringval--
%loop_continue --nostringval-- --nostringval-- --nostringval-- --nostringval-- --nostringval-- --nostringval-- %a
rray_continue --nostringval-- --nostringval-- --nostringval-- --nostringval-- --nostringval-- %loop_continue --nos
tringval-- 1856 13 9 %oparray_pop findresource %errorexec_pop --nostringval-- --nostringval-- --nostringval--


It seems to be some sort of problem with the internal format of the PDF. It's looking for a "CIDFont-CMap pair" and doesn't find it. Something like that. I understand this is not strictly a Unify problem, but I wonder if anybody knows anything about this, or can suggest a solution. Short of finding a solution, we have to stick with a rather awkward method of generating PDFs via a custom-installed GhostScript printer. We'd far prefer the integrated solution if it were feasible.


Platform: Windows XP
Team Developer 5.1 SP6

davidpritchard
Spain
Posts: 46
Joined: 11 Sep 2018, 11:29
Location: Madrid, Spain

Re: Unicode PDFs generated by TD 5.1 spat out by GhostScript

Post by davidpritchard » 11 Dec 2009, 19:08

I suspect this is a case of GhostScript being hyper-correct in its interpretation of PDFs. I understand that many applications generate PDFs that don't completely conform to the standard, and Adobe Reader (amongst others) will tolerate this. GhostScript chooses to be strict in its interpretation and refuses to read the defective PDFs.

This doesn't help us, of course, because right now we need to use GhostScript.

davidpritchard
Spain
Posts: 46
Joined: 11 Sep 2018, 11:29
Location: Madrid, Spain

Re: Unicode PDFs generated by TD 5.1 spat out by GhostScript

Post by davidpritchard » 17 Dec 2009, 20:30

Seems like we found a solution. PDFTK is a GPL utility for merging PDFs (as well as doing other things with PDFs). It handles PDFTron's PDFs without a problem and we now have a working solution implemented which uses it.

davidpritchard
Spain
Posts: 46
Joined: 11 Sep 2018, 11:29
Location: Madrid, Spain

Re: Unicode PDFs generated by TD 5.1 spat out by GhostScript

Post by davidpritchard » 18 Dec 2009, 13:17

So near, and yet so far... turns out that there's more wrong with the PDFTron PDFs than just non-compliant internal housekeeping. Certain images in the Unify (PDFTron) PDFs created via SalReportPrintToFile are sized incorrectly and end up outside the report margins, whereas GhostScript (like other PDF printers) handles them correctly. See attachments.

Is this is known problem? Is there a fix for it? Perhaps I should post this as a new thread?
You do not have the required permissions to view the files attached to this post.

huiskala

Re: Unicode PDFs generated by TD 5.1 spat out by GhostScript

Post by huiskala » 23 Dec 2009, 11:04

davidpritchard wrote:So near, and yet so far... turns out that there's more wrong with the PDFTron PDFs than just non-compliant internal housekeeping.
Yes, there is more wrong...

We have encountered problems opening PDF files (generated by our TD5.1 application) in Mac OS X Preview, or PDF Xchange (in Windows XP or Vista). If fonts are not embedded in the PDF file, the file is totally unreadable, all the text is shown as some ugly characters like %¤&%#. In Adobe Reader 9.x (both in Windows and in Mac OS) everything is fine. There is an easy workaround, just embed the fonts... but this makes the file size up to 6 times bigger, which makes no sense if only Arial font is used.
davidpritchard wrote:Is this is known problem? Is there a fix for it? Perhaps I should post this as a new thread?
Maybe it would be a good idea to collect all the PDFTron related problems in a new topic?

davidpritchard
Spain
Posts: 46
Joined: 11 Sep 2018, 11:29
Location: Madrid, Spain

Re: Unicode PDFs generated by TD 5.1 spat out by GhostScript

Post by davidpritchard » 28 Dec 2009, 10:13

Good idea. I'll start by reposting my complaints, and then you add yours...

Return to “General Discussion”

Who is online

Users browsing this forum: [Ccbot] and 0 guests