PageProcessor

The PageProcessor property is used to define the custom DLL which will intercept the data stream generated by the Amyuni PDF Converter for processing other than the default saving to a file or sending by e-mail.

 

Syntax

ActiveX:

System.String PageProcessor

DLL:

int SetPageProcessor(HANDLE hPrinter, LPCSTR szPageProcDll)

 

Parameters

PageProcessor, szPageProcDll

[in, out] custom DLL to be used for the processing of the Data Stream.

 

hPrinter

Handle to printer returned by any of the DriverInit function calls.

 

Return Value

SetPageProcessor returns 1 if successful, 0 otherwise.

 

Remarks

Interception the Data Stream requires a special license.  Please, contact our Sales Department to get more information.

 

Member of CDIntfEx.CDIntfEx.

 

Example

Module Module1

 

    <Flags()>

    Public Enum acFileNameOptions As Integer

        NoPrompt = &H1

        UseFileName = &H2

        Concatenate = &H4

        DisableCompression = &H8

        EmbedFonts = &H10

        BroadcastMessages = &H20

        PrintWatermark = &H40

        MultilingualSupport = &H80

        EncryptDocument = &H100

        FullEmbed = &H200

        UseTcpIpServer = &H400

        SendByEmail = &H800

        ConfirmOverwrite = &H1000

        AppendExisting = &H2000

        AddDateTime = &H3000

        AddIdNumber = &H4000

        LinearizeForWeb = &H8000

        PostProcessing = &H10000

        QualityLevelLow = &H20000

        QualityLevelMedium = &H40000

        QualityLevelHigh = &H60000

        Colors2GrayScale = &H80000

        ConvertHyperlinks = &H100000

        EmbedStandardFonts = &H200000

        EmbedLicensedFonts = &H400000

        Color256Compression = &H800000

        Jpeg2000Compression = &H1000000

        SendToCreator = &H2000000

        ExportToHTML = &H4000000

        ExportToRTF = &H8000000

        ExportToJPEG = &H10000000

        CCITTCompression = &H20000000

        EncryptDocument128 = &H40000000

        AutoImageCompression = &H80000000

    End Enum

 

    Sub Main()

        ' Constants for Activation codes

        Const strLicenseTo As String = "Amyuni PDF Converter Evaluation"

        Const strActivationCode As String = "07EFCDAB0100010025AFF1801CB9441306C5739F7D452154D8833B9CECBA2ADE79E3762A69FFC354528A5F4A5811BE3204A0A439F5BA"

        Const AMYUNIPRINTERNAME As String = "Amyuni PDF Converter"

 

        ' Declare a new cdintfex object if it does not exist in the form.

        Dim PDF As New CDIntfEx.CDIntfEx

 

        ' Get a reference to the installed printer.

        ' This will fail if the printer name passed to the DriverInit method is 

        ' not found in the printer’s folder

        PDF.DriverInit(AMYUNIPRINTERNAME)

 

        ' The SetDefaultPrinter function sets the system default printer to the one

        ' initialized by the DriverInit functions.

        PDF.SetDefaultPrinter()

 

        ' The EnablePrinter() method needs to be called right before each print job.

        ' and before the configuration

        ' Calling the EnablePrinter() method will start a 20 second time-out value

        PDF.EnablePrinter(strLicenseTo, strActivationCode)

 

        ' Set Printer options

        PDF.FileNameOptionsEx = acFileNameOptions.SendToCreator

 

        ' Set Custom Dll

        PDF.PageProcessor = "ACPgProc.dll"

 

        ' Print a sample document

        Dim fileName As String = "C:\temp\test.txt"

 

        ' The BatchConvert method converts a number of files to PDF.

        PDF.BatchConvert(fileName)

 

        ' The RestoreDefaultPrinter function resets the system default printer 

        ' to the printer that was the default before the call to SetDefaultPrinter.

        PDF.RestoreDefaultPrinter()

 

        ' This function will simply detach from an existing printer because the handle was created using DriverInit

        PDF.DriverEnd()

    End Sub

End Module

using Microsoft.Office.Interop.Word;

using System;

 

 

namespace DataSteamConverter_CS

{

    class Program

    {

        [Flags]

        public enum acFileNameOptions

        {

            NoPrompt = 0x00000001,

            UseFileName = 0x00000002,

            Concatenate = 0x00000004,

            DisableCompression = 0x00000008,

            EmbedFonts = 0x00000010,

            BroadcastMessages = 0x00000020,

            PrintWatermark = 0x00000040,

            MultilingualSupport = 0x00000080,

            EncryptDocument = 0x00000100,

            FullEmbed = 0x00000200,

            UseTcpIpServer = 0x00000400,

            SendByEmail = 0x00000800,

            ConfirmOverwrite = 0x00001000,

            AppendExisting = 0x00002000,

            AddDateTime = 0x00003000,

            AddIdNumber = 0x00004000,

            LinearizeForWeb = 0x00008000,

            PostProcessing = 0x00010000,

            QualityLevelLow = 0x00020000,

            QualityLevelMedium = 0x00040000,

            QualityLevelHigh = 0x00060000,

            Colors2GrayScale = 0x00080000,

            ConvertHyperlinks = 0x00100000,

            EmbedStandardFonts = 0x00200000,

            EmbedLicensedFonts = 0x00400000,

            Color256Compression = 0x00800000,

            Jpeg2000Compression = 0x01000000,

            SendToCreator = 0x02000000,

            ExportToHTML = 0x04000000,

            ExportToRTF = 0x08000000,

            ExportToJPEG = 0x10000000,

            CCITTCompression = 0x20000000,

            EncryptDocument128 = 0x40000000,

            AutoImageCompression = unchecked((int)0x80000000)

        }

 

        static void Main(string[] args)

        {

            // Constants for Activation codes

            const string strLicenseTo = "Amyuni PDF Converter Evaluation";

            const string strActivationCode = "07EFCDAB0100010025AFF1801CB9441306C5739F7D452154D8833B9CECBA2ADE79E3762A69FFC354528A5F4A5811BE3204A0A439F5BA";

            const string AMYUNIPRINTERNAME = "Amyuni PDF Converter";

 

            // Declare a new cdintfex object if it does not exist in the form.

            CDIntfEx.CDIntfEx PDF = new CDIntfEx.CDIntfEx();

 

            // Get a reference to the installed printer.

            // This will fail if the printer name passed to the DriverInit method is 

            // not found in the printer’s folder

            PDF.DriverInit(AMYUNIPRINTERNAME);

 

            // The SetDefaultPrinter function sets the system default printer to the one

            // initialized by the DriverInit functions.

            PDF.SetDefaultPrinter();

 

            // The EnablePrinter() method needs to be called right before each print job.

            // and before the configuration

            // Calling the EnablePrinter() method will start a 20 second time-out value

            PDF.EnablePrinter(strLicenseTo, strActivationCode);

 

            // Set Printer options

            PDF.FileNameOptionsEx = (int)acFileNameOptions.SendToCreator;

 

            // Set Custom Dll

            PDF.PageProcessor = "ACPgProc.dll";

 

            // Print a sample document

            string fileName = @"C:\temp\test.txt";

 

            // The BatchConvert method converts a number of files to PDF.

            PDF.BatchConvert(fileName);

 

            // The RestoreDefaultPrinter function resets the system default printer 

            // to the printer that was the default before the call to SetDefaultPrinter.

            PDF.RestoreDefaultPrinter();

 

            // This function will simply detach from an existing printer because the handle was created using DriverInit

            PDF.DriverEnd();

 

            // Destroy PDF object

            PDF = null;

        }

 

    }

}

// PDF Converter Cpp.cpp : Defines the entry point for the console application.

// 

 

#include <Windows.h>

#include <string>

#include <iostream>

#include "CdIntf.h"

#pragma comment (lib, "CDIntf.lib")

 

using namespace std;

int main()

{

    // Constants for Activation codes

#define strLicenseTo  "Amyuni PDF Converter Evaluation"

#define strActivationCode "07EFCDAB0100010025AFF1801CB9441306C5739F7D452154D8833B9CECBA2ADE79E3762A69FFC354528A5F4A5811BE3204A0A439F5BA"

#define AMYUNIPRINTERNAME "Amyuni PDF Converter"

 

    // Get a reference to the installed printer.

    // This will fail if the printer name passed to the DriverInit method is 

    // not found in the printer’s folder

    HANDLE PDF = DriverInit(AMYUNIPRINTERNAME);

 

    // The CDISetDefaultPrinter function sets the system default printer to the one

    // initialized by the DriverInit functions.

    CDISetDefaultPrinter(PDF);

 

    // The EnablePrinter() method needs to be called right before each print job.

    // and before the configuration

    // Calling the EnablePrinter() method will start a 20 second time-out value

    EnablePrinter(PDF, strLicenseTo, strActivationCode);

 

    // Set Printer options

    SetFileNameOptions(PDF, SendToCreator);

 

    // Set Custom Dll

    SetPageProcessor(PDF, "ACPgProc.dll");

 

    // Print a sample document

    LPSTR fileName = "C:\\temp\\test.txt";

 

    // The BatchConvert method converts a number of files to PDF.

    BatchConvertEx(PDF, fileName);

 

    // The RestoreDefaultPrinter function resets the system default printer 

    // to the printer that was the default before the call to SetDefaultPrinter.

    RestoreDefaultPrinter(PDF);

 

    // This function will simply detach from an existing printer because the handle was created using DriverInit

    DriverEnd(PDF);

 

    // Destroy PDF object

    PDF = nullptr;

 

    return 0;

}

package Example;

 

import com.jacob.activeX.ActiveXComponent;

import com.jacob.com.Dispatch;

 

public class DataStream {

    public enum acFileNameOptions

        {

            NoPrompt(0x00000001),

            UseFileName(0x00000002),

            Concatenate(0x00000004),

            DisableCompression(0x00000008),

            EmbedFonts(0x00000010),

            BroadcastMessages(0x00000020),

            PrintWatermark(0x00000040),

            MultilingualSupport(0x00000080),

            EncryptDocument(0x00000100),

            FullEmbed(0x00000200),

            UseTcpIpServer(0x00000400),

            SendByEmail(0x00000800),

            ConfirmOverwrite(0x00001000),

            AppendExisting(0x00002000),

            AddDateTime(0x00003000),

            AddIdNumber(0x00004000),

            LinearizeForWeb(0x00008000),

            PostProcessing(0x00010000),

            QualityLevelLow(0x00020000),

            QualityLevelMedium(0x00040000),

            QualityLevelHigh(0x00060000),

            Colors2GrayScale(0x00080000),

            ConvertHyperlinks(0x00100000),

            EmbedStandardFonts(0x00200000),

            EmbedLicensedFonts(0x00400000),

            Color256Compression(0x00800000),

            Jpeg2000Compression(0x01000000),

            SendToCreator(0x02000000),

            ExportToHTML(0x04000000),

            ExportToRTF(0x08000000),

            ExportToJPEG(0x10000000),

            CCITTCompression(0x20000000),

            EncryptDocument128(0x40000000),

            AutoImageCompression(0x80000000);

            private int value;

            private acFileNameOptions(int value)

            {

                this.value = value;

            }

            public Object value(){

                return value;

            }        }

    public static void main(String[] args)

    {

        // Constants for Activation codes

        String strLicenseTo  = "Amyuni Tech. Evaluation";

        String strActivationCode = "07EFCDAB01000100DF6EFC8664508CC905BADA9A6C56066D8219C78B8804C5D09ECA85769789782B3945B0ECA66CB3612C5D7772F0B9";

        String AMYUNIPRINTERNAME = "Amyuni PDF Converter";

 

        // Declare a new cdintfex object if it doesn' t exist in the form.

        ActiveXComponent pdf = new ActiveXComponent("CDIntfEx.CDIntfEx.6.5"); 

 

        // Get a reference to the installed printer.

        // This will fail if the printer name passed to the DriverInit method is 

        // not found in the printer’s folder

        Dispatch.call(pdf,"DriverInit",AMYUNIPRINTERNAME);

 

        // The SetDefaultPrinter function sets the system default printer to the one

        // initialized by the DriverInit functions.

        Dispatch.call(pdf,"SetDefaultPrinter");

 

        // The EnablePrinter()method needs to be called right before each print job.

        // and before the configuration

        // Calling the EnablePrinter()method will start a 20 second time-out value

        Dispatch.call(pdf,"EnablePrinter", strLicenseTo, strActivationCode); 

 

        // Set Printer options

        Dispatch.put(pdf,"FileNameOptionsEx",acFileNameOptions.SendToCreator.value);

 

        // Set Custom Dll

        Dispatch.put(pdf,"PageProcessor", "ACPgProc.dll");

 

        // Print a sample document

        String fileName = "C:\\temp\\test.txt";

 

        // The BatchConvert method converts a number of files to PDF.

        Dispatch.call(pdf,"BatchConvert", fileName);

 

        // The RestoreDefaultPrinter function resets the system default printer 

        // to the printer that was the default before the call to SetDefaultPrinter.

        Dispatch.call(pdf,"RestoreDefaultPrinter"); 

 

        // This function will simply detach from an existing printer because the handle was created using DriverInit

        Dispatch.call(pdf,"DriverEnd");

    }

}

$acFileNameOptions = @{

    NoPrompt = 0x00000001

    UseFileName = 0x00000002

    Concatenate = 0x00000004

    DisableCompression = 0x00000008

    EmbedFonts = 0x00000010

    BroadcastMessages = 0x00000020

    PrintWatermark = 0x00000040

    MultilingualSupport = 0x00000080

    EncryptDocument = 0x00000100

    FullEmbed = 0x00000200

    UseTcpIpServer = 0x00000400

    SendByEmail = 0x00000800

    ConfirmOverwrite = 0x00001000

    AppendExisting = 0x00002000

    AddDateTime = 0x00003000

    AddIdNumber = 0x00004000

    LinearizeForWeb = 0x00008000

    PostProcessing = 0x00010000

    QualityLevelLow = 0x00020000

    QualityLevelMedium = 0x00040000

    QualityLevelHigh = 0x00060000

    Colors2GrayScale = 0x00080000

    ConvertHyperlinks = 0x00100000

    EmbedStandardFonts = 0x00200000

    EmbedLicensedFonts = 0x00400000

    Color256Compressio = 0x00800000

    Jpeg2000Compression = 0x01000000

    SendToCreator = 0x02000000

    ExportToHTML = 0x04000000

    ExportToRTF = 0x08000000

    ExportToJPEG = 0x10000000

    CCITTCompression = 0x20000000

    EncryptDocument128 = 0x40000000

    AutoImageCompression = 0x80000000

}

 

# Constants for Activation codes

$strLicenseTo  =  "Amyuni PDF Converter Evaluation"

$strActivationCode = "07EFCDAB0100010025AFF1801CB9441306C5739F7D452154D8833B9CECBA2ADE79E3762A69FFC354528A5F4A5811BE3204A0A439F5BA"

$AMYUNIPRINTERNAME = "Amyuni PDF Converter"

 

#Declare a new cdintfex object if it does not exist in the form.

$PDF = New-Object -ComObject CDIntfEx.CDIntfEx.6.5

 

#Get a reference to the installed printer.

#This will fail if the printer name passed to the DriverInit method is 

#not found in the printer’s folder

[System.__ComObject].InvokeMember('DriverInit', [System.Reflection.BindingFlags]::InvokeMethod,$null,$PDF,$AMYUNIPRINTERNAME) 

 

#The SetDefaultPrinter function sets the system default printer to the one

#initialized by the DriverInit functions.

[System.__ComObject].InvokeMember('SetDefaultPrinter', [System.Reflection.BindingFlags]::InvokeMethod,$null,$PDF,$null) 

 

#The EnablePrinter() method needs to be called right before each print job.

#and before the configuration

#Calling the EnablePrinter() method will start a 20 second time-out value

[System.__ComObject].InvokeMember('EnablePrinter', [System.Reflection.BindingFlags]::InvokeMethod,$null,$PDF, @($strLicenseTo, $strActivationCode))

 

#Set Printer options

[System.__ComObject].InvokeMember('FileNameOptionsEx', [System.Reflection.BindingFlags]::SetProperty,$null,$PDF,$acFileNameOptions::SendToCreator)

 

#Set Custom Dll

[System.__ComObject].InvokeMember('PageProcessor', [System.Reflection.BindingFlags]::SetProperty,$null,$PDF,"ACPgProc.dll")

 

#Print a sample document

$fileName = "C:\temp\test.txt"

 

#The BatchConvert method converts a number of files to PDF.

[System.__ComObject].InvokeMember('BatchConvert', [System.Reflection.BindingFlags]::InvokeMethod,$null,$PDF, $fileName)

 

#The RestoreDefaultPrinter function resets the system default printer 

#to the printer that was the default before the call to SetDefaultPrinter.

[System.__ComObject].InvokeMember('RestoreDefaultPrinter', [System.Reflection.BindingFlags]::InvokeMethod,$null,$PDF,$null) 

 

#This function will simply detach from an existing printer because the handle was created using DriverInit 

[System.__ComObject].InvokeMember('DriverEnd', [System.Reflection.BindingFlags]::InvokeMethod,$null,$PDF,$null) 

 

#Destroy PDF object

$PDF = $null

 

' FileNameOptions constants

Const NoPrompt = &H1

Const UseFileName = &H2

Const Concatenate = &H4

Const DisableCompression = &H8

Const EmbedFonts = &H10

Const BroadcastMessages = &H20

Const PrintWatermark = &H40

Const MultilingualSupport = &H80

Const EncryptDocument = &H100

Const FullEmbed = &H200

Const UseTcpIpServer = &H400

Const SendByEmail = &H800

Const ConfirmOverwrite = &H1000

Const AppendExisting = &H2000

Const AddDateTime = &H3000

Const AddIdNumber = &H4000

Const LinearizeForWeb = &H8000

Const PostProcessing = &H10000

Const QualityLevelLow = &H20000

Const QualityLevelMedium = &H40000

Const QualityLevelHigh = &H60000

Const Colors2GrayScale = &H80000

Const ConvertHyperlinks = &H100000

Const EmbedStandardFonts = &H200000

Const EmbedLicensedFonts = &H400000

Const Color256Compression = &H800000

Const Jpeg2000Compression = &H1000000

Const SendToCreator = &H2000000

Const ExportToHTML = &H4000000

Const ExportToRTF = &H8000000

Const ExportToJPEG = &H10000000

Const CCITTCompression = &H20000000

Const EncryptDocument128 = &H40000000

Const AutoImageCompression = &H80000000

 

' Constants for Activation codes

Const strLicenseTo = "Amyuni PDF Converter Evaluation"

Const strActivationCode = "07EFCDAB0100010025AFF1801CB9441306C5739F7D452154D8833B9CECBA2ADE79E3762A69FFC354528A5F4A5811BE3204A0A439F5BA"

Const AMYUNIPRINTERNAME = "Amyuni PDF Converter"

 

' Declare a new cdintfex object

Dim PDF

Set PDF = CreateObject("CDIntfEx.CDIntfEx.6.5")

 

' Get a reference to the installed printer.

' This will fail if the printer name passed to the DriverInit method is

' not found in the printer’s folder

PDF.DriverInit AMYUNIPRINTERNAME

 

' The SetDefaultPrinter function sets the system default printer to the one

' initialized by the DriverInit functions.

PDF.SetDefaultPrinter

 

' The EnablePrinter() method needs to be called right before each print job.

' and before the configuration

' Calling the EnablePrinter() method will start a 20 second time-out value

PDF.EnablePrinter strLicenseTo, strActivationCode

 

' Set Printer options

PDF.FileNameOptionsEx = SendToCreator

 

' Set Custom Dll

PDF.PageProcessor = "ACPgProc.dll"

 

' Print a sample document

Dim fileName

fileName = "C:\temp\test.txt"

 

' The BatchConvert method converts a number of files to PDF.

PDF.BatchConvert fileName

 

' The RestoreDefaultPrinter function resets the system default printer

' to the printer that was the default before the call to SetDefaultPrinter.

PDF.RestoreDefaultPrinter

 

' This function will simply detach from an existing printer because the handle was created using DriverInit

PDF.DriverEnd

 

' Destroy PDF object

Set PDF = Nothing