Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6050565
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:42:09+00:00 2026-05-23T07:42:09+00:00

Given a page from a pdf document, I would like to be able to

  • 0

Given a page from a pdf document, I would like to be able to find the margin for the text, using objetive-C.

I realise there are already many questions relating to CGPDF..., but I have not been able to find anything useful. I have also had a look at the PDF specification doc. I am sure it must be in there somewhere, but I have not been able to find it yet.

Example

I create a Word document which has a left and right margin of 2.5cm each. I then print to pdf. Taking this pdf, is there some way to figure out the width of the text (ie, the left and right page margin)?

Background

In case I am barking up the wrong tree, the reason I am asking this question is to be able to zoom like iBooks zooms. If you double tap on iBooks, it will take zoom you to the width of the main body. This is the same in the Mac’s Preview application (pressing “Zoom to Fit”).

First thoughts

I first thought that maybe PDF Boxes (CGPDFPage) like kCGPDFBleedBox might be able to help, but it does not look like it will help in my case.

Update

I am only concerned with the body text of the page. Images etc, that might be outside this do not bother me.

Related posts

Fast and Lean PDF Viewer for iPhone / iPad / iOs – tips and hints?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T07:42:10+00:00Added an answer on May 23, 2026 at 7:42 am

    You can render the PDF page as a bitmap, detect its pixel status and get the white margins. Take a look at this excellent implementation from Skim: http://skim-app.svn.sourceforge.net/viewvc/skim-app/trunk/NSBitmapImageRep_SKExtensions.m?revision=7036&content-type=text%2Fplain

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Given an HTML page I would like to get all the 'x' files that
How do I read a particular page (given a page number) from a PDF
I'm trying to write javascript to find page elements relative to a given element
I've recently started using iTextSharp to generate PDF reports from data. It works quite
Is it possible to create a thumbnail image from a PDF file using Coldfusion
Is it possible to display any given page from a 3rd party website on
I have the XML given below. From this XML, in an ASPX page with
We're using aspose.word to create a report from a word template direct to PDF
Is there any compatible android library to convert a pdf page to an image
I would like to solve the following problem: Given a link on a Web

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.