[poppler] Bug 69485

Ross Moore ross.moore at mq.edu.au
Sat Jan 4 13:22:05 PST 2014


Hi Adrian,

On 04/01/2014, at 1:39 PM, Adrian Johnson wrote:


>> Ross, 
>> thanks a lot for the detailed analysis. 
>> 
>> 
>>    I tried turning it into a procedure and it fails with ghostscript and my
>>    printer. It turns out it was correct. See example 4.26 on p311 of the PS
>>    Ref.
>> 
>> Adrian, 
>> I'm not sure I fully understand your answer. Do you think this
>> PostScript code is actually correct?
> 
> The PostScript code is correct. I've updated cairo to remove the
> duplicate /Interpolate but it was not incorrect. According to p568 of
> the PLR if "def" is used when the key already exists the existing value
> is overwritten. So the dict size of 8 is not exceeded but even if it was
> according to p572 with language level 2 and 3 the dict size is
> automatically increased if the initial size is exceeded.
> 
> The DataSource is correct. The filter operator returns a file object.
> The sequence "currentfile /ASCII85Decode filter /FlateDecode" results in
> a single file object on the stack which meets the requirement that the
> data source must be a file, procedure, or string.

Yes, the syntax here is indeed correct.

I've done a lot more testing now and think that I know the reason
for the problems.
It is a matter of context, not the syntax per se.

Let's look at a larger chunk of the PS source:

>> << /PatternType 1
>>    /PaintType 1
>>    /TilingType 1
>>    /XStep 2190 /YStep 2190
>>    /BBox [0 0 24 15]
>>    /PaintProc { CairoPattern }
>> >>
>> [ 0.652971 0 0 0.652968 83.654401 292.766344 ]
>> makepattern setpattern
>> q
>> 83 303 17 -11 re W n
>> [ 0.652971 0 0 0.652968 83.654401 292.766344 ] concat
>> 8 dict dup begin
>>   /ImageType 1 def
>>   /Width 24 def
>>   /Height 15 def
>>   /Interpolate false def
>>   /BitsPerComponent 1 def
>>   /Decode [ 1 0 ] def
>>   /DataSource currentfile  
>>     /ASCII85Decode filter /FlateDecode filter def
>>  % /Interpolate false def
>>   /ImageMatrix [ 1 0 0 -1 0 15 ] def
>> end
>> imagemask
>> Gar8O!!3<."p5&6Mu*H<lMpm`s8T;%s*la!#Nl!cb6!e-!5&ILgA~>
>> Q

The  makepattern setpattern  has changed the Colorspace to become
that of a Pattern .
None of the operators following this have changed the Colorspace,
but the coding then tries to define a new pattern/image dictionary
via  imagemask .
This is the dubious operation, within such a Colorspace context.

To get what I think you want, you need to switch the Colorspace to
/DeviceRGB (or /DeviceCMYK or similar).

e.g. just insert a single line, as below, 

>> makepattern setpattern
>> 1 0 0 setrgbcolor
>> q
>> 83 303 17 -11 re W n


or 

>> makepattern setpattern
>> q
>> 1 0 0 setrgbcolor
>> 83 303 17 -11 re W n

This indeed results in file processing fully,
showing the red arrow.


In summary, within a complicated Colorspace, you seem not to be able
to setup a Pattern, which is kind of setting up for a new Colorspace.

Whether this is meant to be a feature of the PS language, or is
a criterion imposed by Distiller, is the bit that I do not yet know.

> 
> Another observation is that the PS output you attached is not the direct
> output of pdftocairo. It has CUPS stuff inserted into it. Maybe you
> could try printing with the pdftocairo output without any additional
> filtering to see if it makes a difference. See the lpr man page.
> Something like "lpr -l" should bypass all filtering.



Hope this helps,

	Ross

------------------------------------------------------------------------
Ross Moore                                       ross.moore at mq.edu.au 
Mathematics Department                           office: E7A-206      
Macquarie University                             tel: +61 (0)2 9850 8955
Sydney, Australia  2109                          fax: +61 (0)2 9850 8114
------------------------------------------------------------------------

-------------- next part --------------
A non-text attachment was scrubbed...
Name: logo.png
Type: image/png
Size: 5257 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/poppler/attachments/20140105/79b4fb31/attachment.png>
-------------- next part --------------



More information about the poppler mailing list