Windows needs a flag for binary files
This commit is contained in:
parent
071cbe4ce4
commit
6781dabe7b
11 changed files with 18 additions and 18 deletions
|
@ -23,7 +23,7 @@ local function stream(pdf, num, dict, content, isfile, raw)
|
|||
end
|
||||
pdf[num] = {offset = pdf.file:seek()}
|
||||
if isfile then
|
||||
local f = io.open(content)
|
||||
local f = io.open(content, 'rb')
|
||||
content = f:read'a'
|
||||
f:close()
|
||||
end
|
||||
|
@ -56,7 +56,7 @@ local function indirect(pdf, num, content, isfile, objstream)
|
|||
error[[Invalid object]]
|
||||
end
|
||||
if isfile then
|
||||
local f = io.open(content)
|
||||
local f = io.open(content, 'rb')
|
||||
content = f:read'a'
|
||||
f:close()
|
||||
end
|
||||
|
@ -165,7 +165,7 @@ local pdfmeta = {
|
|||
}
|
||||
pdfmeta.__index = pdfmeta
|
||||
local function open(filename)
|
||||
local file = io.open(filename, 'w')
|
||||
local file = io.open(filename, 'wb')
|
||||
file:write"%PDF-X.X\n%🖋\n"
|
||||
return setmetatable({file = file, version = '1.7', [0] = 0, pages = {}, objstream = {}}, pdfmeta)
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue