[dvipdfmx] \special{pdf:pageresources and named objects

Ulrike Fischer news3 at nililand.de
Wed Aug 7 13:39:21 CEST 2019


Hello Shunsaku,

> However, if, like your examples, resource dictionary is provided as
> an indirect reference (@testextgs is replaced by an indirect reference
> when it is parsed), dvipdfmx can't handle it nicely.
> Dvipdfmx need to protect page resources from being overwritten.

Yes, I understand the problem.

But while not using an named object but a direct value does work on
its own, it doesn't work if the document also use
\special{pdf:put @resources ..} with a named object:


\documentclass{article}

\usepackage{l3pdf}
\ExplSyntaxOn
\pdf_uncompress:
\ExplSyntaxOff

\begin{document}
\special{pdf:obj @testextgs <<>>}
\special{pdf:pageresources   << /ExtGState << /bearopacity <</ca 1/CA 1>>>> >>}
\special{pdf:put @resources  << /ExtGState @testextgs >>} %as with tikz ...
%\special{pdf:put @resources << /ExtGState << /duckopacity <</ca 0.7/CA 0.7>>>> >>}
bbcc
\end{document}

gives

xdvipdfmx:fatal: typecheck: Invalid object type: 9 6 (line 1595)

(You get a similar error if you mix the syntax of two pdf:put
@resources)


As pgf/tikz uses
 \special{pdf:put @resources <</ExtGState @pgfextgs >>}
this means that \special{pdf:pageresources ..} is not really
usable currently in a real latex document.


-- 
Mit freundlichen Grüßen
Ulrike Fischer







am Mittwoch, 7. August 2019 um 00:21 schrieben Sie:

> Hi Ulrike,

> For pdf:pageresources, dvipdfmx tries to merge provided resource
> dicrionary to an existing one instead of replacing it, since dvipdfmx
> may use its own definitions of resources internally maintained and
> wants to preserve it (otherwise output is corrupted).

> However, if, like your examples, resource dictionary is provided as
> an indirect reference (@testextgs is replaced by an indirect reference
> when it is parsed), dvipdfmx can't handle it nicely.
> Dvipdfmx need to protect page resources from being overwritten.

> I need to consider how to lift this restriction but I guess there must
> be some other specials than pdf:pageresources.

> Thanks,
> Shunsaku Hirata



> 2019年8月6日(火) 22:39 Ulrike Fischer <news3 at nililand.de>:
>>
>> Hello,
>>
>> with \special{pdf:put @resources ...}
>> I can without problems use a named object:
>>
>> \documentclass{article}
>>
>> \usepackage{l3pdf}
>> \ExplSyntaxOn
>> \pdf_uncompress:
>>
>> \ExplSyntaxOff
>>
>> \begin{document}
>> \special{pdf:obj @testextgs <<>>}
>> \special{pdf:put @resources << /ExtGState @testextgs >>}
>> \special{pdf:put @testextgs << /bearopacity <</ca 1/CA 1>>>>}
>> \special{pdf:put @testextgs << /duckopacity <</ca 0.7/CA 0.7>>>>}
>> abc
>> \end{document}
>>
>> The resource is filled and added to the page resource:
>>
>> 8 0 obj
>> <</ExtGState 4 0 R/Font<</F1 6 0 R>>/ProcSet[/PDF/Text/ImageC/ImageB/ImageI]>>
>> endobj
>>
>> But when I try the same with the new pdf:pageresources
>> the /ExtGState entrie is missing in the resource dictionary:
>>
>> \documentclass{article}
>>
>> \usepackage{l3pdf}
>> \ExplSyntaxOn
>> \pdf_uncompress:
>> \ExplSyntaxOff
>>
>> \begin{document}
>> \special{pdf:obj @testextgs <<>>}
>> \special{pdf:pageresources <</ExtGState @testextgs>>}
>> \special{pdf:put @testextgs << /bearopacity <</ca 1/CA 1>>>>}
>> \special{pdf:put @testextgs << /duckopacity <</ca 0.7/CA 0.7>>>>}
>> abc
>> \end{document}
>>
>> 8 0 obj
>> <</Font<</F1 6 0 R>>/ProcSet[/PDF/Text/ImageC/ImageB/ImageI]>>
>> endobj
>>
>>
>> Is this a bug or do I'm using it wrong?
>>
>> --
>> Mit freundlichen Grüßen
>> Ulrike Fischer
>> mailto:news3 at nililand.de
>>
>>






More information about the dvipdfmx mailing list