How to write geospatial infomation into pdf correctly?

Product:Apryse SDK for C++

Product Version:11.7

Please give a brief summary of your issue:I want to write geospatial info using following codes. but show info(latitude longitude) not correct.Only lowerleft and rightup points ’ info are correct,other location’s latitude and longitude is not right. I don’t know why? it seems that Project didn’t work.
(Think of this as an email subject)

Please describe your issue and provide steps to reproduce it:
(The more descriptive your answer, the faster we are able to help you)

Please provide a link to a minimal sample where the issue is reproducible:Obj obj_page = page.GetSDFObj();
Obj viewport=obj_page.PutArray(“VP”);
Obj vp_dic = viewport.PushBackDict();//viewport dic
vp_dic.PutRect(“BBox”, 0, 0, fWidthPage, fHeightPage);
Obj measure = vp_dic.PutDict(“Measure”);
Obj subtype= measure.PutName(“Subtype”, “GEO”);

Obj dicGCS = measure.PutDict(“GCS”);
char* GeoGCS = “GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]]”;
dicGCS.PutName(“Type”, “GEOGCS”);
dicGCS.PutString(“WKT”, GeoGCS);

Obj dicDCS = measure.PutDict(“DCS”);
char* GeoPrj = “PROJCS["Asia_North_Albers_Equal_Area_Conic",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Albers"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",110.0],PARAMETER["Standard_Parallel_1",47.0],PARAMETER["Standard_Parallel_2",25.0],PARAMETER["Latitude_Of_Origin",10.0],UNIT["Meter",1.0]]”;
dicDCS.PutName(“Type”, “PROJCS”);
dicDCS.PutString(“WKT”, GeoPrj);



Obj arrayGPTS = measure.PutArray(“GPTS”);
//left down latitude longitude
arrayGPTS.PushBackNumber(geoPoint1.y);
arrayGPTS.PushBackNumber(geoPoint1.x);
//right up latitude longitude
arrayGPTS.PushBackNumber(geoPoint2.y);
arrayGPTS.PushBackNumber(geoPoint2.x);

Obj arrayLPTS = measure.PutArray(“LPTS”);
arrayLPTS.PushBackNumber(0);//左下角
arrayLPTS.PushBackNumber(0);
arrayLPTS.PushBackNumber(1);//右上角
arrayLPTS.PushBackNumber(1);

1 Like

Hello, I’m AiRon, an automated tech support bot :robot: While you wait for one of our customer support representatives, I can help you with your question.



When working with geospatial information in PDFs using Apryse’s SDK, it’s crucial to ensure that the geospatial data is correctly mapped and projected in the PDF. The issue you’re facing with incorrect latitude and longitude values, except for the corners, might be due to incorrect or incomplete setup of the geospatial coordinate system and transformations.

Some things you can try:

  • Ensure that the coordinate transformation is correctly set up between your geospatial data and the PDF coordinate space.

  • Verify that the Geospatial Coordinate System (GCS) and the Projected Coordinate System (PCS) are correctly defined in the PDF metadata.

  • Check the bounds of the BBox and ensure they match with the intended geospatial area you want to cover.

  • Make sure the GPTS (Geospatial Points) and LPTS (Local Points) arrays are correctly populated and aligned with the BBox coordinates.




Here are some resources that might help you:



Hopefully, this helps you solve your problem while you wait for a human to get back to you.

1 Like

Hi there,

I understand that you’re looking to write geospatial data to a document, but that the location data you’ve pushed to the page isn’t showing up as expected. Can you provide the following information so that I can become more familiar with the output you’re expecting?

  1. Can you show what the current outcome of the code you’ve listed is within your document, i.e. the incorrect latitude & longitude, as well as indicate what these values are expected to be?
  2. Can you provide the document with with you’re testing this functionality?
  3. Have you tested this behavior with any other geospatial data? Has it worked as you expect it to previously?

Thank you,
Kaden Rettig
Technical Support Engineer
Apryse Support Team

2 Likes