0

I want to print a very large image generated by my program with 31279px in width with javascript but window.print() prints only a little part of the entire image.

Please any solution to this?

3 Answers 3

1

Using CSS resize the image to 100% width of the window, this should theoretically work.

img#theImage {
     width:100%;
}
Sign up to request clarification or add additional context in comments.

7 Comments

Good idea, but you should add a @media print block to it as well.
I wouldn't recommend that, since the user would have to download a few megabytes of image and thus would be nonplussed. Better fetch the resized version.
@alamar: it looks like he wants to have this high-res picture.
@MiffTheFox: And users looking at the picture should only see a small part of it? So many pixels would need huge scrollbars.
hi guy i do not want to resize it . it happen to be a big diagram of some sort!
|
1

Three choices:

  • Resize it (on the server-side perhaps) to fit the window. It would degrade print quality, but fast and easy.
  • GoogleMaps-style: cut it into small pieces, let user scroll them both ways and choose the window he wants to print. Buttons for "zoom in" and "zoom out" serving smaller/bigger-scale images. Cool and strong, but a lot of work.
  • Make a PDF with that image! No quality degrade, guaranteed looks.

I think you should really do PDF.

Comments

0

Have you tried another browser? I've heard that Firefox doesn't continue printing on the next side if the element is floated.


Another idea: Use css to show only part of the image and make those parts as big as one page is. This technique is called sprites.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.