summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/media9/pdfbase.sty
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/media9/pdfbase.sty')
-rw-r--r--macros/latex/contrib/media9/pdfbase.sty118
1 files changed, 72 insertions, 46 deletions
diff --git a/macros/latex/contrib/media9/pdfbase.sty b/macros/latex/contrib/media9/pdfbase.sty
index 61397e2a15..b61b8b56aa 100644
--- a/macros/latex/contrib/media9/pdfbase.sty
+++ b/macros/latex/contrib/media9/pdfbase.sty
@@ -158,12 +158,12 @@
\RequirePackage{l3keys2e}
-\def\g@pbs@date@tl{2021/07/28}
-\def\g@pbs@version@tl{0.49}
+\def\g@pbs@date@tl{2021/07/29}
+\def\g@pbs@version@tl{0.50}
\NeedsTeXFormat{LaTeX2e}[2020-10-01]
\ProvidesExplPackage{pdfbase}{\g@pbs@date@tl}{\g@pbs@version@tl}
-{driver independent access to low-level PDF features}
+{driver~independent~access~to~low-level~PDF~features}
\int_new:N\g_pbs_page_int %abs. page counter
@@ -1083,13 +1083,19 @@
}{
\tl_use:c{scale_{pbs@obj\int_use:N\g_pbs_obj_int}}
}
- %store dimensions in "dots" units (DPI)
+ %store content dimensions in DPI units (Dots)
\tl_set:Nx\l_pbs_width_tl{
- \dim_to_decimal:n{\box_wd:N#5}~72.27~div~Resolution~mul~}
+ \dim_to_decimal_in_sp:n{\box_wd:N#5}~65536~div~72.27~div~DVImag~mul~
+ Resolution~mul~
+ }
\tl_set:Nx\l_pbs_height_tl{
- \dim_to_decimal:n{\box_ht:N#5}~72.27~div~VResolution~mul~}
+ \dim_to_decimal_in_sp:n{\box_ht:N#5}~65536~div~72.27~div~DVImag~mul~
+ VResolution~mul~
+ }
\tl_set:Nx\l_pbs_depth_tl{
- \dim_to_decimal:n{\box_dp:N#5}~72.27~div~VResolution~mul~}
+ \dim_to_decimal_in_sp:n{\box_dp:N#5}~65536~div~72.27~div~DVImag~mul~
+ VResolution~mul~
+ }
%additional dict entries
\tl_set:Nx\l_tmpa_tl{#4} \tl_trim_spaces:N\l_tmpa_tl
\pbs_special:n{
@@ -1122,29 +1128,36 @@
%distill graphics to XObject
mark~
/_objdef~{pbs@obj\int_use:N\g_pbs_obj_int}~
- /BBox~[
- isls {
- landplus90 {
- % geometry with landscape
- \l_pbs_height_tl~neg~\l_pbs_width_tl~\l_pbs_depth_tl~0
+ /BBox~[ % rotated BBoxes; o = reference point = origin (0,0),
+ isls { % x = top-left page corner, vert. coord downwards positive
+ landplus90 { % x----o-+
+ % geometry with landscape | | |
+ \l_pbs_height_tl~neg~ % llx | | |
+ \l_pbs_width_tl~ % lly | | |
+ \l_pbs_depth_tl~0 % urx ury +----+-+
}{
- % landscape as class option
- \l_pbs_depth_tl~neg~0~\l_pbs_height_tl~\l_pbs_width_tl~neg
- } ifelse
+ % landscape as class option x-+----+
+ \l_pbs_depth_tl~neg~0~ % llx lly | | |
+ \l_pbs_height_tl~ % urx | | |
+ \l_pbs_width_tl~neg % ury | | |
+ } ifelse % +-o----+
}{
- % portrait
- 0~\l_pbs_height_tl~\l_pbs_width_tl~\l_pbs_depth_tl~neg
- } ifelse
- ]
+ % portrait x----------+
+ 0~\l_pbs_height_tl~ % llx lly | |
+ \l_pbs_width_tl~ % urx o----------+
+ \l_pbs_depth_tl~neg % ury | |
+ } ifelse % | |
+ ] % +----------+
%insert additional dict entries (the Distiller way)
\str_if_eq:eeF{\l_tmpa_tl}{}{
product~(Distiller)~search~{pop~pop~pop~\l_tmpa_tl}{pop}ifelse~
}
/BP~pdfmark~grestore~
- % content transformations required for appearances
- {
- pbs@curx~pbs@cury~2~copy~translate~1~-1~scale~
- isls {90~landplus90 {neg} if~rotate} if~
+ % content transformations required for appearances, cf. BBox
+ { % orientations above
+ pbs@curx~pbs@cury~2~copy~translate~1~
+ -1~scale~ % upside-down (mirrored)
+ isls {90~landplus90 {neg} if~rotate} if~ % rotated
neg~exch~neg~exch~translate
}?pdfmark
}
@@ -1509,8 +1522,8 @@
\RequirePackage{l3keys2e}
-\def\g@pbs@date@tl{2021/07/28}
-\def\g@pbs@version@tl{0.49}
+\def\g@pbs@date@tl{2021/07/29}
+\def\g@pbs@version@tl{0.50}
\NeedsTeXFormat{LaTeX2e}[2020-10-01]
\ProvidesExplPackage{pdfbase}{\g@pbs@date@tl}{\g@pbs@version@tl}
@@ -1607,7 +1620,7 @@
\bool_if:NF\g_pbs_dvisvgm_bool{\bool_gset_true:N\g_pbs_dvipdfmx_bool}
}
-% writing to core objects in the PDF, using the new
+% writing to core objects in the PDF, using the new
% pdfmanagement interface
\cs_new_protected_nopar:Nn\pbs_appendtofields:n{
\pdfmanagement_add:nnx{Catalog/AcroForm}{Fields}{#1}
@@ -2384,13 +2397,19 @@
}{
\tl_use:c{scale_{pbs@obj\int_use:N\g_pbs_obj_int}}
}
- %store dimensions (in "dots" units)
+ %store content dimensions in DPI units (Dots)
\tl_set:Nx\l_pbs_width_tl{
- \dim_to_decimal:n{\box_wd:N#5}~72.27~div~Resolution~mul~}
+ \dim_to_decimal_in_sp:n{\box_wd:N#5}~65536~div~72.27~div~DVImag~mul~
+ Resolution~mul~
+ }
\tl_set:Nx\l_pbs_height_tl{
- \dim_to_decimal:n{\box_ht:N#5}~72.27~div~VResolution~mul~}
+ \dim_to_decimal_in_sp:n{\box_ht:N#5}~65536~div~72.27~div~DVImag~mul~
+ VResolution~mul~
+ }
\tl_set:Nx\l_pbs_depth_tl{
- \dim_to_decimal:n{\box_dp:N#5}~72.27~div~VResolution~mul~}
+ \dim_to_decimal_in_sp:n{\box_dp:N#5}~65536~div~72.27~div~DVImag~mul~
+ VResolution~mul~
+ }
%additional dict entries
\tl_set:Nx\l_tmpa_tl{#4} \tl_trim_spaces:N\l_tmpa_tl
\pbs_special:n{
@@ -2423,29 +2442,36 @@
%distill graphics to XObject
mark~
/_objdef~{pbs@obj\int_use:N\g_pbs_obj_int}~
- /BBox~[
- isls {
- landplus90 {
- % geometry with landscape
- \l_pbs_height_tl~neg~\l_pbs_width_tl~\l_pbs_depth_tl~0
+ /BBox~[ % rotated BBoxes; o = reference point = origin (0,0),
+ isls { % x = top-left page corner, vert. coord downwards positive
+ landplus90 { % x----o-+
+ % geometry with landscape | | |
+ \l_pbs_height_tl~neg~ % llx | | |
+ \l_pbs_width_tl~ % lly | | |
+ \l_pbs_depth_tl~0 % urx ury +----+-+
}{
- % landscape as class option
- \l_pbs_depth_tl~neg~0~\l_pbs_height_tl~\l_pbs_width_tl~neg
- } ifelse
+ % landscape as class option x-+----+
+ \l_pbs_depth_tl~neg~0~ % llx lly | | |
+ \l_pbs_height_tl~ % urx | | |
+ \l_pbs_width_tl~neg % ury | | |
+ } ifelse % +-o----+
}{
- % portrait
- 0~\l_pbs_height_tl~\l_pbs_width_tl~\l_pbs_depth_tl~neg
- } ifelse
- ]
+ % portrait x----------+
+ 0~\l_pbs_height_tl~ % llx lly | |
+ \l_pbs_width_tl~ % urx o----------+
+ \l_pbs_depth_tl~neg % ury | |
+ } ifelse % | |
+ ] % +----------+
%insert additional dict entries (the Distiller way)
\str_if_eq:eeF{\l_tmpa_tl}{}{
product~(Distiller)~search~{pop~pop~pop~\l_tmpa_tl}{pop}ifelse~
}
/BP~pdfmark~grestore~
- % content transformations required for appearances
- {
- pbs@curx~pbs@cury~2~copy~translate~1~-1~scale~
- isls {90~landplus90 {neg} if~rotate} if~
+ % content transformations required for appearances, cf. BBox
+ { % orientations above
+ pbs@curx~pbs@cury~2~copy~translate~1~
+ -1~scale~ % upside-down (mirrored)
+ isls {90~landplus90 {neg} if~rotate} if~ % rotated
neg~exch~neg~exch~translate
}?pdfmark
}