mirror of
https://github.com/antos-rde/antosdk-apps.git
synced 2025-07-13 06:04:26 +02:00
Enable printing in Docify
This commit is contained in:
@ -2,6 +2,7 @@
|
||||
Simple PDF document manager
|
||||
|
||||
## Change logs
|
||||
- v0.0.6-a: Add print dialog (support server side printing)
|
||||
- v0.0.5-a: Fix delete file bug
|
||||
- v0.0.4-a: Display file size in entry meta-data
|
||||
- v0.0.3-a: Fix document moved bug, sort entries by year, month, day
|
@ -396,6 +396,33 @@ handle.delete = function(param)
|
||||
end
|
||||
end
|
||||
|
||||
handle.printdoc = function(opt)
|
||||
local cmd = "lp "
|
||||
if opt.printer and opt.printer ~= "" then
|
||||
cmd = cmd .. " -d "..opt.printer
|
||||
end
|
||||
if opt.side == 0 then
|
||||
cmd = cmd.. " -o sides=one-sided"
|
||||
elseif opt.side == 1 then
|
||||
cmd = cmd.. " -o sides=two-sided-long-edge"
|
||||
elseif opt.side == 2 then
|
||||
cmd = cmd .. " -o sides=two-sided-short-edge"
|
||||
end
|
||||
-- orientation landscape
|
||||
if opt.orientation == 1 then
|
||||
cmd = cmd.." -o orientation-requested=5"
|
||||
end
|
||||
|
||||
if opt.range == 1 then
|
||||
cmd = cmd.." -P "..opt.pages
|
||||
end
|
||||
|
||||
cmd = cmd.. " "..vfs.ospath(opt.file)
|
||||
print(cmd)
|
||||
os.execute(cmd)
|
||||
return result("A print job has been posted on server. Check if it successes")
|
||||
end
|
||||
|
||||
|
||||
if arg.action and handle[arg.action] then
|
||||
-- check if the database exits
|
||||
|
@ -13,4 +13,13 @@ canvas[data-id = "preview-canvas"]
|
||||
{
|
||||
display: block;
|
||||
margin:0 auto;
|
||||
}
|
||||
afx-app-window[data-id = "DocifyPrintDialog"] i.label-text {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
afx-app-window[data-id = "DocifyPrintDialog"] input[type="radio"] {
|
||||
margin: 0;
|
||||
height: 12px;
|
||||
margin-left: 10px;
|
||||
}
|
File diff suppressed because one or more lines are too long
@ -7,7 +7,7 @@
|
||||
"author": "",
|
||||
"email": ""
|
||||
},
|
||||
"version":"0.0.5-a",
|
||||
"version":"0.0.6-a",
|
||||
"category":"Other",
|
||||
"iconclass":"fa fa-adn",
|
||||
"mimes":["none"],
|
||||
|
@ -26,7 +26,7 @@
|
||||
<div style="text-align: right;" data-height="30" >
|
||||
<afx-button text="__(Open)" data-id="btopen" ></afx-button>
|
||||
<afx-button text="__(Download)" data-id="btdld" ></afx-button>
|
||||
<afx-button text="__(Print)" data-id="btopen" ></afx-button>
|
||||
<afx-button text="__(Print on server)" data-id="btprint" ></afx-button>
|
||||
</div>
|
||||
</afx-vbox>
|
||||
</afx-hbox>
|
||||
|
Reference in New Issue
Block a user