64bit version of Spool File Page Counter SDK. How to call Spool File Page Counter SDK from 64bit application?

Q: Is it possible to get a set of binaries compiled for x64 platform?

A: Page Counter SDK contains a FileInfoCOM.exe file, this is a COM interface, it can be called from both 32bit and 64bit EXE processes, you can run following command line with Administrator privilege to register this COM into your system,

FileInfoCOM.exe /regserver

image

you can call it from your VB6 code like below.

strFileName = varPathCurrent & "\test_tiger.eps"

 

Set FileInfoCom = CreateObject("FileInfoCOM.FileInfoClass")

FileInfoCom.com_ReadInfoSetCode ("XXXXXXXXXXXXXXXXXXX")

nRet = FileInfoCom.com_ReadInfoFromPSFile(strFileName, bIsRenderToPDF, bwPageCount, colorPageCount, copyCount, nPageWidth, nPageHeight, strPaperSizeName)

 

strMsg = strMsg + "FileName = " + strFileName + vbCrLf

strMsg = strMsg + "bIsRenderToPDF = " + CStr(bIsRenderToPDF) + vbCrLf

strMsg = strMsg + "bwPageCount = " + CStr(bwPageCount) + vbCrLf

strMsg = strMsg + "colorPageCount = " + CStr(colorPageCount) + vbCrLf

strMsg = strMsg + "copyCount = " + CStr(copyCount) + vbCrLf

strMsg = strMsg + "PageWidth = " + CStr(nPageWidth) + vbCrLf

strMsg = strMsg + "PageHeight = " + CStr(nPageHeight) + vbCrLf

strMsg = strMsg + "PaperSizeName = " + CStr(strPaperSizeName) + vbCrLf

MsgBox strMsg

 

This is the C# example which can be compiled with "AnyCPU" mode,

using System;

using System.Collections.Generic;

using System.Linq;

using System.Runtime.InteropServices;

using System.Text;

using FileInfoCOM;

 

namespace ParsingTest {

    class Program {

 

        static void Main(string[] args)

        {

            if (args.Length != 1)

            {

                Console.WriteLine("test.exe C:\\test.pcl");

                Console.WriteLine("test.exe C:\\test.ps");

                return;

            }

            Console.Write("args length is ");

            Console.WriteLine(args.Length); // Write array length

            for (int i = 0; i < args.Length; i++) // Loop through array

            {

                string argument = args[i];

                Console.Write("args index ");

                Console.Write(i); // Write index

                Console.Write(" is [");

                Console.Write(argument); // Write string

                Console.WriteLine("]");

            }

            string fileName = args[0];

            int bIsRenderToPDF = 0;

            int bwPageCount = 0;

            int colorPageCount = 0;

            int copyCount = 0;

            double nPageWidth = 0;

            double nPageHeight = 0;

            string strPaperSizeName = new string(' ', 300);

 

            FileInfoCOM.FileInfoClass objFileInfoCom =
                  new FileInfoCOM.FileInfoClassClass();

 

            objFileInfoCom.com_ReadInfoSetCode("XXXXXXXXXXXXXXXXXX");

            objFileInfoCom.com_ReadInfoFromPCLFile(fileName, bIsRenderToPDF,
                  ref bwPageCount, ref colorPageCount,
ref copyCount, ref nPageWidth,
                 
ref nPageHeight, ref strPaperSizeName);

 

            Console.WriteLine(String.Format("File: {0}", fileName));

            Console.WriteLine(String.Format("Render To PDF: {0}", bIsRenderToPDF));

            Console.WriteLine(String.Format("BW Pages: {0}", bwPageCount));

            Console.WriteLine(String.Format("Color Pages: {0}", colorPageCount));

            Console.WriteLine(String.Format("Width: {0}", nPageWidth));

            Console.WriteLine(String.Format("Height: {0}", nPageHeight));

            Console.WriteLine(String.Format("Paper name: {0}", strPaperSizeName));

        }

    }

}

VN:F [1.9.20_1166]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.20_1166]
Rating: 0 (from 0 votes)

Related Posts

One Reply to “64bit version of Spool File Page Counter SDK. How to call Spool File Page Counter SDK from 64bit application?”

  1. I get an error message while trying to run FileInfoCOM.exe /regserver from the cmd prompt on windows 10.

    The message is “Unexpected error; quitting”

    Customer
    ——————————————
    Because your cmd window hasn’t administrator privilege, please run a cmd window with administrator privilege first, and run following command line to register FileInfoCOM.exe, you will get it work fine,

    FileInfoCOM.exe /regserver

    To complete these procedures, you must be a member of the Administrators group.

    1. To start a command prompt as an administrator
    * Click Start, click All Programs, and then click Accessories.
    * Right-click Command prompt, and then click Run as administrator.
    * If the User Account Control dialog box appears, confirm that the action it displays is what you want, and then click Continue.

    2. To start a command prompt as an administrator (alternative method)
    * Click Start.
    * In the Start Search box, type cmd, and then press CTRL+SHIFT+ENTER.
    * If the User Account Control dialog box appears, confirm that the action it displays is what you want, and then click Continue.

    VeryDOC

    [Reply]

    VN:F [1.9.20_1166]
    Rating: 0.0/5 (0 votes cast)
    VN:F [1.9.20_1166]
    Rating: 0 (from 0 votes)

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!