On 26-3-2010 6:53, Michail Vidiassov wrote:
lpdf-u3d.lua
if not stream then local attr = pdfdictionary { Type = pdfconstant("3D"), - Subtype = pdfconstant("U3D"), } + if string.upper(string.sub(foundname,-4))==".PRC" then + attr.Subtype = pdfconstant("PRC") + else + attr.Subtype = pdfconstant("U3D") + end local streamviews = checkedkey(streamparam, "views", "table") if streamviews then local list = pdfarray()
May be a more robust way is to read first 3 bytes of the model file, since "U3D" or "PRC" signature is always there - that can be done instead of relying on file name extension or only in case it it not "u3d" or "prc".
more like: local subtype, subdata = "U3D", io.readdata(foundname) or "" if find(subdata,"^PRC") then subtype == "PRC" elseif find(subdata,"^U3D") then subtype == "U3D" elseif file.extname(foundname) == "prc" then subtype == "PRC" end
Also PRC annotations have to trigger setting PDF version to 1.7.3 (developer extensions dictionary mechanism). It can be done per your advice directly
\doPDFaddtocatalog { /Extensions <
}
But what about an interface like \pdfmicroversion and automatic pushing up of PDF version once PRC annontation happens?
i don't know that command and anyway want to get rid of all commands that start with \pdf concerning versions ... peter rolf and i are working on detailed support for standards (also related to preflighting) and before i even want to look in some automated version handling we first need to get that bit done well
Also I try to remind you about pdfboolean problem in lpdf-ini.lua (old code is not OK if b is "false" and default is "true")
local function pdfboolean(b,default) - if ((type(b) == "boolean") and b) or default then - return p_true + if type(b) ~= "boolean" then + if default then + return p_true + else + return p_false + end else - return p_false + if b then + return p_true + else + return p_false + end end end
i need to check it ... later (also for interferences)
PS. And a great palliative way to deal with 3D annotations is via attaching a 3D PDF file made with LaTeX (by Asymptote, for example).
well, one can attach files as-is already (unless it's broken)
I can not deduce from existing sea of ConTeXt code the status of file attachments support.
\attachment has been there for ages actually, all kind of annotations hav ebeen supported as soon as they showed up in acrobat (mediademo is an exmaple of flash) but i gave up on implementing these things too early as in acrobat/pdf such new tricks normally needs a few versions to reach stability Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------