Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
2
2015-12-uni-ffm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CmS
2015-12-uni-ffm
Commits
ebb9a689
Commit
ebb9a689
authored
10 years ago
by
Hakim El Hattab
Browse files
Options
Downloads
Patches
Plain Diff
updates to phantom pdf print script, arguments for width/height
parent
fbf999ec
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
plugin/print-pdf/print-pdf.js
+24
-20
24 additions, 20 deletions
plugin/print-pdf/print-pdf.js
with
24 additions
and
20 deletions
plugin/print-pdf/print-pdf.js
+
24
−
20
View file @
ebb9a689
...
...
@@ -11,34 +11,38 @@
var
page
=
new
WebPage
();
var
system
=
require
(
'
system
'
);
page
.
viewportSize
=
{
width
:
1024
,
height
:
768
var
slideWidth
=
system
.
args
[
3
]
?
system
.
args
[
3
].
split
(
'
x
'
)[
0
]
:
960
;
var
slideHeight
=
system
.
args
[
3
]
?
system
.
args
[
3
].
split
(
'
x
'
)[
1
]
:
700
;
page
.
viewportSize
=
{
width
:
slideWidth
,
height
:
slideHeight
};
// TODO
// Something is wrong with these config values. An input
// paper width of 1920px actually results in a 756px wide
// PDF.
page
.
paperSize
=
{
format
:
'
letter
'
,
orientation
:
'
landscape
'
,
margin
:
{
left
:
'
0
'
,
right
:
'
0
'
,
top
:
'
0
'
,
bottom
:
'
0
'
}
width
:
Math
.
round
(
slideWidth
*
2
),
height
:
Math
.
round
(
slideHeight
*
2
),
border
:
0
};
var
reveal
File
=
system
.
args
[
1
]
||
'
index.html?print-pdf
'
;
var
slide
File
=
system
.
args
[
2
]
||
'
slides.pdf
'
;
var
input
File
=
system
.
args
[
1
]
||
'
index.html?print-pdf
'
;
var
output
File
=
system
.
args
[
2
]
||
'
slides.pdf
'
;
if
(
slide
File
.
match
(
/
\.
pdf$/gi
)
===
null
)
{
slide
File
+=
'
.pdf
'
;
if
(
output
File
.
match
(
/
\.
pdf$/gi
)
===
null
)
{
output
File
+=
'
.pdf
'
;
}
console
.
log
(
'
Printing PDF
...
'
);
console
.
log
(
'
Printing PDF
(Paper size:
'
+
page
.
paperSize
.
width
+
'
x
'
+
page
.
paperSize
.
height
+
'
)
'
);
page
.
open
(
revealFile
,
function
(
status
)
{
console
.
log
(
'
Printed succesfully
'
);
page
.
render
(
slideFile
);
phantom
.
exit
();
page
.
open
(
inputFile
,
function
(
status
)
{
window
.
setTimeout
(
function
()
{
console
.
log
(
'
Printed succesfully
'
);
page
.
render
(
outputFile
);
phantom
.
exit
();
},
1000
);
}
);
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment