PXCV_DrawPageToDC

This Forum is for the use of Software Developers requiring help and assistance for Tracker Software's PDF-Tools SDK of Library DLL functions(only) - Please use the PDF-XChange Drivers API SDK Forum for assistance with all PDF Print Driver related topics or PDF-XChange Viewer SDK if appropriate.

Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Tracker Supp-Stefan

jeffp
User
Posts: 914
Joined: Wed Sep 30, 2009 6:53 pm

PXCV_DrawPageToDC

Post by jeffp »

I'm using PXCV_DrawPageToDC to produce a TBitmap in Delphi from the PDF Page.

Is there a way to know what the PixelFormat is of the image contained in the PDF page before I convert the page to a Bitmap. I want to keep my Bitmap size down as much as I can especially for black and white image.

Currently, I set the Bitmap pixel format to 24bit because I don't know if the PDF page I'm rasterizing is B&W or Color.

I need a way either before or after calling PXCV_DrawPageToDC to know if I have a B&W, grayscale, or color image.
User avatar
Ivan - Tracker Software
Site Admin
Posts: 3556
Joined: Thu Jul 08, 2004 10:36 pm
Location: Vancouver Island - Canada

Re: PXCV_DrawPageToDC

Post by Ivan - Tracker Software »

No, there is no way to automatically know the 'minimum possible' format for the page.

You can calculate the number of colors in your TBitmap and reduce its format to Palette, Gray or B&W after conversion if the number of colors <= 256.
Tracker Software (Project Director)

When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.