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

Shunsaku Hirata shunsaku.hirata74 at gmail.com
Mon Aug 12 10:11:13 CEST 2019


Hi,

I further tried and probably have succeeded without
extending existing specials. I will test it and check if
there are any problems.

Please wait.

Thanks,
Shunsaku Hhirata

2019年8月12日(月) 13:09 Shunsaku Hirata <shunsaku.hirata74 at gmail.com>:
>
> Hi Ulrike,
>
> To address this issue, I tried several workaround which does not
> require extending existing specials or introducing new one, however,
> I found no satisfactory solution.
>
> So, I may need to consider extending pdf:pageresource.
> For example,
>
>   \special{pdf:pageresource /ExtGState @testextgs}
>
> With the above syntax, the content of @testextgs, which is reference
> to a dictionary object, is to be merged to page's ExtGState resource
> dictionary. (processed at the end of page)
>
> Any suggestions on this?
>
> > xdvipdfmx:fatal: typecheck: Invalid object type: 9 6 (line 1595)
>
> I will fix it later.
>
>
> Thanks,
> Shunsaku Hirata
>
>
> 2019年8月7日(水) 20:39 Ulrike Fischer <news3 at nililand.de>:
> >
> > 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