How to send hidden information to printer to print
I need to print a Secret(Security) page contain "username" and "password" of user login information with JavaScript
on the browser
.
I do not want the contents of this page to be visible for user creator, When user click on Print button, Just i want to send data to printer as hidden, I mean user just see username and password values on A4
paper and no on the print preview
on browser.
Thanks
javascript php css browser printing
|
show 7 more comments
I need to print a Secret(Security) page contain "username" and "password" of user login information with JavaScript
on the browser
.
I do not want the contents of this page to be visible for user creator, When user click on Print button, Just i want to send data to printer as hidden, I mean user just see username and password values on A4
paper and no on the print preview
on browser.
Thanks
javascript php css browser printing
1
I don't believe you can change preview with javascript in browser. Preview should be exactly the same as final result, so I know what I'm printing.
– apple apple
Jan 1 at 7:55
1
and what's the reason to do this? it just make no sense to me.
– apple apple
Jan 1 at 7:58
1
Just so you know, hidden elements are still visible in the source of the html page. Thehidden
value just tells the browser not to render the elements. They are therefore not very secret.
– Joseph_J
Jan 1 at 7:58
1
You can write a css script specifically for printing. You can create a css class for elements that are hidden and change them so they are not.
– Joseph_J
Jan 1 at 8:02
1
I believe disabling the "Print Preview" would be a browser specific setting, i.e. a CLI flag set to disable print preview. I've done this for kiosk software I've designed. There's just no way to do it from JS within a browser due to the nature of the way browsers sandbox your code.
– Drew Reese
Jan 1 at 8:03
|
show 7 more comments
I need to print a Secret(Security) page contain "username" and "password" of user login information with JavaScript
on the browser
.
I do not want the contents of this page to be visible for user creator, When user click on Print button, Just i want to send data to printer as hidden, I mean user just see username and password values on A4
paper and no on the print preview
on browser.
Thanks
javascript php css browser printing
I need to print a Secret(Security) page contain "username" and "password" of user login information with JavaScript
on the browser
.
I do not want the contents of this page to be visible for user creator, When user click on Print button, Just i want to send data to printer as hidden, I mean user just see username and password values on A4
paper and no on the print preview
on browser.
Thanks
javascript php css browser printing
javascript php css browser printing
edited Jan 1 at 8:00
Sajjad Dehghani
asked Jan 1 at 7:49
Sajjad DehghaniSajjad Dehghani
445514
445514
1
I don't believe you can change preview with javascript in browser. Preview should be exactly the same as final result, so I know what I'm printing.
– apple apple
Jan 1 at 7:55
1
and what's the reason to do this? it just make no sense to me.
– apple apple
Jan 1 at 7:58
1
Just so you know, hidden elements are still visible in the source of the html page. Thehidden
value just tells the browser not to render the elements. They are therefore not very secret.
– Joseph_J
Jan 1 at 7:58
1
You can write a css script specifically for printing. You can create a css class for elements that are hidden and change them so they are not.
– Joseph_J
Jan 1 at 8:02
1
I believe disabling the "Print Preview" would be a browser specific setting, i.e. a CLI flag set to disable print preview. I've done this for kiosk software I've designed. There's just no way to do it from JS within a browser due to the nature of the way browsers sandbox your code.
– Drew Reese
Jan 1 at 8:03
|
show 7 more comments
1
I don't believe you can change preview with javascript in browser. Preview should be exactly the same as final result, so I know what I'm printing.
– apple apple
Jan 1 at 7:55
1
and what's the reason to do this? it just make no sense to me.
– apple apple
Jan 1 at 7:58
1
Just so you know, hidden elements are still visible in the source of the html page. Thehidden
value just tells the browser not to render the elements. They are therefore not very secret.
– Joseph_J
Jan 1 at 7:58
1
You can write a css script specifically for printing. You can create a css class for elements that are hidden and change them so they are not.
– Joseph_J
Jan 1 at 8:02
1
I believe disabling the "Print Preview" would be a browser specific setting, i.e. a CLI flag set to disable print preview. I've done this for kiosk software I've designed. There's just no way to do it from JS within a browser due to the nature of the way browsers sandbox your code.
– Drew Reese
Jan 1 at 8:03
1
1
I don't believe you can change preview with javascript in browser. Preview should be exactly the same as final result, so I know what I'm printing.
– apple apple
Jan 1 at 7:55
I don't believe you can change preview with javascript in browser. Preview should be exactly the same as final result, so I know what I'm printing.
– apple apple
Jan 1 at 7:55
1
1
and what's the reason to do this? it just make no sense to me.
– apple apple
Jan 1 at 7:58
and what's the reason to do this? it just make no sense to me.
– apple apple
Jan 1 at 7:58
1
1
Just so you know, hidden elements are still visible in the source of the html page. The
hidden
value just tells the browser not to render the elements. They are therefore not very secret.– Joseph_J
Jan 1 at 7:58
Just so you know, hidden elements are still visible in the source of the html page. The
hidden
value just tells the browser not to render the elements. They are therefore not very secret.– Joseph_J
Jan 1 at 7:58
1
1
You can write a css script specifically for printing. You can create a css class for elements that are hidden and change them so they are not.
– Joseph_J
Jan 1 at 8:02
You can write a css script specifically for printing. You can create a css class for elements that are hidden and change them so they are not.
– Joseph_J
Jan 1 at 8:02
1
1
I believe disabling the "Print Preview" would be a browser specific setting, i.e. a CLI flag set to disable print preview. I've done this for kiosk software I've designed. There's just no way to do it from JS within a browser due to the nature of the way browsers sandbox your code.
– Drew Reese
Jan 1 at 8:03
I believe disabling the "Print Preview" would be a browser specific setting, i.e. a CLI flag set to disable print preview. I've done this for kiosk software I've designed. There's just no way to do it from JS within a browser due to the nature of the way browsers sandbox your code.
– Drew Reese
Jan 1 at 8:03
|
show 7 more comments
1 Answer
1
active
oldest
votes
Best you can do in-browser without being able to disable a Print Preview you can achieve it via CSS media queries, the @media screen
should be hidden, and @media print
should not.
OK, Thank you dear.
– Sajjad Dehghani
Jan 1 at 9:01
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53993869%2fhow-to-send-hidden-information-to-printer-to-print%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Best you can do in-browser without being able to disable a Print Preview you can achieve it via CSS media queries, the @media screen
should be hidden, and @media print
should not.
OK, Thank you dear.
– Sajjad Dehghani
Jan 1 at 9:01
add a comment |
Best you can do in-browser without being able to disable a Print Preview you can achieve it via CSS media queries, the @media screen
should be hidden, and @media print
should not.
OK, Thank you dear.
– Sajjad Dehghani
Jan 1 at 9:01
add a comment |
Best you can do in-browser without being able to disable a Print Preview you can achieve it via CSS media queries, the @media screen
should be hidden, and @media print
should not.
Best you can do in-browser without being able to disable a Print Preview you can achieve it via CSS media queries, the @media screen
should be hidden, and @media print
should not.
answered Jan 1 at 8:09
Drew ReeseDrew Reese
950211
950211
OK, Thank you dear.
– Sajjad Dehghani
Jan 1 at 9:01
add a comment |
OK, Thank you dear.
– Sajjad Dehghani
Jan 1 at 9:01
OK, Thank you dear.
– Sajjad Dehghani
Jan 1 at 9:01
OK, Thank you dear.
– Sajjad Dehghani
Jan 1 at 9:01
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53993869%2fhow-to-send-hidden-information-to-printer-to-print%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
I don't believe you can change preview with javascript in browser. Preview should be exactly the same as final result, so I know what I'm printing.
– apple apple
Jan 1 at 7:55
1
and what's the reason to do this? it just make no sense to me.
– apple apple
Jan 1 at 7:58
1
Just so you know, hidden elements are still visible in the source of the html page. The
hidden
value just tells the browser not to render the elements. They are therefore not very secret.– Joseph_J
Jan 1 at 7:58
1
You can write a css script specifically for printing. You can create a css class for elements that are hidden and change them so they are not.
– Joseph_J
Jan 1 at 8:02
1
I believe disabling the "Print Preview" would be a browser specific setting, i.e. a CLI flag set to disable print preview. I've done this for kiosk software I've designed. There's just no way to do it from JS within a browser due to the nature of the way browsers sandbox your code.
– Drew Reese
Jan 1 at 8:03