Convert page size to pixels

Ask a Question related to Adobe Acrobat SDK, Design and Development.

  1. #1

    Default Convert page size to pixels

    Two (possibly) related questions:

    (1) I am drawing the image of a page to an offscreen bitmap using PDPageDrawContentsToWindow. I need to allocate a correct height and width for the page in pixels for the resulting bitmap. What I want is an image that represents the size of the page at 100% zoom. This is what I've tried:

    ASFixedRect cropBox;
    PDPageGetCropBox(AVPageViewGetPage(pageView), &cropBox);
    AVDevRect pageRect;
    AVPageViewRectToDevice(pageView, &cropBox, &pageRect);
    double zoom = ASFixedToFloat(AVPageViewGetZoom(pageView));
    int pageWidth = (int) (abs(pageRect.right - pageRect.left) / zoom);
    int pageHeight = (int) (abs(pageRect.bottom - pageRect.top) / zoom);

    The above width and height are too large for the image drawn to my bitmap by PDPageDrawContentsToWindow.

    (2) I notice that when I select File | Export | Image in Acrobat and save the page as a JPEG, the resulting image width and height are substantially larger than the width and height calculated in #1 (which are themselves too large for the PDPageDrawContentsToWindow function). How does Acrobat choose an optimal width/height to avoid aliasing? The size of my output image is arbitrary; I want to choose a width and height that are optimal to capture the image data of the original page, and understand how to scale the output of PDPageDrawContentsToWindow to those values.

    Thanks!

    Steve
    Steve_J_Willis@adobeforums.com Guest

  2. Similar Questions and Discussions

    1. Document Size = Picture Size (in pixels)
      I've been doing a lot of picture annotations for this muscle physiology lab I'm doing work for. Basically I take a picture of some muscle, place it...
    2. web page size in pixels
      When creating a flash to be used as a web page. What is the general size that works best. Thank you in advance for you help with this.
    3. The size in pixels of text
      Hi, I have a text member that it's text is changed on time to time, and I need to know the size in pixels of the current text at a time I'm...
    4. CAN I CHANGE SIZE (PIXELS) OF A PROJECTOR TO REDUCE THE FILE SIZE?
      as far as I know you would have to transform bitmap scale all bitmap members to the new size, then readjust their positions to score, and adjust...
    5. convert pixels to centimeters
      Hi, I have a printed format and need to translate it to the screen (web page); so when the visitors print it from the web they get the same printed...
  3. #2

    Default Re: Convert page size to pixels

    You don't need to deal with the AV stuff here - just the page size...

    BUT you need to remember to multiply by the resolution...

    Leonard
    Leonard_Rosenthol@adobeforums.com Guest

  4. #3

    Default Re: Convert page size to pixels

    Could you give me a more concrete example? I don't understand how to get the page size without dealing with the AV stuff.

    My question is probably simpler than I stated above: PDPageDrawContentsToWindow will draw the page to a bitmap of some size, measured in pixels. I need to know what that size is in advance so I can create a correctly sized bitmap for it to draw on to hold the entire page. How do I determine the width and height of the page image PDPageDrawContentsToWindow will draw in pixels?

    Your help is appreciated!

    Steve
    Steve_J_Willis@adobeforums.com Guest

Posting Permissions

  • You may not post new threads
  • You may 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