PDF Page Counter SDK, Pages BW or Color, how to get color, gray, black and white color information from PDF, PS, PCL, PRN, SPL-EMF, etc. spool file formats?


We bought the Spool File Page Counter SDK Server License last year.

In VC, we change the code "printf" by "fprintf" meaning out to a file.
But the information as :
"Page 1 is [Color]
Page 2 is [Color]
Page 3 is [ BW]"
etc. ...
always "print" on the console !

On the VeryDOC knowledge base:

you wrote :
"In the demo version, the following information is printed to console only" ... "after you purchase it, we will send a new version of SDK to you, you will able to get color information for each page from SDK easily, the demo version hasn’t this function yet."

==> Please can you send us the good one version of the SDK.


Thanks for your message, please download the latest version of "Spool File Page Counter SDK" from following URL,


the latest version of "Spool File Page Counter SDK" has included this function, you can get the color information from each PDF/PS/PCL/PRN/SPL/EMF/EMF-SPL page using following source code,

void DumpInformation(char *lpInFile, BOOL bIsRenderToPDF)
    char drive[_MAX_DRIVE];
    char dir[_MAX_DIR];
    char fname[_MAX_FNAME];
    char ext[_MAX_EXT];
    _splitpath(lpInFile, drive, dir, fname, ext );
    DWORD bwPageCount = 0;
    DWORD colorPageCount = 0;
    DWORD copyCount = 0;
    double nPageWidth = 0;
    double nPageHeight = 0;
    char szPaperSizeName[200] = {0};
    BOOL bRet = FALSE;
    if(!stricmp(ext, ".ps") || !stricmp(ext, ".eps"))
        bRet = ReadInfoFromPSFile(lpInFile, bIsRenderToPDF, &bwPageCount, &colorPageCount, &copyCount, &nPageWidth, &nPageHeight, szPaperSizeName);
    else if(!stricmp(ext, ".pcl"))
        bRet = ReadInfoFromPCLFile(lpInFile, bIsRenderToPDF, &bwPageCount, &colorPageCount, &copyCount, &nPageWidth, &nPageHeight, szPaperSizeName);
        bRet = ReadInfoFromAllFormats(lpInFile, bIsRenderToPDF, &bwPageCount, &colorPageCount, &copyCount, &nPageWidth, &nPageHeight, szPaperSizeName);
    printf("File = '%s'\n", lpInFile);
    printf("Return Value = %s\n", bRet?"TRUE":"FALSE");
    printf("bIsRenderToPDF = %d\n", bIsRenderToPDF);
    printf("bwPageCount = %d\n", bwPageCount);
    printf("colorPageCount = %d\n", colorPageCount);
    printf("copyCount = %d\n", copyCount);
    printf("PageWidth = %g\n", nPageWidth);
    printf("PageHeight = %g\n", nPageHeight);
    printf("PaperSizeName = '%s'\n", szPaperSizeName);

        int nPageCount = ReadInfoGetPageCount();
        printf("Color Information for each page (%d pages):\n", nPageCount);
        for(int i = 0; i < nPageCount; i++)
            int nColor = ReadInfoGetPageColorInfo(i);
            case 1:
                printf("Page %3d is [Color]\n", i+1);
            case 2:
                printf("Page %3d is [   BW]\n", i+1);
            case 3:
                printf("Page %3d is [ Gray]\n", i+1);
                printf("[Failed to get color information from Page %3d]\n", i+1);


VN:F [1.9.20_1166]
Rating: 9.5/10 (2 votes cast)
VN:F [1.9.20_1166]
Rating: 0 (from 0 votes)
PDF Page Counter SDK, Pages BW or Color, how to get color, gray, black and white color information from PDF, PS, PCL, PRN, SPL-EMF, etc. spool file formats?, 9.5 out of 10 based on 2 ratings

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *

Verify Code   If you cannot see the CheckCode image,please refresh the page again!