Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
Questions about iOS development and PDF
  • Page:
  • 1

TOPIC:

CropBox and MediaBox 8 years 7 months ago #9600

  • tanvi
  • tanvi's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 16
  • Thank you received: 1
I'm unable to get the CropBox and MediaBox.
I know the methods used are Page_getCropBox and Page_getMediaBox, but I don't know how can I implement them.

Please Log in or Create an account to join the conversation.

CropBox and MediaBox 8 years 7 months ago #9610

  • emanuele
  • emanuele's Avatar
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 580
  • Thank you received: 67
Hi,

the best way to use these methods, is to create two methods in PDFObjc that call native lib's methods.
In PDFPage implementation, something like:
-(PDF_RECT)getPageCropBox
{
    PDF_RECT rect;
    Page_getCropBox(m_page, &rect);
    
    return rect;
}
-(PDF_RECT)getPageMediaBox
{
    PDF_RECT rect;
    Page_getMediaBox(m_page, &rect);
    
    return rect;
}

then, you can use these methods in this way:
PDFPage *page = [m_doc page:1];
    PDF_RECT rect1;
    PDF_RECT rect2;
    
    rect1 = [page getPageCropBox];
    rect2 = [page getPageMediaBox];
The following user(s) said Thank You: tanvi

Please Log in or Create an account to join the conversation.

CropBox and MediaBox 8 years 6 months ago #9741

  • aurgir
  • aurgir's Avatar
  • Offline
  • New Member
  • New Member
  • Posts: 3
  • Thank you received: 0
Page_getCropBox and Page_getMediaBox return false every time I call it. Is it normal ?

Please Log in or Create an account to join the conversation.

CropBox and MediaBox 8 years 5 months ago #9747

  • emanuele
  • emanuele's Avatar
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 580
  • Thank you received: 67
Hi,

I tried the code above, and it seems to work correctly.
Are you using the same code?

Please Log in or Create an account to join the conversation.

CropBox and MediaBox 8 years 5 months ago #9749

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1123
  • Thank you received: 73
checked codes, and some condition:
--at least standard license actived.
--valid Page handler pass.
--valid pointer of rect struct pass.

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Powered by Kunena Forum