Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

l3backend-dvips: embedding a file in stream doesn't work #710

Closed
u-fischer opened this issue Apr 24, 2020 · 0 comments
Closed

l3backend-dvips: embedding a file in stream doesn't work #710

u-fischer opened this issue Apr 24, 2020 · 0 comments

Comments

@u-fischer
Copy link
Member

This document doesn't embed the file but outputs parts of the arguments:

image

\documentclass{article}
\usepackage{l3pdf}
\begin{filecontents}[overwrite]{testinput.tex}
blub
\end{filecontents}
\begin{document}
\showoutput
abc
\ExplSyntaxOn
\pdf_object_new:nn {test} {fstream}
\pdf_object_write:nn {test}{
        {/Type/EmbeddedFile}
        {testinput.tex}
      }
\ExplSyntaxOff
\end{document}

The problem is that \__pdf_backend_object_write_fstream:nn is not define but used in a \use:c{}.

The following definitions seem to work.

Side remark: ps2pdf refuses to insert the file unless one uses the option -dNOSAFER or e.g. --permit-file-read=* . Also ps2pdf can not find files with kpathsea. These restrictions should perhaps be documented.

\cs_new_protected:Npn \__pdf_backend_object_write_fstream:nn #1#2
  {
    \exp_args:Nx
      \__pdf_backend_object_write_fstream:nnn {#1} #2
  }

\cs_new_protected:Npn \__pdf_backend_object_write_fstream:nnn #1#2#3
  {
    \__kernel_backend_literal:n
      { ps::[nobreak]~
        SDict ~ begin ~
        mark ~ #1 ~ << #2 >> /PUT ~ pdfmark ~
        mark ~ #1 ~ ( #3 )~ (r)~ file ~ /PUT ~ pdfmark ~
        end
      }
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant