Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
pagedjs
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Cy Z
pagedjs
Commits
6ef5bac6
Commit
6ef5bac6
authored
Apr 28, 2019
by
Fred Chasen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix height for sheet in print css
parent
76b786dd
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
47 additions
and
15 deletions
+47
-15
CONTRIBUTING.md
CONTRIBUTING.md
+23
-0
puppeteer_environment.js
specs/jest_helpers/puppeteer_environment.js
+10
-5
atpage.js
src/modules/paged-media/atpage.js
+1
-0
base.js
src/polisher/base.js
+7
-0
previewer.js
src/polyfill/previewer.js
+6
-10
No files found.
CONTRIBUTING.md
0 → 100644
View file @
6ef5bac6
# Paged.js Contributions Guide
Whether you're contributing to Pagedjs through development, creating examples, finding bug or just asking questions - thanks in advance for your help!
## I found a bug!
Please file a bug report on our gitlab issues page: https://gitlab.pagedmedia.org/tools/pagedjs/issues
Issues with a HTML file example and correct / incorrect output PDFs are much quicker to debug and very appreciated.
## I fixed something!
We'll review the code on either a github or gitlab pull request and then merge it into the gitlab repository.
## I need help!
Chat with us on mattermost @ https://mattermost.pagedmedia.org/login
You can also open an issue with the
`Question`
label: https://gitlab.pagedmedia.org/tools/pagedjs/issues?label_name%5B%5D=Question
## I have a great idea for a feature!
Please open an issue with the
`Feature Request`
label: https://gitlab.pagedmedia.org/tools/pagedjs/issues?label_name%5B%5D=Feature+Request
specs/jest_helpers/puppeteer_environment.js
View file @
6ef5bac6
...
...
@@ -71,14 +71,19 @@ class PuppeteerEnvironment extends NodeEnvironment {
console
.
log
(
`TestPage -
${
i
}
:
${
msg
.
args
()[
i
]}
`
);
});
// await page.exposeFunction('PuppeteerLogger', (msg, counter) => {
// console.log(msg, counter);
// });
await
page
.
exposeFunction
(
'
onPagesRendered
'
,
(
msg
,
width
,
height
,
orientation
)
=>
{
await
page
.
exposeFunction
(
'
onRendered
'
,
(
msg
,
width
,
height
,
orientation
)
=>
{
renderedResolve
(
msg
,
width
,
height
,
orientation
);
});
await
page
.
evaluateOnNewDocument
(()
=>
{
document
.
addEventListener
(
"
DOMContentLoaded
"
,
()
=>
{
window
.
PagedPolyfill
.
on
(
"
rendered
"
,
(
flow
)
=>
{
let
msg
=
"
Rendering
"
+
flow
.
total
+
"
pages took
"
+
flow
.
performance
+
"
milliseconds.
"
;
window
.
onRendered
(
msg
,
flow
.
width
,
flow
.
height
,
flow
.
orientation
);
});
});
});
await
page
.
goto
(
ORIGIN
+
'
/specs/
'
+
path
,
{
waitUntil
:
'
networkidle2
'
});
return
page
;
...
...
src/modules/paged-media/atpage.js
View file @
6ef5bac6
...
...
@@ -193,6 +193,7 @@ class AtPage extends Handler {
this
.
addRootPage
(
ast
,
this
.
pages
[
"
*
"
].
size
,
bleed
);
this
.
emit
(
"
size
"
,
{
width
,
height
,
orientation
,
format
,
bleed
});
this
.
emit
(
"
atpages
"
,
this
.
pages
);
}
}
...
...
src/polisher/base.js
View file @
6ef5bac6
...
...
@@ -480,5 +480,12 @@ img {
page-break-after: always;
break-after: page;
}
.pagedjs_sheet {
margin: 0;
padding: 0;
max-height: 100%;
min-height: 100%;
height: 100% !important;
}
}
`
;
src/polyfill/previewer.js
View file @
6ef5bac6
...
...
@@ -32,13 +32,8 @@ class Previewer {
orientation
:
undefined
};
let
counter
=
0
;
this
.
chunker
.
on
(
"
page
"
,
(
page
)
=>
{
counter
+=
1
;
this
.
emit
(
"
page
"
,
page
);
if
(
typeof
window
.
PuppeteerLogger
!==
"
undefined
"
)
{
window
.
PuppeteerLogger
(
"
page
"
,
counter
);
}
});
this
.
chunker
.
on
(
"
rendering
"
,
()
=>
{
...
...
@@ -54,6 +49,11 @@ class Previewer {
this
.
emit
(
"
size
"
,
size
);
});
handlers
.
on
(
"
atpages
"
,
(
pages
)
=>
{
this
.
atpages
=
pages
;
this
.
emit
(
"
atpages
"
,
pages
);
});
return
handlers
;
}
...
...
@@ -136,15 +136,11 @@ class Previewer {
let
flow
=
await
this
.
chunker
.
flow
(
content
,
renderTo
);
let
endTime
=
performance
.
now
();
let
msg
=
"
Rendering
"
+
flow
.
total
+
"
pages took
"
+
(
endTime
-
startTime
)
+
"
milliseconds.
"
;
flow
.
performance
=
(
endTime
-
startTime
);
flow
.
size
=
this
.
size
;
this
.
emit
(
"
rendered
"
,
msg
,
this
.
size
.
width
&&
this
.
size
.
width
.
value
+
this
.
size
.
width
.
unit
,
this
.
size
.
height
&&
this
.
size
.
height
.
value
+
this
.
size
.
height
.
unit
,
this
.
size
.
orientation
,
this
.
size
.
format
);
if
(
typeof
window
.
onPagesRendered
!==
"
undefined
"
)
{
window
.
onPagesRendered
(
msg
,
this
.
size
.
width
&&
this
.
size
.
width
.
value
+
this
.
size
.
width
.
unit
,
this
.
size
.
height
&&
this
.
size
.
height
.
value
+
this
.
size
.
height
.
unit
,
this
.
size
.
orientation
,
this
.
size
.
format
);
}
this
.
emit
(
"
rendered
"
,
flow
);
return
flow
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment