On Thursday 26 May 2016 09:38:21 Luca Delucchi wrote:
> On 25 May 2016 at 17:12, Even Rouault <[email protected]> wrote:
> > The following extract from the driver should hopefully answer your
questions :
> more or less yes, now I understood a little bit more but..
>
> > double dfUserUnit = dfDPI * USER_UNIT_IN_INCH;
> > double dfWidthInUserUnit = nWidth / dfUserUnit + sMargins.nLeft +
> > sMargins.nRight; double dfHeightInUserUnit = nHeight / dfUserUnit +
> > sMargins.nBottom + sMargins.nTop;>
> > --> nWidth and nHeight are the dimensions of the source raster in pixel.
>
> if I have no raster how can I found this two values?
Ah ok, so you create a vector dataset then ?
Here's the relevant code in pdfwritabledataset.cpp:
double dfRatio = (sGlobalExtent.MaxY - sGlobalExtent.MinY) /
(sGlobalExtent.MaxX - sGlobalExtent.MinX);
int nWidth, nHeight;
if (dfRatio < 1)
{
nWidth = 1024;
nHeight = static_cast<int>(nWidth * dfRatio);
}
else
{
nHeight = 1024;
nWidth = static_cast<int>(nHeight / dfRatio);
}
where sGlobalExtent is the georeferenced extent of the vectors added in the
PDF vector layer.
Even
--
Spatialys - Geospatial professional services
http://www.spatialys.com
_______________________________________________
gdal-dev mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/gdal-dev