[luatex] Leaving a single PDF object uncompressed

Hans Hagen pragma at wxs.nl
Wed Jul 6 23:50:33 CEST 2016


On 7/6/2016 6:13 PM, Scott Pakin wrote:
> How can I leave a single PDF object stream uncompressed regardless of
> the compression level used for the rest of the document?
>
> For my hyperxmp LaTeX package, I need to leave the stream containing
> the XMP metadata uncompressed so non-PDF-aware tools can extract it.
> However, I don't want to leave the entire PDF file uncompressed just
> for the sake of my one object.  In pdfTeX, I can simply set
> \pdfcompresslevel=0 and create an object with \immediate\pdfobj both
> within a group, and everything works.  However, LuaTeX's
> \pdfcompresslevel (and now, \pdfvariable compresslevel) appears to be
> a global setting, which thwarts that approach.
>
> After a lot of searching I found that I can create an object in Lua
> using "pdf.obj { compresslevel = 0, ... }" to achieve the effect I
> want.  But is there a way I can do the same thing right from a
> \pdfextension obj, without having to define a Lua function?  I feel
> like I'm duplicating existing functionality.

\immediate\pdfobj uncompressed {...}

(there is some interference with compressed object streams that i need 
to look into but it's harmless)

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------


More information about the luatex mailing list