PDFdev is a service provided by PDFzone.com | http://www.pdfzone.com
_____________________________________________________________

I am not using XObject.  Here are the steps I am using to get my image (bitmap) into 
the PDF:

- scan the image and get the BMP
- save the BMP as a PDF document (1 page) using LEADTools
- open the PDF as a PDDoc and call PDDocInsertPages to put the page into my current doc

I had previously tried using the AddImage sample, but had issues with sizing, etc, 
since our image can be scanned at many possible dpi settings.  The solution above 
works great for us now, since Adobe is handling all the image processing, etc, with 
the exception of the zooming issue.  Thanks.

-Chris

-----Original Message-----
From: Mark Storer [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 18, 2004 12:41 PM
To: '[EMAIL PROTECTED]'
Subject: RE: [PDFdev] Media Box Dimensions



PDFdev is a service provided by PDFzone.com | http://www.pdfzone.com
_____________________________________________________________

Your image isn't being scaled properly.

The way most applications generate images like this is to scale the actual
image resource down to a 1x1 pixel dot, and then use the currect
transformation matrix to scale it up to the desired size (8.5 x 11 in your
case).

You need to set the XObject Image's transformation and add a transformation
to the page contents immediately before the /Do call.

If this is all gibberish to you, could you explain what steps you're using
to insert the image into the PDF?

--Mark Storer
  Software Engineer
  Cardiff Software
#include <disclaimer>
typdef std::disclaimer<Cardiff> Discard;


> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Behalf Of Chris Cyr
> Sent: Wednesday, February 18, 2004 9:19 AM
> To: [EMAIL PROTECTED]
> Subject: RE: [PDFdev] Media Box Dimensions
> 
> 
> 
> PDFdev is a service provided by PDFzone.com | http://www.pdfzone.com
> _____________________________________________________________
> 
> Hi Leonard,
> 
> Thanks for the info, here is my issue.  I am scanning in an 
> image using my own TWAIN implementation and then importing it 
> into a PDF.  I get a BMP from TWAIN, save it as a PDF using 
> LEADTools (1 page) and then use PDDocInsertPages to put the 
> page in my document.  If the image is scanned in at close to 
> 72dpi, the page view "zoom factor" in Acrobat is close to 
> 100%.  If I scan an image at 300dpi, the image is displayed 
> fine on the screen in Acrobat, but it is zoomed out to around 
> 20%.  If I view at 100%, I only see a portion of the image.  
> I believe this has to do with the media box / page 
> dimensions, but can't figure out how to fix it.  I assume 
> this is related to the fact that PDF coordinates are based on 
> 72dpi?  If I manually reset the page's media box, the image 
> is cropped.  Any ideas?  Thanks.
> 
> -Chris
> 
> -----Original Message-----
> From: Leonard Rosenthol [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, February 18, 2004 1:41 PM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED] 
> Subject: Re: [PDFdev] Media Box Dimensions
> 
> 
> 
> PDFdev is a service provided by PDFzone.com | http://www.pdfzone.com
> _____________________________________________________________
> 
> At 06:59 AM 2/18/2004, Chris Cyr wrote:
> >I am using Acrobat 5.0 SDK with C++ to create a plugin.  I 
> first create a 
> >new document and add a blank page to it by calling 
> PDDocCreatePage(PDDoc 
> >doc, int afterPageNum, ASFixedRect mediaBox).  I am trying 
> to figure out 
> >what the dimensions should be for my mediabox to create a 
> regular 8.5" x 
> >11" page (top, bottom, left, right).  Thanks.
> 
>          Although it's not really pixels, if you think about PDF 
> coordinates as being the pixels on a bitmap at 72dpi, all 
> your math will 
> work.  AND don't forget that 0,0 (the origin) is bottom left.
> 
>          So to figure out the size of a mediabox, for 
> example, you can do:
> 
>          8.5 * 72 and 11 * 7.2 for the values.
> 
> 
> Leonard
> --------------------------------------------------------------
> -------------
> Leonard Rosenthol                            
> <mailto:[EMAIL PROTECTED]>
> Chief Technical Officer                      <http://www.pdfsages.com>
> PDF Sages, Inc.                              215-629-3700 (voice)
>                                               215-629-0789 (fax)
> 
> 
> To change your subscription:
> http://www.pdfzone.com/discussions/lists-pdfdev.html
> 
> 
> To change your subscription:
> http://www.pdfzone.com/discussions/lists-pdfdev.html
> 

To change your subscription:
http://www.pdfzone.com/discussions/lists-pdfdev.html


To change your subscription:
http://www.pdfzone.com/discussions/lists-pdfdev.html

Reply via email to