converting scalable pdf files

Discussions on NConvert - the command line tool for image conversion and manipulation

Moderators: helmut, XnTriq, xnview

Post Reply
positron

converting scalable pdf files

Post by positron »

Many webservers serve maps as scalable pdf files (e.g. www.ratp.fr).
It is convenient to convert those to PNG.
By default, nconvert uses an intermediate scale, resulting is details loss.

Does anyone know how to convert PDF into PNG so as to retain
the maximum level of details (100% scaling) ?

I tried to force -dpi using the value i get from 'nconvert -info'
and also -resize, but resize is applied to the target image afterwards.
So the following did not achieve PDF scale selection.

# nconvert -info paris_metro.pdf
Xdpi : 72
Ydpi : 72

# nconvert -out png -dpi 72 paris_metro.pdf


# nconvert -out png -resize 200% 200% paris_metro.pdf

Best regards,
Phil
User avatar
xnview
Author of XnView
Posts: 46390
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: converting scalable pdf files

Post by xnview »

positron wrote:Many webservers serve maps as scalable pdf files (e.g. www.ratp.fr).
It is convenient to convert those to PNG.
By default, nconvert uses an intermediate scale, resulting is details loss.

Does anyone know how to convert PDF into PNG so as to retain
the maximum level of details (100% scaling) ?

I tried to force -dpi using the value i get from 'nconvert -info'
and also -resize, but resize is applied to the target image afterwards.
So the following did not achieve PDF scale selection.

# nconvert -info paris_metro.pdf
Xdpi : 72
Ydpi : 72

# nconvert -out png -dpi 72 paris_metro.pdf


# nconvert -out png -resize 200% 200% paris_metro.pdf
Do you have tried to use -dpi 300?
Pierre.
positron

Re: converting scalable pdf files

Post by positron »

> Do you have tried to use -dpi 300 ?

You are right, it does work. So intuitively i think one
should rather use MULTIPLES of the dpi given by 'nconvert -info'.
So i tried 144 instead of 72 as dpi as got a pretty result.

Or are scales normalized in PDF documents (are 72, 300
normalized values) ?

Could (should) "nconvert -info" report the PDF DPI giving
the highest level of details (i ignore PDF specs, and if various
DPI corresponding to scales appears in PDF headers ...).

In other words, so as to feed the dpi param in nconvert,
how can one determine the smallest DPI that
gives all details ?

Thanks Pierre
Phil
Post Reply