Count pages for PCL, PS, PDF, SPL-EMF formats

Thanks for your understanding, Windows EMF and SPL-EMF are two different formats,  SPL-EMF format is more complex than Windows EMF format.

Additionally, please understand an important matter, SPL is just a "container", it can contain SPL-EMF, SPL-PCL, SPL-PS, etc. data formats for each page, we are support the SPL-EMF format only, it doesn’t support SPL-PCL, SPL-PS and other RAW formats, please understand this matter.

SPL-PCL and SPL-PS formats are not same as standard PCL and PS formats, they have lots of difference.

We have created a new version of ReadInfo.dll to you, please download it from following URL,

XXXXXXXXXXXXXXX

the new version contains following function,

extern "C" __declspec(dllexport)
BOOL WINAPI ReadInfoFromSPLEMFFile(LPCTSTR fileName, BOOL bIsRenderToPDF, DWORD* bwPageCount, DWORD* colorPageCount,
DWORD* copyCount, double* pagewidth, double* pageheight, LPTSTR paperSizeName);

You can use ReadInfoFromSPLEMFFile() function to read the information from SPL-EMF file, if you encounter any problem, please upload your SPL-EMF files to dropbox, then we will work on your SPL-EMF files asap.

==================================
I have been very busy testing the code with SPL-EMF files. Majority of the tests have passed with any problems. However we are seeing one issue with false-positive color detection. I have uploaded files to the drop box under Problems\EMF. All of the files were generated using B&W sources, except the Power Point. Word, Excel, Notepad files - all B&W. However the color was reported for all of them. For the Power Point 1 B&W page  and 57 Color pages were reported, but when I look at it, I can see that slides 1, 4, 5, 27, 46 and 58 (this one is empty) are appear to be B&W. I am using StafOffice to view the document files.

All prints generated from PDF sources however were parsed correctly for color vs B&W. Please let me know if you want to upload those. Hope to hear from you soon, thank you in advance.

Follow up on this. The problem only appears to happen only on x64 platform. On x86 platform B&W detection works great, it even properly detected all 6 B&W pages in Powerpoint document.

Another follow up,

it appears to be working on exactly one machine. I tried different VMs (x86 and x64) and it fails everywhere else. Very puzzling. Here is the output samples

Working:

=======================================
File = 'e:\customers\emf\EMF_Testing_20110413\BrotherMFC-9440CN\powerpoint\7de85eb7-6622-11e0-bb41-000c29747779.spl'
Return Value = TRUE
bIsRenderToPDF = 1
bwPageCount = 6
colorPageCount = 52
copyCount = 1
PageWidht = 2159
PageHeight = 2794
PaperSizeName = 'PaperBox: 0 0 8.5 11'
=============================
Page   1 is [   BW]
Page   2 is [Color]
Page   3 is [Color]
Page   4 is [   BW]
Page   5 is [   BW]
Page   6 is [Color]
Page   7 is [Color]
Page   8 is [Color]
Page   9 is [Color]
Page  10 is [Color]
Page  11 is [Color]
Page  12 is [Color]
Page  13 is [Color]
Page  14 is [Color]
Page  15 is [Color]
Page  16 is [Color]
Page  17 is [Color]
Page  18 is [Color]
Page  19 is [Color]
Page  20 is [Color]
Page  21 is [Color]
Page  22 is [Color]
Page  23 is [Color]
Page  24 is [Color]
Page  25 is [Color]
Page  26 is [Color]
Page  27 is [   BW]
Page  28 is [Color]
Page  29 is [Color]
Page  30 is [Color]
Page  31 is [Color]
Page  32 is [Color]
Page  33 is [Color]
Page  34 is [Color]
Page  35 is [Color]
Page  36 is [Color]
Page  37 is [Color]
Page  38 is [Color]
Page  39 is [Color]
Page  40 is [Color]
Page  41 is [Color]
Page  42 is [Color]
Page  43 is [Color]
Page  44 is [Color]
Page  45 is [Color]
Page  46 is [   BW]
Page  47 is [Color]
Page  48 is [Color]
Page  49 is [Color]
Page  50 is [Color]
Page  51 is [Color]
Page  52 is [Color]
Page  53 is [Color]
Page  54 is [Color]
Page  55 is [Color]
Page  56 is [Color]
Page  57 is [Color]
Page  58 is [   BW]
=============================
Statistics: bwPageCount=6, colorPageCount=52


