CropBox and MediaBox - RadaeePDF.com
Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
13 Jul 2017
Microsoft has ended support for Windows Phone 8.1
Read More...
Questions about iOS development and PDF
  • Page:
  • 1

TOPIC: CropBox and MediaBox

CropBox and MediaBox 3 years 2 months ago #9600

  • tanvi
  • tanvi's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • 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 3 years 2 months ago #9610

  • emanuele
  • emanuele's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 523
  • Karma: 20
  • Thank you received: 60
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 3 years 1 month ago #9741

  • aurgir
  • aurgir's Avatar
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • 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 3 years 1 month ago #9747

  • emanuele
  • emanuele's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 523
  • Karma: 20
  • Thank you received: 60
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 3 years 1 month ago #9749

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 847
  • Karma: 43
  • Thank you received: 12
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