diff options
Diffstat (limited to 'macros/latex/contrib/newpax/newpax.dtx')
-rw-r--r-- | macros/latex/contrib/newpax/newpax.dtx | 63 |
1 files changed, 19 insertions, 44 deletions
diff --git a/macros/latex/contrib/newpax/newpax.dtx b/macros/latex/contrib/newpax/newpax.dtx index 0d32683bd4..01f68546dd 100644 --- a/macros/latex/contrib/newpax/newpax.dtx +++ b/macros/latex/contrib/newpax/newpax.dtx @@ -2,7 +2,7 @@ % % File: newpax.dtx % Copyright 2006-2008, 2011, 2012 Heiko Oberdiek (original pax.sty) -% Copyright (C) 2021, 2022 Ulrike Fischer +% Copyright (C) 2021 Ulrike Fischer % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -29,7 +29,7 @@ %<@@=newpax> \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{newpax}% - [2022-06-27 v0.52 Annotation support for PDF graphics based on pax.sty adapted by (UF)]% + [2021-03-07 v0.51 Annotation support for PDF graphics based on pax.sty adapted by (UF)]% \ExplSyntaxOn \bool_if:nF { @@ -702,7 +702,7 @@ local ProvidesLuaModule = { name = "newpax", version = "0.52", --TAGVERSION - date = "2022-06-27", --TAGDATE + date = "2022-09-11", --TAGDATE description = "newpax lua code", license = "The LATEX Project Public License 1.3c" } @@ -893,7 +893,7 @@ end -- XXXXXX encode/escape the file name? local function outputENTRY_file (file, pdfedoc) local bytes = GETSIZE(pdfedoc) - local date = GETINFO(pdfedoc).CreationDate + local date = (GETINFO(pdfedoc) and GETINFO(pdfedoc).CreationDate) or "D:22222222222222" -- file local a = strENTRY_BEG a = a .. strCMD_BEG .. constCMD_FILE .. strCMD_END @@ -1031,48 +1031,24 @@ local function outputKV_N (pdfedict) return a end --- if a gotoR has a filespec filespec we use this --- to output the reference. It is rather crude and handles only names and strings -local function outputDICT (dictionary) - local dict = DICTIONARYTOTABLE(dictionary) - local a = "<<" - for k,v in pairs (dict) do - a = a .. strNAME.. k - if v[1]== 5 then -- it is a name - b = string.gsub(v[2], "/", "#2F") - a = a .. strNAME .. b - elseif v[1] == 6 then -- it is a string - local b - if v[3] then - b = "<" .. v[2] .. ">" - else - b = "(" .. v[2] .. ")" - end - a = a ..strRECT_SEP .. b - -- everything else is ignored for now! - end - end - a = a .. ">>" - return a -end - local function outputKV_gotor (pdfedict) -- action dictionary - local type, value, hex = GETFROMDICTIONARY(pdfedict,"F") - local desttype, destvalue, destdetail = GETFROMDICTIONARY(pdfedict,"D") + local type, value, desttype, destvalue, hex + local checktype, checkvalue, checkhex = GETFROMDICTIONARY(pdfedict,"F") + if checktype==10 then + -- TODO resolve reference deeper!! + local a,b,c= GETFROMREFERENCE(checkvalue) + type, value, hex = GETFROMDICTIONARY(b,"F") + desttype,destvalue = GETFROMDICTIONARY(b,"D") + else + value=checkvalue + desttype,destvalue = GETFROMDICTIONARY(pdfedict,"D") + end local a = strKV_BEG .. constKEY_FILE .. strVALUE_BEG - if TYPE(value) == "pdfe.reference" then - local x,dictionary = GETFROMREFERENCE(value) - if TYPE(dictionary) == "pdfe.dictionary" then - a = a .. outputDICT (dictionary) - else - print("ERROR!? this is not a dictionary!!") - end + a = strKV_BEG .. constKEY_FILE .. strVALUE_BEG + if hex then + a = a .. strHEX_STR_BEG .. value .. strHEX_STR_END else - if hex then - a = a .. strHEX_STR_BEG .. value .. strHEX_STR_END - else - a = a .. strLIT_STR_BEG .. value .. strLIT_STR_END - end + a = a .. strLIT_STR_BEG .. value .. strLIT_STR_END end a = a .. strVALUE_END .. strKV_END if desttype == 7 then @@ -1087,7 +1063,6 @@ local function outputKV_gotor (pdfedict) -- action dictionary return a end - local function outputKV_goto (count) local a = strKV_BEG .. constKEY_DEST_LABEL .. strVALUE_BEG .. count .. strVALUE_END .. strKV_END return a |