summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/l3experimental/l3pdf/l3pdf.sty
blob: bb5772c97e8cc2f3e5192a03c3d96a01f0f45f49 (plain)
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
%%
%% This is file `l3pdf.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% l3pdf.dtx  (with options: `package')
%% 
%% Copyright (C) 2019,2020 The LaTeX3 Project
%% 
%% It may be distributed and/or modified under the conditions of
%% the LaTeX Project Public License (LPPL), either version 1.3c of
%% this license or (at your option) any later version.  The latest
%% version of this license is in the file:
%% 
%%    http://www.latex-project.org/lppl.txt
%% 
%% This file is part of the "l3pdf bundle" (The Work in LPPL)
%% and all files in that bundle must be distributed together.
%% 
%% File: l3pdf.dtx
\RequirePackage{expl3}
\ProvidesExplPackage{l3pdf}{2020-08-07}{}
  {L3 Experimental core PDF support}
\scan_new:N \s__pdf_stop
\bool_new:N \g__pdf_init_bool
\cs_if_exist:NT \documentclass
  {
    \AtBeginDocument
      { \bool_gset_true:N \g__pdf_init_bool }
  }
\cs_new_protected:Npn \pdf_uncompress:
  {
    \bool_if:NF \g__pdf_init_bool
      {
        \__pdf_backend_compresslevel:n { 0 }
        \__pdf_backend_compress_objects:n { \c_false_bool }
      }
  }
\cs_new_protected:Npn \pdf_object_new:nn #1#2
  { \__pdf_backend_object_new:nn {#1} {#2} }
\prg_new_conditional:Npnn \pdf_object_if_exist:n #1 { p , T , F , TF }
  {
    \int_if_exist:cTF { c__pdf_backend_object_ \tl_to_str:n {#1} _int }
     { \prg_return_true: }
     { \prg_return_false:}
  }
\cs_new_protected:Npn \pdf_object_write:nn #1#2
  { \__pdf_backend_object_write:nn {#1} {#2} }
\cs_generate_variant:Nn \pdf_object_write:nn { nx }
\cs_new:Npn \pdf_object_ref:n #1 { \__pdf_backend_object_ref:n {#1} }
\cs_new_protected:Npn \pdf_object_now:nn #1#2
  { \__pdf_backend_object_now:nn {#1} {#2} }
\cs_generate_variant:Nn \pdf_object_now:nn { nx }
\cs_new:Npn \pdf_object_last: { \__pdf_backend_object_last: }
\prg_new_conditional:Npnn \pdf_version_compare:Nn #1#2 { p , T , F , TF }
  { \use:c { __pdf_version_compare_ #1 :w } #2 . . \s__pdf_stop }
\cs_new:cpn { __pdf_version_compare_=:w } #1 . #2 . #3 \s__pdf_stop
 {
   \bool_lazy_and:nnTF
    { \int_compare_p:nNn \__pdf_backend_version_major: = {#1} }
    { \int_compare_p:nNn \__pdf_backend_version_minor: = {#2} }
    { \prg_return_true: }
    { \prg_return_false: }
 }
\cs_new:cpn { __pdf_version_compare_<:w } #1 . #2 . #3 \s__pdf_stop
 {
   \bool_lazy_or:nnTF
    { \int_compare_p:nNn \__pdf_backend_version_major: < {#1} }
    {
      \bool_lazy_and_p:nn
        { \int_compare_p:nNn \__pdf_backend_version_major: = {#1} }
        { \int_compare_p:nNn \__pdf_backend_version_minor: < {#2} }
    }
    { \prg_return_true: }
    { \prg_return_false: }
 }
\cs_new:cpn { __pdf_version_compare_>:w } #1 . #2 . #3 \s__pdf_stop
 {
   \bool_lazy_or:nnTF
    { \int_compare_p:nNn \__pdf_backend_version_major: > {#1} }
    {
      \bool_lazy_and_p:nn
        { \int_compare_p:nNn \__pdf_backend_version_major: = {#1} }
        { \int_compare_p:nNn \__pdf_backend_version_minor: > {#2} }
    }
    { \prg_return_true: }
    { \prg_return_false: }
 }
\cs_new_protected:Npn \pdf_version_gset:n #1
  { \__pdf_version_gset:w  #1 . . \s__pdf_stop }
\cs_new_protected:Npn \pdf_version_min_gset:n #1
  {
    \pdf_version_compare:NnT < {#1}
      { \__pdf_version_gset:w  #1 . . \s__pdf_stop }
  }
\cs_new_protected:Npn \__pdf_version_gset:w  #1 . #2 . #3\s__pdf_stop
  {
    \bool_if:NF \g__pdf_init_bool
      {
        \__pdf_backend_version_major_gset:n {#1}
        \__pdf_backend_version_minor_gset:n {#2}
      }
  }
\cs_new:Npn \pdf_version:
  { \__pdf_backend_version_major: . \__pdf_backend_version_minor: }
\cs_new:Npn \pdf_version_major: { \__pdf_backend_version_major: }
\cs_new:Npn \pdf_version_minor: { \__pdf_backend_version_minor: }
%% 
%%
%% End of file `l3pdf.sty'.