/    Sign up×
Community /Pin to ProfileBookmark

What’s the LARGEST area I can print from a HTML page onto A4 paper?

Let’s say I want to print a rectangle.
Can I print to the margins – the same as say a Word document?

I actually want to print other things, but need to know the borders I can stretch to.

Thanks.

to post a comment
HTML

8 Comments(s)

Copy linkTweet thisAlerts:
@cootheadNov 20.2018 — Hi there jumpingflash.

why don't you experiment?

You will find the exercise to be of practical use, mentally stimulating

and, best of all, hopefully keep you out of mischief for an hour or two. ?

_coothead_
Copy linkTweet thisAlerts:
@jumpingflashauthorNov 20.2018 — @coothead#1598053

the words of a wise sage. ?

can you help me start off?

how would i draw a rectangle with only black outline - no need to waste ink printing out...

also i want to give the measures in cm + actually... would be nice to change colors so i can print and compare next print after change.

(only asking as i assume this is 30 seconds for you.)

thks
Copy linkTweet thisAlerts:
@rootNov 20.2018 — I once printed A3 on an A4 sheet....

Copy linkTweet thisAlerts:
@jumpingflashauthorNov 20.2018 — @root no way! that is so clever.
Copy linkTweet thisAlerts:
@cootheadNov 21.2018 — Hi there jumpingflash.

Check out the attachment...

[url=https://www.webdeveloper.com/forum/assets/files/2018-11-21/1542795230-235434-jumpingflash.zip]**[color=#069]jumpingflash.zip[/color]**[/url]

...which may or may not prove to be helpful, as I don't

really know what you are actually trying to achieve. ?

_coothead_
Copy linkTweet thisAlerts:
@rootNov 21.2018 — @jumpingflash#1598094 Way man...

Options > Size > Reduce > 50%

Ta Dah!
Copy linkTweet thisAlerts:
@jumpingflashauthorNov 21.2018 — @coothead... thank you.

the attachment is a great start for me

i think i would have spent an hour or 2 to get to that.

what i want: to be able to print invoices and labels onto a4.

printing from html is NOT ideal - i know.

but html output is the most convenient for coding.

using pdf - well... i've investigated and it's a whole load more work + needs reinventing the wheel as i can't find things that match what i need.

in the code, what do i need to give a width and height in cm?

pixels or other measures is ok - but would prefer cm.

if i can print the max possible size - then i''m all set.

i can just make sure other things fit inside my rectangle.

hope that makes some sense.
Copy linkTweet thisAlerts:
@cootheadNov 21.2018 — > @jumpingflash

**

[color=#069]In the code, what do i need to give a width and height in cm?[/color]**


The _"cm unit"_ is not recommended for coding HTML documents, instead we tend

to use _"em"_ and _"%"_

Do not confuse screen dimensions with the outside world.

If you were to use them. it would not display the width/height in cm

when measured with a hand held ruler.

If you still want to use the _"cm unit"_ then code it like this...

``<i>
</i>&lt;!DOCTYPE HTML&gt;
&lt;html lang="en"&gt;
&lt;head&gt;

&lt;meta charset="utf-8"&gt;
&lt;meta name="viewport" content="width=device-width,height=device-height,initial-scale=1"&gt;

&lt;title&gt;print test&lt;/title&gt;

&lt;!--&lt;link rel="stylesheet" href="screen.css" media="screen"&gt;--&gt;

&lt;style media="screen,print"&gt;
body {
margin: 0;
background-color: #f9f9f9;
font: 100% / 162% verdana, arial, helvetica, sans-serif;
}
#container {
max-width: 100%;
width: 20cm; /* you can put any cm value here and it will be rendered up to 100% page width */
padding: 1cm;
margin: auto;
border: 0.1cm solid #000;
box-sizing: border-box;
background-color: #fff;
}
&lt;/style&gt;

&lt;/head&gt;
&lt;body&gt;

&lt;div id="container"&gt;
&lt;p&gt;
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Curabitur sit amet sem sed libero bibendum tempus faucibus
quis mi. Nulla rhoncus vel ipsum in volutpat. Nam tortor
nibh, posuere ac lorem ut, suscipit tincidunt leo. Duis
interdum justo ac justo vehicula consequat. Curabitur et
volutpat nibh. Phasellus rutrum lacus at dolor placerat
feugiat. Morbi porta, sapien nec molestie molestie, odio
magna vestibulum lorem, vitae feugiat est leo sit amet
nunc. Curabitur ornare tempor turpis. In nibh sem, porta ac
magna sed, pretium commodo odio. Sed porttitor augue velit,
quis placerat diam sodales ac. Curabitur vitae porta ex.
Praesent rutrum ex fringilla tellus tincidunt interdum.
Proin molestie lectus consectetur purus aliquam porttitor.
Fusce ac nisi ac magna scelerisque finibus a vitae sem.
&lt;/p&gt;
&lt;/div&gt;

&lt;/body&gt;
&lt;/html&gt;<i>

</i>
``


_coothead_
×

Success!

Help @jumpingflash spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.10,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...