PDFMonkey.io
Pricing
Sign in
Get started for FREE
Search…
PDFMonkey Documentation
Guides
From zero to generating your first Document
Generating your first Document with Zapier
Making your first API call
PDFMonkey Features
Automatic deletion (TTL)
Share links
Webhooks
Frequent questions
Troubleshooting
What can you do with PDFMonkey?
What happens if I use all of my quota?
How do I change my password?
How do I delete my account?
Authoring Templates
Privacy and security
Compliance
How-tos
Adding a header or footer to your document
Including images in your documents
Styling your documents
Using different fonts
Using JavaScript
Set the filename of the generated Document
Change the size of the page and its margins
How to force a single page or use a full-page background
Integrations
List of integrations
Zapier
Integromat
Workato
Ruby SDK
References
The Document Lifecycle
Liquid Reference
API Reference
Powered By
GitBook
How to force a single page or use a full-page background
Forcing content to fit on a single page
If you want to make a container that will always take an entire page, no more, no less, you can define it like so:
CSS
1
.page
{
2
/* Defining an A4 portrait page */
3
height
:
1120px
;
4
width
:
793px
;
5
​
6
/* Will prevent any content like large images from messing */
7
/* with printed content auto-scaling */
8
overflow
:
hidden
;
9
​
10
/* Will allow any absolutely positionned content to be */
11
/* placed relatilvely to the page by default */
12
position
:
relative
;
13
}
Copied!
You can then use it in your HTML
HTML
1
<
div
class
=
"
page
"
>
2
Content for a single page
3
</
div
>
Copied!
Using a full-page background
If you want to apply a background so it takes the entire page, use the technique above and set the background image on your page:
CSS
1
.page-with-bg
{
2
background-image
:
url
(
'some-background-url-or-datauri'
)
;
3
background-size
:
cover
;
4
}
Copied!
HTML
1
<
div
class
=
"
page page-with-bg
"
>
2
Content for a single page
3
</
div
>
Copied!
How-tos - Previous
Change the size of the page and its margins
Next - Integrations
List of integrations
Last modified
1mo ago
Copy link
Contents
Forcing content to fit on a single page
Using a full-page background