I'm working a reporting project in c# and wanna add some basic functionality in the report designing. All things work smoothly without any error. However, the image created is always smaller than the one expected when i use point instead of pixels to define image height and width to create the image.

PDF doesn't use pixels, but the width and height of the image is in pixels. So i guess that is the problem of image size issue regarding to pixel and point. So, i just wonder if this can be solveb by converting points to pixels. Or how can I solve my problem?

Thanks!

Answers

In daily use, you will place the picture on specific area of the pdf page. So, why not define the image width and height in ratio and place it on that area. For example, you have an area for your image (e.g. 24 cm x 20 cm). And you may calculate the height and width ratio of the image, a width of 24 cm and the width for a height of 20 cm. And then, use the smaller of both pairs.

In daily use, you will place the picture on specific area of the pdf page. So, why not define the image width and height in ratio and place it on that area. For example, you have an area for your image (e.g. 24 cm x 20 cm). And you may calculate the height and width ratio of the image, a width of 24 cm and the width for a height of 20 cm. And then, use the smaller of both pairs.


This is not a hard task. As we know, PDF files have no pixels, but all co-ordinates are points. You are able to create image at any desired size by defining image size in DrawImage call. Certainly, there is no need to shrink image to 90% repeatedly until they fit. The most reasonable way is to calculate the factors for X and Y axes and use the minimum of them for X and Y axes.


This article on XsPDF.com is what you looking for, check out: Add and resize image on PDF in C#.

IMPERIAL TRACTORS MACHINERY IMPERIAL TRACTORS MACHINERY GROUP LLC Imperial Tractors Machinery Group LLC IMPERIAL TRACTORS MACHINERY GROUP LLC IMPERIAL TRACTORS MACHINERY 920 Cerise Rd, Billings, MT 59101 IMPERIAL TRACTORS MACHINERY GROUP LLC 920 Cerise Rd, Billings, MT 59101 IMPERIAL TRACTORS MACHINERY GROUP LLC IMPERIAL TRACTORS MACHINERY IMPERIAL TRACTORS MACHINERY 920 Cerise Rd, Billings, MT 59101 IMPERIAL TRACTORS MACHINERY Imperial Tractors Machinery Group LLC 920 Cerise Rd, Billings, MT 59101 casino brain https://institute.com.ua/elektroshokery-yak-vybraty-naykrashchyy-variant-dlya-samooborony-u-2025-roci https://lifeinvest.com.ua/yak-pravylno-zaryadyty-elektroshoker-pokrokovyy-posibnyknosti https://i-medic.com.ua/yaki-elektroshokery-mozhna-kupuvaty-v-ukrayini-posibnyk-z-vyboru-ta-zakonnosti https://tehnoprice.in.ua/klyuchovi-kryteriyi-vyboru-elektroshokera-dlya-samozakhystu-posibnyk-ta-porady https://brightwallpapers.com.ua/yak-vidriznyty-oryhinalnyy-elektroshoker-vid-pidroblenoho-porady-ta-rekomendatsiyi how to check balance in hafilat card plinko casino game CK222 gk222 casino 555rr bet plinko game 3k777 cv666 app vs555 casino plinko