[gdal-dev] Regarding DPI in Geospatial PDF

Vankadara, Sunil sunil.vankadara at hexagongeospatial.com
Wed May 13 00:30:53 PDT 2015


Hi Jukka,



I could understand from your mail that the mediabox is nothing but the image size in terms of width and height and the user unit is nothing but each pixel size.



Does it mean it is the PDF readers responsibility to dynamically resample to the given parameters in Media Box and User units? But Acrobat adobe reader is not resampling the image dynamically in displaying the image



Few observations from my side are

*         I haven't noticed any differences in Page size for different DPI values.

*         There is no difference of the image on the paper for different DPI values. ( I took the print out and noticed the differences physically )



Regards

Sunil



-----Original Message-----
From: gdal-dev-bounces at lists.osgeo.org [mailto:gdal-dev-bounces at lists.osgeo.org] On Behalf Of Jukka Rahkonen
Sent: 11 May 2015 03:21:PM
To: gdal-dev at lists.osgeo.org
Subject: Re: [gdal-dev] Regarding DPI in Geospatial PDF



Vankadara, Sunil <sunil.vankadara <at> hexagongeospatial.com> writes:



>

> Hi Team,

>

> I have created two PDF file with default DPI and 600 values using

gdal_translate application.

> Unfortunately I couldn't find any difference among these two created

> files

like file size, pixel size etc.

>

> The input file details are

> Input file type: Erdas . img file

> Width of the image: 11938

> Height of the image:: 14184

> Datatype: UINT 8

> No of Bands: 3

>

> May I know the reason for not showing up the difference in created outputs?

>

> Regards

> Sunil

>



Hi,



It may be that DPI setting at the moment does not have a totally desired effect. It would feel natural that increasing DPI from the default value 72 into a bigger value like 300 would make the page size of the PDF smaller expressed as physical units like millimeters.



The DPI setting is not supposed to affect the image itself so the PDF file size will be the same as well as the image quality so no up/downsampling will occur.



You can read some background from http://trac.osgeo.org/gdal/ticket/5412. In older PDF versions there was an absolute limit that page could not be bigger than 14000 units and the unit size was fixed to 1/72 inch. This limitation can be overridden in later PDF versions by using a UserUnit.



Create some sample PDF files with gdal_translate and you can see how the user unit behaves by opening the PDF file with a text editor and having a look at row 4 in the file.



Without -co DPI



<< /Annots 6 0 R /Contents 4 0 R /MediaBox [ 0 0 1728 1977 ] /Parent 1 0 R /Resources 5 0 R /Type /Page /UserUnit 1 >>



With -co DPI=300



<< /Annots 6 0 R /Contents 4 0 R /MediaBox [ 0 0 414.72000000000008

474.48000000000008 ] /Parent 1 0 R /Resources 5 0 R /Type /Page /UserUnit

4.1666666666666661 >>



With -co DPI=600



<< /Annots 6 0 R /Contents 4 0 R /MediaBox [ 0 0 207.36000000000004

237.24000000000004 ] /Parent 1 0 R /Resources 5 0 R /Type /Page /UserUnit

8.3333333333333321 >>





The image box sixe comes from (MediaBox size) x (UserUnit size) and remains the same in all three cases because GDAL is adjusting both the MediaBox and UserUnit hand in hand.



It could be that GDAL should not touch to the size of the MediaBox if it does not exceed 14400 in either dimension.



-Jukka Rahkonen-



_______________________________________________

gdal-dev mailing list

gdal-dev at lists.osgeo.org<mailto:gdal-dev at lists.osgeo.org>

http://lists.osgeo.org/mailman/listinfo/gdal-dev


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20150513/89864941/attachment.html>


More information about the gdal-dev mailing list