View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000995luatexluatex bugpublic2017-01-18 22:332017-03-27 17:09
Assigned ToHans Hagen 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0000995: Embedding object via `\immediate\pdfextension obj` causes large parts of the PDF being written uncompressed
DescriptionI'm using LuaTeX 0.95.0 (TeXLive 2016) on Arch Linux.
When I embed an object via \immediate\pdfextension obj the size of the output PDF rises dramatically because large (all following?) parts of the file are now written uncompressed.
Steps To ReproduceMWE:


Embedded File

\immediate\pdfextension obj file{embed.file}
%\immediate\pdfobj file{embed.file} % for pdfLaTeX


LuaLaTeX: Resulting file size is 28,903 Bytes
Without the embedded object: 21,320 Bytes
Compare pdfLaTeX: 21,441 Bytes with embedded object, 21,349 Bytes without.
Additional InformationTriggered the problem while trying to embed an ICC profile.
Current workaround is embedding the object at the end of the document

  \immediate\pdfextension obj file{embed.file}

Brings file size down from 950k to 250k for my 30-something-page document.
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
Hans Hagen (manager)
2017-01-19 19:22

this can relate to the macro package setting object compression so a pure low level tex example demonstrating this is needed (maybe begindocument sets the compression or so)
rwirth (reporter)
2017-01-20 13:58

\input plipsum

\immediate\pdfextension obj file{embed.file}


21,916 Bytes with embedded obj, 19,262 Bytes without.
Using the same `embed.file` (130 Bytes) that was generated by the LaTeX MWE. The file with the embedded object doesn't have any compressed object streams (/Filter/FlateDecode is not present in output PDF) while all streams in the file without the embedded object are compressed. Exchanging the lipsum and the embed has no influence on file size.

If I do

\immediate\pdfextension obj file{embed.file}

to ship out the page before adding the object, the whole file is compressed and it stays that way when I add further text or pages. The first page seems to be magic.
luigi scarso (developer)
2017-01-23 09:30

I cannot reproduce it with luatex 1.0.1
# cat test-2.tex
\input plipsum

\immediate\pdfextension obj file{embed.file}


# luatex test-2.tex
This is LuaTeX, Version 1.0.1 (TeX Live 2017/dev)

Output written on test-2.pdf (1 page, 19342 bytes).

# cat test-3.tex
\input plipsum

%\immediate\pdfextension obj file{embed.file}


# luatex test-3.tex
This is LuaTeX, Version 1.0.1 (TeX Live 2017/dev)
Output written on test-3.pdf (1 page, 19253 bytes).

- Issue History
Date Modified Username Field Change
2017-01-18 22:33 rwirth New Issue
2017-01-19 19:22 Hans Hagen Note Added: 0001660
2017-01-20 13:58 rwirth Note Added: 0001669
2017-01-23 09:30 luigi scarso Note Added: 0001670
2017-03-27 17:09 Hans Hagen Status new => closed
2017-03-27 17:09 Hans Hagen Assigned To => Hans Hagen
2017-03-27 17:09 Hans Hagen Resolution open => fixed

Copyright © 2000 - 2012 MantisBT Group
Powered by Mantis Bugtracker