- Posts: 16
- Thank you received: 1
Microsoft Windows Phone 8.1 support ends (13 Jul 2017)
Microsoft has ended support for Windows Phone 8.1
Questions about iOS development and PDF
CropBox and MediaBox
10 years 6 months ago #9600
by tanvi
CropBox and MediaBox was created by tanvi
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.
I know the methods used are Page_getCropBox and Page_getMediaBox, but I don't know how can I implement them.
10 years 6 months ago #9610
by emanuele
Replied by emanuele on topic CropBox and MediaBox
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:
then, you can use these methods in this way:
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:
Code:
-(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:
Code:
PDFPage *page = [m_doc page:1];
PDF_RECT rect1;
PDF_RECT rect2;
rect1 = [page getPageCropBox];
rect2 = [page getPageMediaBox];
10 years 5 months ago #9741
by aurgir
Replied by aurgir on topic CropBox and MediaBox
Page_getCropBox and Page_getMediaBox return false every time I call it. Is it normal ?
10 years 5 months ago #9747
by emanuele
Replied by emanuele on topic CropBox and MediaBox
Hi,
I tried the code above, and it seems to work correctly.
Are you using the same code?
I tried the code above, and it seems to work correctly.
Are you using the same code?
Time to create page: 0.414 seconds