Not working:

=======================================
File = 'e:\customers\emf\EMF_Testing_20110413\BrotherMFC-9440CN\powerpoint\7de85eb7-6622-11e0-bb41-000c29747779.spl'
Return Value = TRUE
bIsRenderToPDF = 1
bwPageCount = 1
colorPageCount = 57
copyCount = 1
PageWidht = 2159
PageHeight = 2794
PaperSizeName = 'PaperBox: 0 0 8.5 11'
=============================
Page   1 is [Color]
Page   2 is [Color]
Page   3 is [Color]
Page   4 is [Color]
Page   5 is [Color]
Page   6 is [Color]
Page   7 is [Color]
Page   8 is [Color]
Page   9 is [Color]
Page  10 is [Color]
Page  11 is [Color]
Page  12 is [Color]
Page  13 is [Color]
Page  14 is [Color]
Page  15 is [Color]
Page  16 is [Color]
Page  17 is [Color]
Page  18 is [Color]
Page  19 is [Color]
Page  20 is [Color]
Page  21 is [Color]
Page  22 is [Color]
Page  23 is [Color]
Page  24 is [Color]
Page  25 is [Color]
Page  26 is [Color]
Page  27 is [Color]
Page  28 is [Color]
Page  29 is [Color]
Page  30 is [Color]
Page  31 is [Color]
Page  32 is [Color]
Page  33 is [Color]
Page  34 is [Color]
Page  35 is [Color]
Page  36 is [Color]
Page  37 is [Color]
Page  38 is [Color]
Page  39 is [Color]
Page  40 is [Color]
Page  41 is [Color]
Page  42 is [Color]
Page  43 is [Color]
Page  44 is [Color]
Page  45 is [Color]
Page  46 is [Color]
Page  47 is [Color]
Page  48 is [Color]
Page  49 is [Color]
Page  50 is [Color]
Page  51 is [Color]
Page  52 is [Color]
Page  53 is [Color]
Page  54 is [Color]
Page  55 is [Color]
Page  56 is [Color]
Page  57 is [Color]
Page  58 is [   BW]
=============================
Statistics: bwPageCount=1, colorPageCount=57

==================================
I have tried “powerpoint\7de85eb7-6622-11e0-bb41-000c29747779.spl' file in my system just now, I can get following result,

C:\>vc_test.exe "E:\EMF\BrotherMFC-9440CN\powerpoint\7de85eb7-6622-11e0-bb41-000c29747779.spl"
=============================
Page   1 is [   BW]
Page   2 is [Color]
Page   3 is [Color]
Page   4 is [   BW]
Page   5 is [   BW]
Page   6 is [Color]
Page   7 is [Color]
Page   8 is [Color]
Page   9 is [Color]
Page  10 is [Color]
Page  11 is [Color]
Page  12 is [Color]
Page  13 is [Color]
Page  14 is [Color]
Page  15 is [Color]
Page  16 is [Color]
Page  17 is [Color]
Page  18 is [Color]
Page  19 is [Color]
Page  20 is [Color]
Page  21 is [Color]
Page  22 is [Color]
Page  23 is [Color]
Page  24 is [Color]
Page  25 is [Color]
Page  26 is [Color]
Page  27 is [   BW]
Page  28 is [Color]
Page  29 is [Color]
Page  30 is [Color]
Page  31 is [Color]
Page  32 is [Color]
Page  33 is [Color]
Page  34 is [Color]
Page  35 is [Color]
Page  36 is [Color]
Page  37 is [Color]
Page  38 is [Color]
Page  39 is [Color]
Page  40 is [Color]
Page  41 is [Color]
Page  42 is [Color]
Page  43 is [Color]
Page  44 is [Color]
Page  45 is [Color]
Page  46 is [   BW]
Page  47 is [Color]
Page  48 is [Color]
Page  49 is [Color]
Page  50 is [Color]
Page  51 is [Color]
Page  52 is [Color]
Page  53 is [Color]
Page  54 is [Color]
Page  55 is [Color]
Page  56 is [Color]
Page  57 is [Color]
Page  58 is [   BW]
=============================
Statistics: bwPageCount=6, colorPageCount=52
=======================================
Return Value = TRUE
bIsRenderToPDF = 1
bwPageCount = 6
colorPageCount = 52
copyCount = 1
PageWidht = 2159
PageHeight = 2794
PaperSizeName = 'PaperBox: 0 0 8.5 11'

