Rcrd 009
Rcrd 009

Reputation: 323

printing in 300 dpi from flex or jquery

We have a requirement of customizing some images (adding some text to images) using a flex app or jquery for printing this. Once the customization is done, it has to save the output image in 300 dpi for ensuring high quality for printing.

We are stuck here and not sure how to save this image in 300 dpi. We can make sure that the source image uploaded for customization is in 300 dpi. But after the customization, we have to save the image in 300 dpi also.

Any suggestions about how to do it?

Upvotes: 0

Views: 1815

Answers (3)

Exhausted
Exhausted

Reputation: 1885

The Flex printing in the client side Printing wont supports the quality printing, the Flex automatically maps to 72 ppi. check the note given here, but the server side printing supports with high dpi printing. one third party tool Alive Pdf supports the image print check the tutorial. but you need to scale image to 300 dpi, for more information check here.

Choose which one is good to you

Upvotes: 3

Joop Eggen
Joop Eggen

Reputation: 109547

You want to have a good print quality as opposed to the lesser screen quality (75 dpi). Images however are made up of pixels, and they determine the resolution. So having images with a multiple width and height suffices.

In HTML/jQuery it normally suffices to have the larger image defined smaller with < img src=... width=FRACTION height=FRACTION > or use CSS media:print.

As an afterthought: it might be much nicer to not embed the text into the pixel image, but as overlay.


A bit more explanation:

If you view your high definition image on the screen by the standard windows viewer and elect 100% display (no zooming), then you will see that it is larger. That is because it has more pixels: say 4000 x 3000.

In HTML you could display it smaller by:

<img src="bigimage.png" width="400" height="300">

This is easiest. In CSS one uses a background-image which often is not printed at all.

If your page has a "print view" you could have use a smaller, faster image for the normal display, and on print view the large image.

Text overlay in HTML is possible too, but the font must be licensed if it is non-standard. A floating div suffices.

Concerning flex: someone else has to answer that; a long time since I did flex.

Upvotes: 0

lepe
lepe

Reputation: 25200

I'm sure you can achieve that using imagemagick (server-side). Check this url:

http://www.imagemagick.org/script/command-line-options.php

An look for "density" and "resample" options.

If you use PHP: http://www.php.net/manual/en/function.imagick-resampleimage.php

To insert text in the image I will do it with gd: http://php.net/manual/en/ref.image.php

Maybe this can give you some hint of how to solve your problem.

Sorry I have no experience with Flex, so I can not help you on that.

Upvotes: 1

Related Questions