[poppler] What is wrong with this piece of PostScript code?
Alex Korobkin
korobkin+pp at gmail.com
Thu Apr 25 14:04:24 PDT 2013
Hi all,
I have a PostScript file generated from a PDF by pdftops 0.22.3, which
cannot be interpreted neither by printer nor by GhostScript. I figured that
removing this stance of code (marked with >) makes GhostScript happy, but
cannot understand what exactly is wrong with it.
Here is the code:
0 0 Td
[1 0 0 -1 139 18] Tm
0 0 Td
> /F12_0 13.3333 Tf
> (\012\355)
> [13.3333
> 0] Tj
> [1 0 0 1 0 0] Tm
> 0 0 Td
> [1 0 0 -1 139 18] Tm
> 0 0 Td
/F11_0 13.3333 Tf
(\000\003)
[3.704417
F12_0 represents embedded DejaVuSans font.
I assume that Tj is a standard procedure inserted by poppler, but will copy
it here just in case:
/Tj {
fCol
0 pdfTextRise pdfTextMat dtransform rmoveto
currentpoint 4 2 roll
pdfTextRender 1 and 0 eq {
2 copy xyshow2
} if
pdfTextRender 3 and dup 1 eq exch 2 eq or {
3 index 3 index moveto
2 copy
currentfont /FontType get 3 eq { fCol } { sCol } ifelse
xycp currentpoint stroke moveto
} if
pdfTextRender 4 and 0 ne {
4 2 roll moveto xycp
/pdfTextClipPath [ pdfTextClipPath aload pop
{/moveto cvx}
{/lineto cvx}
{/curveto cvx}
{/closepath cvx}
pathforall ] def
currentpoint newpath moveto
} {
pop pop pop pop
} ifelse
0 pdfTextRise neg pdfTextMat dtransform rmoveto
} def
Here is how GhostScript complains about it:
...
resmp FindResource beg F12_0
resmp FindResource end
Error: /rangecheck in --xyshow--
Operand stack:
139.0 18.0 (\n\355) --nostringval-- (\n\355) --nostringval--
Execution stack:
%interp_exit .runexec2 --nostringval-- --nostringval--
--nostringval-- 2 %stopped_push --nostringval-- --nostringval--
--nostringval-- false 1 %stopped_push 1862 1 3 %oparray_pop
1861 1 3 %oparray_pop 1845 1 3 %oparray_pop 1739 1 3
%oparray_pop --nostringval-- %errorexec_pop .runexec2
--nostringval-- --nostringval-- --nostringval-- 2 %stopped_push
--nostringval-- --nostringval--
Dictionary stack:
--dict:1158/1684(ro)(G)-- --dict:1/20(G)-- --dict:85/200(L)--
--dict:74/75(L)-- --dict:19/25(L)-- --dict:0/15(L)-- --dict:0/15(L)--
--dict:10/15(L)--
Current allocation mode is local
Last OS error: Resource temporarily unavailable
Current file position is 345679
GPL Ghostscript 9.06: Unrecoverable error, exit code 1
I assume the problem is with how the original PDF embeds the font, but
cannot really understand why Tj would fail on those parameters.
Could someone please have a look and give me a hint on why is this
happening?
Thanks in advance.
Unfortunately, the original doc cannot be provided because it's full of
confidential information.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/poppler/attachments/20130425/9284857e/attachment.html>
More information about the poppler
mailing list