Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE]: Create and Display Page Margins #1466

Open
Gazook89 opened this issue Jul 27, 2021 · 3 comments
Open

[FEATURE]: Create and Display Page Margins #1466

Gazook89 opened this issue Jul 27, 2021 · 3 comments
Labels

Comments

@Gazook89
Copy link
Collaborator

If a user wants to submit their brew to a physical printer, they'll typically run into a requirement for some sort of page margin/bleed (generally .125") or risk having white borders around their pages. It'd be neat to allow adding bleed to a brew. I think this gets tricky with pdf generation though, so maybe not worth tackling?

Here is a Share link for some CSS that would do the trick of allowing a variable margin size, adds a red border where the bleed begins, and automatically adjusts the footer graphic for PHB 5e and the page padding.

To print the PDF, I believe you have to use the system print dialog rather than Chrome's. And use a Custom Size Document, and set the size equal to your page height and width size + 2*margins.

Perhaps a better way to do this exists with JS or something, but this is what I've got.

image

:root {
	--margin:.25in;	
}

.phb {
	width:calc(8.5in	+ 2 * var(--margin));
	height:calc(11in	+ 2 * var(--margin));
	padding: calc(1cm + var(--margin)) calc(1.7cm + var(--margin));
	padding-bottom:calc(1.5cm + var(--margin));
	transform:scale(.5)
}

.phb:after {
	bottom:0;
	background:url(https://i.imgur.com/M7yy5E6.png);
	height:calc(.7in + var(--margin));
	width:calc(8.5in + 2 * var(--margin));
	background-size:9.5in;
	background-repeat:no-repeat;
	background-position:top center
}

.phb:before {
	content:'';
	width:8.5in;
	height:11in;
	border:1px solid red;
	position:absolute;
	left:var(--margin);
	top:var(--margin);
	box-sizing:border-box;
	z-index:500;
}
@5e-Cleric
Copy link
Member

This should be fixed with #3190, linking issues for future reference.

@5e-Cleric 5e-Cleric changed the title Feature Request: Create and Display Page Margins [FEATURE]: Create and Display Page Margins Jan 16, 2024
@dbolack-ab
Copy link
Collaborator

Anyone going to print from here should be using a full PDF/X print driver...

@dbolack-ab
Copy link
Collaborator

This should probably be solved at a document level with CSS variables rather than fixed values. IME, bleed changes from printer to printer and print format to print format.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants