Professional Web Applications Themes

Cropping from C# - Adobe Acrobat SDK

Hi I'm trying to remove the white margins around all pages on my doent via the Acrobat 8.1 SDK and am struggling to workout exactly how to go about it (basically the same functionality if you do Doent>Crop Pages>Remove White Margins). My code works fine up to the point of cropping, but the doent is created via a scanner and I don't know what the cropping rectangle would be. I'm guessing this can be found programmatically using the Media Box, but I have no clue how to do so. Any help would be greatly appreciated!...

  1. #1

    Default Cropping from C#

    Hi

    I'm trying to remove the white margins around all pages on my doent via the Acrobat 8.1 SDK and am struggling to workout exactly how to go about it (basically the same functionality if you do Doent>Crop Pages>Remove White Margins).

    My code works fine up to the point of cropping, but the doent is created via a scanner and I don't know what the cropping rectangle would be. I'm guessing this can be found programmatically using the Media Box, but I have no clue how to do so.

    Any help would be greatly appreciated!
    Tom_Allen@adobeforums.com Guest

  2. #2

    Default Re: Cropping from C#

    There is no "box" in a PDF that represents the white margins. On a non-scanned PDF it can be figured out by finding the bounds of each actual object and then using some math. On a scan, it's MUCH MORE complex involving some interesting pixel logic.

    You will need to do those things yourself and then set he CropBox via IAC. However IAC doesn't give you access to the objects of the page :(.
    Leonard_Rosenthol@adobeforums.com Guest

  3. #3

    Default Re: Cropping from C#

    D'oh, I thought that might be the case.

    I'm going to resist the temptation to send keystrokes to Acrobat just to use the built in function and might look to see if I can find a .Net library to do something for me...

    Thanks for the help :)
    Tom_Allen@adobeforums.com Guest

Similar Threads

  1. Where is the cropping tool?
    By Leigh_Catchepaugh@adobeforums.com in forum Adobe Acrobat Macintosh
    Replies: 2
    Last Post: October 10th, 12:56 PM
  2. Cropping
    By Jay B. in forum Adobe Acrobat Macintosh
    Replies: 5
    Last Post: July 6th, 02:41 PM
  3. Cropping!!!!
    By Ryan_Le@adobeforums.com in forum Adobe Illustrator Windows
    Replies: 2
    Last Post: July 7th, 02:05 PM
  4. cropping problems
    By guybc in forum Adobe Photoshop Elements
    Replies: 8
    Last Post: July 30th, 11:10 PM
  5. Precise Cropping
    By Andrew Yoole in forum Adobe Photoshop 7, CS, CS2 & CS3
    Replies: 23
    Last Post: July 5th, 03:36 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139