It is same as the “working result” in your email. My system is Windows XP.

Also, just for checking, is this problem appear in VMWare only? Can you get everything work fine in REAL Windows XP or Windows 7 systems? If this problem appear in VMWare only, it may caused color depth or screen resolution in VMWare, please change the color depth to 32bit or 24bit to try again. Please feel free to let me know if this problem appear in VMWare only, then I will install a VMWare to research this problem shortly.

==================================
It actually works on VMWare machine (Server 2003 x86), but failed on "real" Windows 7 x64, and virtual Windows XP (x86), virtual Server 2008 x86 and virtual Server 2003 x64.

All those were hosted on my Windows 7 though. I will test on different vm hosts tomorrow, but we need something that works everywhere. After all it worked fine on the same Windows 7 for 84 other files. I can send you the "working" files if that helps.

==================================
I have copied all files to our Windows 7 x64 system and tried it just now, everything is fine, I can still get "Statistics: bwPageCount=6, colorPageCount=52" for 7de85eb7-6622-11e0-bb41-000c29747779.spl file, I don't know where is wrong in your system.

We have created a new version to you, please download new version from following URL to try again,

XXXXXXXXXXXXXXXXX

if you still have same problem, please let us know, we will add debug information into this version to you asap.

VeryPDF
==================================
The new dll didn't make any difference. I was able to find another virtual Windows XP x86 on my Windows 7 x64 host on which the test passed. But this can't be a solution, the test must pass on all the platforms. Let's explore the option of adding more debug information, thank you in advance.
==================================
Please download the new version of ReadInfo.dll from following URL,
XXXXXXXXXXXXXXXXX
the new version of ReadInfo.dll will create some PNG files in EXE file’s folder, please email these PNG files to us or put them to dropbox, after we checked these PNG files, we will figure out a solution to you asap.

VeryPDF
==================================
Thanks for this update, I think it will help a lot. I uploaded 2 sets of PNG files - Correct and Incorrect. Correct folder contains files that produced by the system with correct page count and Incorrect from the system that reports false-positive color pages.

As far as I can see the problem is with alpha-blend of black edges into white background. Having done some GDI programming myself, this is pretty common. I do believe this is due to the ClearType (anti-aliasing) option for Windows fonts. You can enable and disable option on XP using the tool from the following link:

http://www.quickonlinetips.com/archives/2005/03/turn-on-windows-xp-cleartype-improve-font-display-and-readability/

When I disable ClearType the page count is correct and PNG files don't have smoothing artifacts, when I enable ClearType the page count goes back to incorrect and PNG files show the artifacts.

Please let me know what do you think. Thanks!

==================================
We have solved ClearType font problem for you, please download new version of ReadInfo.dll from following URL to try again,

XXXXXXXXXXXXX

the new version of ReadInfo.dll will disable ClearType before rendering, and then restore ClearType status after rendering, so it will solve this problem properly.

VeryPDF
==================================

Spool File Page Counter SDK can be downloaded from following web page,

http://www.verydoc.com/spool-page-count.html

Related Posts