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?

Dear,

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:
http://www.verypdf.com/wordpress/201106/counting-the-exact-number-of-pages-in-any-pdf-document-732.html#comments

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.
Regards
Customer

--------------------------------------------------------

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

https://www.verydoc.com/ps-and-pcl-info-sdk.zip

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;
   
    ReadInfoSetCode("XXXXXXXXXXXXXXXXXXX");
    ReadInfoEnableDebug(1);
    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);
    else
        bRet = ReadInfoFromAllFormats(lpInFile, bIsRenderToPDF, &bwPageCount, &colorPageCount, &copyCount, &nPageWidth, &nPageHeight, szPaperSizeName);
    printf("=======================================\n");
    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);

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

VeryDOC

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!