GM_ExportPDF |
Exports one or more layers to a new Geo-enabled PDF file. If NULL is passed for the layer list handle, all loaded layers will be saved to the new package file, otherwise only the specified layer(s) will be exported. If NULL is provided for the world bounds, the entirety of each layer will be exported, otherwise only data within the specified bounds will be exported.
IMPORTANT NOTE: You must purchase a license to the QuickPDF library from http://www.quickpdflibrary.com/ and use the GM_SetQuickPDFUnlockCode function to provide your registration key prior to calling this function. For SDK v1.37 and earlier you need a QuickPDF v7 license, for v1.38 and later you need a QuickPDF v8 license.
GM_Error_t32 __stdcall GM_ExportPDF ( const char* aFilename, // Name of new file to create GM_LayerHandle_t32* aLayerList, // List of layers to export or NULL for all uint32 aLayerCount, // Number of layers in list (0 for all) const GM_Rectangle_t* aWorldBounds, // World bounds to export or NULL for all const GM_ExportOptsPDF_t* aExportOpts // PDF export options (NULL for default) );
EXAMPLE: - Export Geo-enabled PDF from all loaded files with some options set
// Setup PDF export options GM_ExportOptsPDF_t thePdfOpts; ::memset( &thePdfOpts, 0, sizeof thePdfOpts ); thePdfOpts.mFlags = GM_PDF_FillPage | GM_PDF_BorderStyleValid; thePdfOpts.mPageSizeName = "Letter"; // Use 8 1/2" by 11" letter paper thePdfOpts.mDPI = 150; thePdfOpts.mMarginRect.mMinX = 0.5; // 1/2" left margin thePdfOpts.mMarginRect.mMaxX = 0.5; // 1/2" right margin thePdfOpts.mMarginRect.mMaxY = 1.0; // 1" top margin thePdfOpts.mMarginRect.mMinY = 0.5; // 1/2" bottom margin thePdfOpts.mBorderStyle = GM_PEN_SOLID; // solid pen thePdfOpts.mBorderWidth = 3; // border pen 3 PDF points (pixels) wide thePdfOpts.mBorderColor = RGB(255,0,0); // border color is red thePdfOpts.mHeaderStr = "My Map Name"; // Do export GM_Error_t32 theErr = GM_ExportPDF ( "c:\\temp\\export test\\test.pdf", NULL, 0, // export all loaded layers NULL, // export entire bounds of loaded data &thePdfOpts );