Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
pagedjs
pagedjs
Commits
0b9369a3
Commit
0b9369a3
authored
Mar 31, 2022
by
Fred Chasen
Browse files
Merge branch 'inherit_wrapper_height' into 'main'
Fix
#162
: Inherit wrapper height from page area Closes
#162
See merge request
!166
parents
8d64971a
b58bf6db
Pipeline
#32436
canceled with stage
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
.gitignore
View file @
0b9369a3
...
...
@@ -4,5 +4,4 @@ dist
lib
__diff_output__
specs/**/*.pdf
issues
.vscode
\ No newline at end of file
specs/issues/wrapper-height/__image_snapshots_mac__/wrapper-height-spec-js-wrapper-height-should-create-a-pdf-1-snap.png
0 → 100644
View file @
0b9369a3
14.2 KB
specs/issues/wrapper-height/wrapper-height.html
0 → 100644
View file @
0b9369a3
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<meta
http-equiv=
"Content-Type"
content=
"text/html;charset=utf-8"
/>
<meta
http-equiv=
"Content-Style-Type"
content=
"text/css"
/>
<title>
Wapper Height
</title>
<script
src=
"../../../dist/paged.polyfill.js"
></script>
<style>
/* interface */
@media
screen
{
body
{
background
:
whitesmoke
;
}
.pagedjs_page
{
background
:
white
;
margin-bottom
:
10px
;
box-shadow
:
0
0
0
1px
rgba
(
0
,
0
,
0
,
0.2
);
}
.pagedjs_pages
{
width
:
calc
(
var
(
--pagedjs-width
)
*
2
);
display
:
flex
;
flex-direction
:
row
;
flex-wrap
:
wrap
;
justify-content
:
flex-start
;
margin
:
0
auto
;
}
}
</style>
<style>
#cover
{
display
:
flex
;
flex-direction
:
column
;
justify-content
:
center
;
height
:
100%
;
break-after
:
page
;
align-items
:
flex-end
;
background-color
:
green
;
}
</style>
</head>
<body>
<div
id=
"cover"
class=
"title-page"
>
<h1>
Title
</h1>
</div>
<div
id=
"content"
class=
"content"
>
<div
id=
"preamble"
>
<div
class=
"sectionbody"
>
<div
class=
"paragraph"
>
<p>
This is a preamble.
</p>
</div>
</div>
</div>
<div
class=
"sect1"
>
<h2
id=
"_section"
>
Section
</h2>
<div
class=
"sectionbody"
>
<div
class=
"paragraph"
>
<p>
This is a paragraph.
</p>
</div>
</div>
</div>
</div>
</body>
</html>
specs/issues/wrapper-height/wrapper-height.spec.js
0 → 100644
View file @
0b9369a3
const
TIMEOUT
=
10000
;
describe
(
"
wrapper-height
"
,
()
=>
{
let
page
;
beforeAll
(
async
()
=>
{
page
=
await
loadPage
(
"
issues/wrapper-height/wrapper-height.html
"
);
return
page
.
rendered
;
},
TIMEOUT
);
afterAll
(
async
()
=>
{
if
(
!
DEBUG
)
{
await
page
.
close
();
}
});
it
(
"
should render 2 pages
"
,
async
()
=>
{
let
pages
=
await
page
.
$$eval
(
"
.pagedjs_page
"
,
(
r
)
=>
{
return
r
.
length
;
});
expect
(
pages
).
toEqual
(
2
);
});
if
(
!
DEBUG
)
{
it
(
"
should create a pdf
"
,
async
()
=>
{
let
pdf
=
await
page
.
pdf
(
PDF_SETTINGS
);
expect
(
pdf
).
toMatchPDFSnapshot
(
1
);
});
}
}
);
src/polisher/base.js
View file @
0b9369a3
...
...
@@ -385,6 +385,10 @@ export default `
column-fill: auto;
}
.pagedjs_pagebox > .pagedjs_area > .pagedjs_page_content > div {
height: inherit;
}
.pagedjs_pagebox > .pagedjs_area > .pagedjs_footnote_area {
position: relative;
overflow: hidden;
...
...
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