summaryrefslogtreecommitdiff
path: root/tex/context/base/lpdf-u3d.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2010-03-29 18:49:00 +0200
committerHans Hagen <pragma@wxs.nl>2010-03-29 18:49:00 +0200
commit1e76a7198e92b4382646643dd5fa479f3e9e329d (patch)
treedac5b0ea7e99c9e8fa6fcc866d584fe2eda6023c /tex/context/base/lpdf-u3d.lua
parent41bb7ad440ec4b0d5c35e174792e3c4845313e7b (diff)
downloadcontext-1e76a7198e92b4382646643dd5fa479f3e9e329d.tar.gz
beta 2010.03.29 18:49
Diffstat (limited to 'tex/context/base/lpdf-u3d.lua')
-rw-r--r--tex/context/base/lpdf-u3d.lua14
1 files changed, 12 insertions, 2 deletions
diff --git a/tex/context/base/lpdf-u3d.lua b/tex/context/base/lpdf-u3d.lua
index 8d1240063..0a2beef00 100644
--- a/tex/context/base/lpdf-u3d.lua
+++ b/tex/context/base/lpdf-u3d.lua
@@ -13,7 +13,7 @@ if not modules then modules = { } end modules ['lpdf-u3d'] = {
-- an overhaul. There are some messy leftovers that will be
-- removed in future versions.
-local format = string.format
+local format, find = string.format, string.find
local cos, sin, sqrt, pi, atan2, abs = math.cos, math.sin, math.sqrt, math.pi, math.atan2, math.abs
local pdfconstant = lpdf.constant
@@ -354,9 +354,19 @@ function backends.pdf.helpers.insert3d(spec) -- width, height, factor, display,
local stream = streams[label]
if not stream then
+
+ 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
+
local attr = pdfdictionary {
Type = pdfconstant("3D"),
- Subtype = pdfconstant("U3D"),
+ Subtype = pdfconstant(subtype),
}
local streamviews = checkedkey(streamparam, "views", "table")
if streamviews then