Knowledge Base - Change page size using Advanced properties

Knowledge Base - Change page size using Advanced properties

Using the Advanced properties, you can change the page dimensions, check the below code:

Note: a premium license is needed.

 

Page page = m_doc.GetPage(0);
Ref ref = page.Advance_GetRef();
Obj page_obj = m_doc.Advance_GetObj(ref);
int count = page_obj.DictGetItemCount();
for (int cur = 0; cur < count; cur++) {
String tag = page_obj.DictGetItemTag(cur);
Obj item = page_obj.DictGetItem(cur);
if ((tag.equals("MediaBox") || tag.equals("CropBox")) && item.GetType() == 6) {
int arraycount = item.ArrayGetItemCount();
for (int k = 0; k < arraycount; k++) {
Obj array_obj = item.ArrayGetItem(k);
//if(k == 0) array_obj.SetReal(0); //set left
//if(k == 1) array_obj.SetReal(0); //set top
//if(k == 2) array_obj.SetReal(500); //set width
if (k == 3) array_obj.SetReal(900); //set Height
}
break;
}
}
Applies To

RadaeePDF SDK for Android

Details

Created : 2018-02-02 12:11:42, Last Modified : 2018-02-02 12:20:38