-
Notifications
You must be signed in to change notification settings - Fork 5
/
embedfile.pvt
55 lines (44 loc) · 2.13 KB
/
embedfile.pvt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
\PassOptionsToPackage{enable-debug,check-declarations}{expl3}
\RequirePackage[debug]{pdfmanagement-testphase}
\DeclareDocumentMetadata {pdfversion=1.6 }
\RequirePackage{pdfmanagement-regressiontest}
\documentclass{article}
\usepackage{hyperref}
\hypersetup{pdfpagemode=UseAttachments}
\begin{filecontents}[overwrite]{grüße.txt}
grüße
\end{filecontents}
\begin{document}
\section{Testing embedding and attaching files}
\ExplSyntaxOn
\group_begin:
\pdfdict_put:nnn {l_pdffile/Filespec} {AFRelationship}{/Source}
\pdf_string_from_unicode:nnN {utf16/string} {this~is~something~odd~with~öäü}\l_tmpa_str
\pdfdict_put:nnx {l_pdffile/Filespec} {Desc}{\l_tmpa_str}
\pdfdict_put:nnx {l_pdffile/Params} {ModDate}{(D:20200422135851Z)}
\pdffile_embed_file:nnn {testinput.txt}{grüße.txt}{example1}
\group_end:
\group_begin:
\pdfdict_put:nnn {l_pdffile/Filespec} {AFRelationship}{/Source}
\pdf_string_from_unicode:nnN {utf16/string} {this~is~something~odd~with~öäü}\l_tmpa_str
\pdfdict_put:nnx {l_pdffile/Filespec} {Desc}{\l_tmpa_str}
\pdfdict_put:nnx {l_pdffile/Params} {ModDate}{(D:20200422155851+02'00')}
\pdffile_embed_file:nnn {grüße.txt}{echtegrüße.txt}{example2}
\group_end:
\group_begin:
\pdfdict_put:nnn {l_pdffile/Filespec} {AFRelationship}{/Source}
\pdfdict_put:nnn {l_pdffile/Filespec} {Desc}{(this~is~a~eps)}
\pdfdict_put:nnx {l_pdffile/Params} {ModDate}{(D:20200422135851Z)}
\pdffile_embed_file:nnn {testinput.txt}{Some~txt~file}{example3}
\pdfdict_put:nnn {l_pdffile/Filespec} {AFRelationship}{/Data}
\pdfdict_put:nnn {l_pdffile/Filespec} {Desc}{(this~is~a~text~file)}
\pdffile_embed_stream:nnn {stream content} {Some~stream} {example4}
\pdfmanagement_add:nnx{Catalog/Names}{EmbeddedFiles}{\pdf_object_ref:n{example1}}
\pdfmanagement_add:nnx{Catalog/Names}{EmbeddedFiles}{\pdf_object_ref:n{example2}}
\pdfmanagement_add:nnx{Catalog/Names}{EmbeddedFiles}{\pdf_object_ref:n{example3}}
\pdfmanagement_add:nnx{Catalog/Names}{EmbeddedFiles}{\pdf_object_ref:n{example4}}
%\prop_show:N \g__pdffile_file_embed_sources_prop
%\seq_show:N \g__pdf_backend_EmbeddedFiles_seq
%\prop_show:N \g__pdf_backend_EmbeddedFiles_named_prop
\group_end:
\end{document}