How to resize an image that is being printed?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
I am trying to print A QR Code that has been generated by Swift when I print it out it is taking up the whole sheet I am wanting to resize the image and make it smaller. Aprox 200px x 200px
I have tried using different UIImage resize functions and is still coming out the same. I have also tried to resize the image with the printController
func printImage(img:UIImage) {
let printController = UIPrintInteractionController.shared
let printInfo = UIPrintInfo(dictionary:nil)
printInfo.jobName = "Printing (myTextField.text) 's QR code"
printInfo.outputType = .photoGrayscale
self.resizeImage(img, targetSize: CGSizeMake(200.0, 200.0))
printController.printInfo = printInfo
printController.printingItem = img
printController.present(animated: true) { (_, isPrinted, error) in
if error == nil {
if isPrinted {
print("QR Code Has Been Printed :)")
} else {
print("QR Code Not Printed")
}
}
}
}
func resizeImage(image: UIImage, targetSize: CGSize) -> UIImage {
let size = image.size
let widthRatio = targetSize.width / size.width
let heightRatio = targetSize.height / size.height
// Figure out what our orientation is, and use that to form the rectangle
var newSize: CGSize
if(widthRatio > heightRatio) {
newSize = CGSizeMake(size.width * heightRatio, size.height * heightRatio)
} else {
newSize = CGSizeMake(size.width * widthRatio, size.height * widthRatio)
}
// This is the rect that we've calculated out and this is what is actually used below
let rect = CGRectMake(0, 0, newSize.width, newSize.height)
// Actually do the resizing to the rect using the ImageContext stuff
UIGraphicsBeginImageContextWithOptions(newSize, false, 1.0)
image.drawInRect(rect)
let newImage = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
return newImage
}
I am expecting a small QR Code Aprox 200px by 200px. I am currently getting a A4 Size QR Code
swift uiimage uiprintinteractioncntrler
add a comment |
I am trying to print A QR Code that has been generated by Swift when I print it out it is taking up the whole sheet I am wanting to resize the image and make it smaller. Aprox 200px x 200px
I have tried using different UIImage resize functions and is still coming out the same. I have also tried to resize the image with the printController
func printImage(img:UIImage) {
let printController = UIPrintInteractionController.shared
let printInfo = UIPrintInfo(dictionary:nil)
printInfo.jobName = "Printing (myTextField.text) 's QR code"
printInfo.outputType = .photoGrayscale
self.resizeImage(img, targetSize: CGSizeMake(200.0, 200.0))
printController.printInfo = printInfo
printController.printingItem = img
printController.present(animated: true) { (_, isPrinted, error) in
if error == nil {
if isPrinted {
print("QR Code Has Been Printed :)")
} else {
print("QR Code Not Printed")
}
}
}
}
func resizeImage(image: UIImage, targetSize: CGSize) -> UIImage {
let size = image.size
let widthRatio = targetSize.width / size.width
let heightRatio = targetSize.height / size.height
// Figure out what our orientation is, and use that to form the rectangle
var newSize: CGSize
if(widthRatio > heightRatio) {
newSize = CGSizeMake(size.width * heightRatio, size.height * heightRatio)
} else {
newSize = CGSizeMake(size.width * widthRatio, size.height * widthRatio)
}
// This is the rect that we've calculated out and this is what is actually used below
let rect = CGRectMake(0, 0, newSize.width, newSize.height)
// Actually do the resizing to the rect using the ImageContext stuff
UIGraphicsBeginImageContextWithOptions(newSize, false, 1.0)
image.drawInRect(rect)
let newImage = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
return newImage
}
I am expecting a small QR Code Aprox 200px by 200px. I am currently getting a A4 Size QR Code
swift uiimage uiprintinteractioncntrler
Which code you have tried to resizeimg?
– Dharmesh
Jan 3 at 13:32
stackoverflow.com/questions/31314412/…
– Luke
Jan 3 at 13:35
Please update your code with your try.
– Dharmesh
Jan 3 at 13:36
I have updated now
– Luke
Jan 3 at 13:41
add a comment |
I am trying to print A QR Code that has been generated by Swift when I print it out it is taking up the whole sheet I am wanting to resize the image and make it smaller. Aprox 200px x 200px
I have tried using different UIImage resize functions and is still coming out the same. I have also tried to resize the image with the printController
func printImage(img:UIImage) {
let printController = UIPrintInteractionController.shared
let printInfo = UIPrintInfo(dictionary:nil)
printInfo.jobName = "Printing (myTextField.text) 's QR code"
printInfo.outputType = .photoGrayscale
self.resizeImage(img, targetSize: CGSizeMake(200.0, 200.0))
printController.printInfo = printInfo
printController.printingItem = img
printController.present(animated: true) { (_, isPrinted, error) in
if error == nil {
if isPrinted {
print("QR Code Has Been Printed :)")
} else {
print("QR Code Not Printed")
}
}
}
}
func resizeImage(image: UIImage, targetSize: CGSize) -> UIImage {
let size = image.size
let widthRatio = targetSize.width / size.width
let heightRatio = targetSize.height / size.height
// Figure out what our orientation is, and use that to form the rectangle
var newSize: CGSize
if(widthRatio > heightRatio) {
newSize = CGSizeMake(size.width * heightRatio, size.height * heightRatio)
} else {
newSize = CGSizeMake(size.width * widthRatio, size.height * widthRatio)
}
// This is the rect that we've calculated out and this is what is actually used below
let rect = CGRectMake(0, 0, newSize.width, newSize.height)
// Actually do the resizing to the rect using the ImageContext stuff
UIGraphicsBeginImageContextWithOptions(newSize, false, 1.0)
image.drawInRect(rect)
let newImage = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
return newImage
}
I am expecting a small QR Code Aprox 200px by 200px. I am currently getting a A4 Size QR Code
swift uiimage uiprintinteractioncntrler
I am trying to print A QR Code that has been generated by Swift when I print it out it is taking up the whole sheet I am wanting to resize the image and make it smaller. Aprox 200px x 200px
I have tried using different UIImage resize functions and is still coming out the same. I have also tried to resize the image with the printController
func printImage(img:UIImage) {
let printController = UIPrintInteractionController.shared
let printInfo = UIPrintInfo(dictionary:nil)
printInfo.jobName = "Printing (myTextField.text) 's QR code"
printInfo.outputType = .photoGrayscale
self.resizeImage(img, targetSize: CGSizeMake(200.0, 200.0))
printController.printInfo = printInfo
printController.printingItem = img
printController.present(animated: true) { (_, isPrinted, error) in
if error == nil {
if isPrinted {
print("QR Code Has Been Printed :)")
} else {
print("QR Code Not Printed")
}
}
}
}
func resizeImage(image: UIImage, targetSize: CGSize) -> UIImage {
let size = image.size
let widthRatio = targetSize.width / size.width
let heightRatio = targetSize.height / size.height
// Figure out what our orientation is, and use that to form the rectangle
var newSize: CGSize
if(widthRatio > heightRatio) {
newSize = CGSizeMake(size.width * heightRatio, size.height * heightRatio)
} else {
newSize = CGSizeMake(size.width * widthRatio, size.height * widthRatio)
}
// This is the rect that we've calculated out and this is what is actually used below
let rect = CGRectMake(0, 0, newSize.width, newSize.height)
// Actually do the resizing to the rect using the ImageContext stuff
UIGraphicsBeginImageContextWithOptions(newSize, false, 1.0)
image.drawInRect(rect)
let newImage = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
return newImage
}
I am expecting a small QR Code Aprox 200px by 200px. I am currently getting a A4 Size QR Code
swift uiimage uiprintinteractioncntrler
swift uiimage uiprintinteractioncntrler
edited Jan 3 at 13:40
Luke
asked Jan 3 at 13:27
LukeLuke
279
279
Which code you have tried to resizeimg?
– Dharmesh
Jan 3 at 13:32
stackoverflow.com/questions/31314412/…
– Luke
Jan 3 at 13:35
Please update your code with your try.
– Dharmesh
Jan 3 at 13:36
I have updated now
– Luke
Jan 3 at 13:41
add a comment |
Which code you have tried to resizeimg?
– Dharmesh
Jan 3 at 13:32
stackoverflow.com/questions/31314412/…
– Luke
Jan 3 at 13:35
Please update your code with your try.
– Dharmesh
Jan 3 at 13:36
I have updated now
– Luke
Jan 3 at 13:41
Which code you have tried to resize
img?– Dharmesh
Jan 3 at 13:32
Which code you have tried to resize
img?– Dharmesh
Jan 3 at 13:32
stackoverflow.com/questions/31314412/…
– Luke
Jan 3 at 13:35
stackoverflow.com/questions/31314412/…
– Luke
Jan 3 at 13:35
Please update your code with your try.
– Dharmesh
Jan 3 at 13:36
Please update your code with your try.
– Dharmesh
Jan 3 at 13:36
I have updated now
– Luke
Jan 3 at 13:41
I have updated now
– Luke
Jan 3 at 13:41
add a comment |
1 Answer
1
active
oldest
votes
As method resizeImage is returning new UIImage you need store result of
self.resizeImage(img, targetSize: CGSizeMake(200.0, 200.0))
in another object like:
let resizedImage = self.resizeImage(img, targetSize: CGSizeMake(200.0, 200.0))
And now you can use this resizedImage image for print like:
printController.printingItem = resizedImage
Hope this will help.
EDIT:
Below is update code:
func printImage(img:UIImage) {
let printController = UIPrintInteractionController.shared
let printInfo = UIPrintInfo(dictionary:nil)
printInfo.jobName = "Printing 's QR code"
printInfo.outputType = .photoGrayscale
if let resizedImage = self.resizeImage(image: img, targetSize: CGSize(width: 200, height: 200)) {
printController.printInfo = printInfo
printController.printingItem = resizedImage
printController.present(animated: true) { (_, isPrinted, error) in
if error == nil {
if isPrinted {
print("QR Code Has Been Printed :)")
} else {
print("QR Code Not Printed")
}
}
}
}
}
func resizeImage(image: UIImage, targetSize: CGSize) -> UIImage? {
let size = image.size
let widthRatio = targetSize.width / size.width
let heightRatio = targetSize.height / size.height
// Figure out what our orientation is, and use that to form the rectangle
var newSize: CGSize
if(widthRatio > heightRatio) {
newSize = CGSize(width: size.width * heightRatio, height: size.height * heightRatio)
} else {
newSize = CGSize(width: size.width * widthRatio, height: size.height * widthRatio)
}
// This is the rect that we've calculated out and this is what is actually used below
let rect = CGRect(x: 0, y: 0, width: newSize.width, height: newSize.height)
// Actually do the resizing to the rect using the ImageContext stuff
UIGraphicsBeginImageContextWithOptions(newSize, false, 1.0)
image.draw(in: rect)
let newImage = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
return newImage
}
I Have now done that but i am getting error: Argument labels '(_:, _:)' do not match any available overloads. This is appearing on the line: let resized image
– Luke
Jan 3 at 13:52
Let me add complete working code
– Dharmesh
Jan 3 at 13:54
@Luke check update answer.
– Dharmesh
Jan 3 at 14:02
Thanks Very much for the help. This is now working
– Luke
Jan 3 at 14:10
Happy to help you. :)
– Dharmesh
Jan 3 at 14:10
|
show 2 more comments
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%2f54023215%2fhow-to-resize-an-image-that-is-being-printed%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
As method resizeImage is returning new UIImage you need store result of
self.resizeImage(img, targetSize: CGSizeMake(200.0, 200.0))
in another object like:
let resizedImage = self.resizeImage(img, targetSize: CGSizeMake(200.0, 200.0))
And now you can use this resizedImage image for print like:
printController.printingItem = resizedImage
Hope this will help.
EDIT:
Below is update code:
func printImage(img:UIImage) {
let printController = UIPrintInteractionController.shared
let printInfo = UIPrintInfo(dictionary:nil)
printInfo.jobName = "Printing 's QR code"
printInfo.outputType = .photoGrayscale
if let resizedImage = self.resizeImage(image: img, targetSize: CGSize(width: 200, height: 200)) {
printController.printInfo = printInfo
printController.printingItem = resizedImage
printController.present(animated: true) { (_, isPrinted, error) in
if error == nil {
if isPrinted {
print("QR Code Has Been Printed :)")
} else {
print("QR Code Not Printed")
}
}
}
}
}
func resizeImage(image: UIImage, targetSize: CGSize) -> UIImage? {
let size = image.size
let widthRatio = targetSize.width / size.width
let heightRatio = targetSize.height / size.height
// Figure out what our orientation is, and use that to form the rectangle
var newSize: CGSize
if(widthRatio > heightRatio) {
newSize = CGSize(width: size.width * heightRatio, height: size.height * heightRatio)
} else {
newSize = CGSize(width: size.width * widthRatio, height: size.height * widthRatio)
}
// This is the rect that we've calculated out and this is what is actually used below
let rect = CGRect(x: 0, y: 0, width: newSize.width, height: newSize.height)
// Actually do the resizing to the rect using the ImageContext stuff
UIGraphicsBeginImageContextWithOptions(newSize, false, 1.0)
image.draw(in: rect)
let newImage = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
return newImage
}
I Have now done that but i am getting error: Argument labels '(_:, _:)' do not match any available overloads. This is appearing on the line: let resized image
– Luke
Jan 3 at 13:52
Let me add complete working code
– Dharmesh
Jan 3 at 13:54
@Luke check update answer.
– Dharmesh
Jan 3 at 14:02
Thanks Very much for the help. This is now working
– Luke
Jan 3 at 14:10
Happy to help you. :)
– Dharmesh
Jan 3 at 14:10
|
show 2 more comments
As method resizeImage is returning new UIImage you need store result of
self.resizeImage(img, targetSize: CGSizeMake(200.0, 200.0))
in another object like:
let resizedImage = self.resizeImage(img, targetSize: CGSizeMake(200.0, 200.0))
And now you can use this resizedImage image for print like:
printController.printingItem = resizedImage
Hope this will help.
EDIT:
Below is update code:
func printImage(img:UIImage) {
let printController = UIPrintInteractionController.shared
let printInfo = UIPrintInfo(dictionary:nil)
printInfo.jobName = "Printing 's QR code"
printInfo.outputType = .photoGrayscale
if let resizedImage = self.resizeImage(image: img, targetSize: CGSize(width: 200, height: 200)) {
printController.printInfo = printInfo
printController.printingItem = resizedImage
printController.present(animated: true) { (_, isPrinted, error) in
if error == nil {
if isPrinted {
print("QR Code Has Been Printed :)")
} else {
print("QR Code Not Printed")
}
}
}
}
}
func resizeImage(image: UIImage, targetSize: CGSize) -> UIImage? {
let size = image.size
let widthRatio = targetSize.width / size.width
let heightRatio = targetSize.height / size.height
// Figure out what our orientation is, and use that to form the rectangle
var newSize: CGSize
if(widthRatio > heightRatio) {
newSize = CGSize(width: size.width * heightRatio, height: size.height * heightRatio)
} else {
newSize = CGSize(width: size.width * widthRatio, height: size.height * widthRatio)
}
// This is the rect that we've calculated out and this is what is actually used below
let rect = CGRect(x: 0, y: 0, width: newSize.width, height: newSize.height)
// Actually do the resizing to the rect using the ImageContext stuff
UIGraphicsBeginImageContextWithOptions(newSize, false, 1.0)
image.draw(in: rect)
let newImage = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
return newImage
}
I Have now done that but i am getting error: Argument labels '(_:, _:)' do not match any available overloads. This is appearing on the line: let resized image
– Luke
Jan 3 at 13:52
Let me add complete working code
– Dharmesh
Jan 3 at 13:54
@Luke check update answer.
– Dharmesh
Jan 3 at 14:02
Thanks Very much for the help. This is now working
– Luke
Jan 3 at 14:10
Happy to help you. :)
– Dharmesh
Jan 3 at 14:10
|
show 2 more comments
As method resizeImage is returning new UIImage you need store result of
self.resizeImage(img, targetSize: CGSizeMake(200.0, 200.0))
in another object like:
let resizedImage = self.resizeImage(img, targetSize: CGSizeMake(200.0, 200.0))
And now you can use this resizedImage image for print like:
printController.printingItem = resizedImage
Hope this will help.
EDIT:
Below is update code:
func printImage(img:UIImage) {
let printController = UIPrintInteractionController.shared
let printInfo = UIPrintInfo(dictionary:nil)
printInfo.jobName = "Printing 's QR code"
printInfo.outputType = .photoGrayscale
if let resizedImage = self.resizeImage(image: img, targetSize: CGSize(width: 200, height: 200)) {
printController.printInfo = printInfo
printController.printingItem = resizedImage
printController.present(animated: true) { (_, isPrinted, error) in
if error == nil {
if isPrinted {
print("QR Code Has Been Printed :)")
} else {
print("QR Code Not Printed")
}
}
}
}
}
func resizeImage(image: UIImage, targetSize: CGSize) -> UIImage? {
let size = image.size
let widthRatio = targetSize.width / size.width
let heightRatio = targetSize.height / size.height
// Figure out what our orientation is, and use that to form the rectangle
var newSize: CGSize
if(widthRatio > heightRatio) {
newSize = CGSize(width: size.width * heightRatio, height: size.height * heightRatio)
} else {
newSize = CGSize(width: size.width * widthRatio, height: size.height * widthRatio)
}
// This is the rect that we've calculated out and this is what is actually used below
let rect = CGRect(x: 0, y: 0, width: newSize.width, height: newSize.height)
// Actually do the resizing to the rect using the ImageContext stuff
UIGraphicsBeginImageContextWithOptions(newSize, false, 1.0)
image.draw(in: rect)
let newImage = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
return newImage
}
As method resizeImage is returning new UIImage you need store result of
self.resizeImage(img, targetSize: CGSizeMake(200.0, 200.0))
in another object like:
let resizedImage = self.resizeImage(img, targetSize: CGSizeMake(200.0, 200.0))
And now you can use this resizedImage image for print like:
printController.printingItem = resizedImage
Hope this will help.
EDIT:
Below is update code:
func printImage(img:UIImage) {
let printController = UIPrintInteractionController.shared
let printInfo = UIPrintInfo(dictionary:nil)
printInfo.jobName = "Printing 's QR code"
printInfo.outputType = .photoGrayscale
if let resizedImage = self.resizeImage(image: img, targetSize: CGSize(width: 200, height: 200)) {
printController.printInfo = printInfo
printController.printingItem = resizedImage
printController.present(animated: true) { (_, isPrinted, error) in
if error == nil {
if isPrinted {
print("QR Code Has Been Printed :)")
} else {
print("QR Code Not Printed")
}
}
}
}
}
func resizeImage(image: UIImage, targetSize: CGSize) -> UIImage? {
let size = image.size
let widthRatio = targetSize.width / size.width
let heightRatio = targetSize.height / size.height
// Figure out what our orientation is, and use that to form the rectangle
var newSize: CGSize
if(widthRatio > heightRatio) {
newSize = CGSize(width: size.width * heightRatio, height: size.height * heightRatio)
} else {
newSize = CGSize(width: size.width * widthRatio, height: size.height * widthRatio)
}
// This is the rect that we've calculated out and this is what is actually used below
let rect = CGRect(x: 0, y: 0, width: newSize.width, height: newSize.height)
// Actually do the resizing to the rect using the ImageContext stuff
UIGraphicsBeginImageContextWithOptions(newSize, false, 1.0)
image.draw(in: rect)
let newImage = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
return newImage
}
edited Jan 3 at 14:02
answered Jan 3 at 13:45
DharmeshDharmesh
52.6k23130151
52.6k23130151
I Have now done that but i am getting error: Argument labels '(_:, _:)' do not match any available overloads. This is appearing on the line: let resized image
– Luke
Jan 3 at 13:52
Let me add complete working code
– Dharmesh
Jan 3 at 13:54
@Luke check update answer.
– Dharmesh
Jan 3 at 14:02
Thanks Very much for the help. This is now working
– Luke
Jan 3 at 14:10
Happy to help you. :)
– Dharmesh
Jan 3 at 14:10
|
show 2 more comments
I Have now done that but i am getting error: Argument labels '(_:, _:)' do not match any available overloads. This is appearing on the line: let resized image
– Luke
Jan 3 at 13:52
Let me add complete working code
– Dharmesh
Jan 3 at 13:54
@Luke check update answer.
– Dharmesh
Jan 3 at 14:02
Thanks Very much for the help. This is now working
– Luke
Jan 3 at 14:10
Happy to help you. :)
– Dharmesh
Jan 3 at 14:10
I Have now done that but i am getting error: Argument labels '(_:, _:)' do not match any available overloads. This is appearing on the line: let resized image
– Luke
Jan 3 at 13:52
I Have now done that but i am getting error: Argument labels '(_:, _:)' do not match any available overloads. This is appearing on the line: let resized image
– Luke
Jan 3 at 13:52
Let me add complete working code
– Dharmesh
Jan 3 at 13:54
Let me add complete working code
– Dharmesh
Jan 3 at 13:54
@Luke check update answer.
– Dharmesh
Jan 3 at 14:02
@Luke check update answer.
– Dharmesh
Jan 3 at 14:02
Thanks Very much for the help. This is now working
– Luke
Jan 3 at 14:10
Thanks Very much for the help. This is now working
– Luke
Jan 3 at 14:10
Happy to help you. :)
– Dharmesh
Jan 3 at 14:10
Happy to help you. :)
– Dharmesh
Jan 3 at 14:10
|
show 2 more comments
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%2f54023215%2fhow-to-resize-an-image-that-is-being-printed%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

Which code you have tried to resize
img?– Dharmesh
Jan 3 at 13:32
stackoverflow.com/questions/31314412/…
– Luke
Jan 3 at 13:35
Please update your code with your try.
– Dharmesh
Jan 3 at 13:36
I have updated now
– Luke
Jan 3 at 13:41