//--------------------------------------------------------------------//
        //                                                        M e t h o d //
        // g e n e r a t e J o b                                              //
        //--------------------------------------------------------------------//
        //                                                                    //
        // Generate test data.                                                //
        //                                                                    //
        // Some sequences are built up as (Unicode) strings, then converted   //
        // to byte arrays before writing out - this works OK because all the  //
        // characters we're using are within the ASCII range (0x00-0x7f) and  //
        // are hence represented using a single byte in the UTF-8 encoding.   //
        //                                                                    //
        //--------------------------------------------------------------------//

        public static void generateJob(BinaryWriter prnWriter,
                                       Int32 indxPaperSize,
                                       Int32 indxPaperType,
                                       Int32 indxOrientation,
                                       Boolean formAsMacro,
                                       UInt32 codePoint,
                                       Int32 indxFont,
                                       PCLFonts.eVariant fontVar)
        {
            PCLOrientations.eAspect aspect;

            UInt16 logXOffset;

            //----------------------------------------------------------------//

            aspect = PCLOrientations.getAspect(indxOrientation);

            logXOffset = PCLPaperSizes.getLogicalOffset(indxPaperSize,
                                                        _unitsPerInch, aspect);

            _logPageWidth = PCLPaperSizes.getLogPageWidth(indxPaperSize,
                                                          _unitsPerInch,
                                                          aspect);

            _logPageHeight = PCLPaperSizes.getLogPageLength(indxPaperSize,
                                                            _unitsPerInch,
                                                            aspect);

            _paperWidth = PCLPaperSizes.getPaperWidth(indxPaperSize,
                                                      _unitsPerInch,
                                                      aspect);

            _paperHeight = PCLPaperSizes.getPaperLength(indxPaperSize,
                                                        _unitsPerInch,
                                                        aspect);

            //----------------------------------------------------------------//

            generateJobHeader(prnWriter,
                              indxPaperSize,
                              indxPaperType,
                              indxOrientation,
                              formAsMacro,
                              logXOffset);

            generatePage(prnWriter,
                         indxPaperSize,
                         indxPaperType,
                         indxOrientation,
                         formAsMacro,
                         logXOffset,
                         codePoint,
                         indxFont,
                         fontVar);

            generateJobTrailer(prnWriter, formAsMacro);
        }
        //--------------------------------------------------------------------//
        //                                                        M e t h o d //
        // g e n e r a t e J o b                                              //
        //--------------------------------------------------------------------//
        //                                                                    //
        // Generate test data.                                                //
        //                                                                    //
        // Some sequences are built up as (Unicode) strings, then converted   //
        // to byte arrays before writing out - this works OK because all the  //
        // characters we're using are within the ASCII range (0x00-0x7f) and  //
        // are hence represented using a single byte in the UTF-8 encoding.   //
        //                                                                    //
        //--------------------------------------------------------------------//

        public static void generateJob(BinaryWriter prnWriter,
                                       Int32 indxPaperSize,
                                       Int32 indxPaperType,
                                       Int32 indxOrientation,
                                       Boolean formAsMacro)
        {
            PCLOrientations.eAspect aspect;

            UInt16 logXOffset;

            //----------------------------------------------------------------//

            aspect = PCLOrientations.getAspect(indxOrientation);

            logXOffset = PCLPaperSizes.getLogicalOffset(indxPaperSize,
                                                        _unitsPerInch, aspect);

            _logPageWidth = PCLPaperSizes.getLogPageWidth(indxPaperSize,
                                                          _unitsPerInch,
                                                          aspect);

            _logPageHeight = PCLPaperSizes.getLogPageLength(indxPaperSize,
                                                            _unitsPerInch,
                                                            aspect);

            _paperWidth = PCLPaperSizes.getPaperWidth(indxPaperSize,
                                                      _unitsPerInch,
                                                      aspect);

            _paperHeight = PCLPaperSizes.getPaperLength(indxPaperSize,
                                                        _unitsPerInch,
                                                        aspect);

            //----------------------------------------------------------------//

            getPatternData();

            generateJobHeader(prnWriter,
                              indxPaperSize,
                              indxPaperType,
                              indxOrientation,
                              formAsMacro,
                              logXOffset);

            patternDefineDpi300(prnWriter, _patternBase_300);

            patternDefineDpi600(prnWriter, _patternBase_600);

            generatePage(prnWriter,
                         indxPaperSize,
                         indxPaperType,
                         indxOrientation,
                         formAsMacro,
                         logXOffset);

            patternDeleteSet(prnWriter, _patternBase_300);

            patternDeleteSet(prnWriter, _patternBase_600);

            generateJobTrailer(prnWriter, formAsMacro);
        }
Example #3
0
        //--------------------------------------------------------------------//
        //                                                        M e t h o d //
        // g e n e r a t e J o b                                              //
        //--------------------------------------------------------------------//
        //                                                                    //
        // Generate test data.                                                //
        //                                                                    //
        // Most sequences are built up as (Unicode) strings, then converted   //
        // to byte arrays before writing out - this works OK because all the  //
        // characters we're using are within the ASCII range (0x00-0x7f) and  //
        // are hence represented using a single byte in the UTF-8 encoding.   //
        //                                                                    //
        //--------------------------------------------------------------------//

        public static void generateJob(BinaryWriter prnWriter,
                                       Int32 pageCount,
                                       Int32[]      indxPaperSize,
                                       Int32[]      indxPaperType,
                                       Int32[]      indxPaperTray,
                                       Int32[]      indxPlexMode,
                                       Int32[]      indxOrientFront,
                                       Int32[]      indxOrientRear,
                                       Boolean formAsMacro)
        {
            Int32[] indxFormsFront = new Int32[pageCount];
            Int32[] indxFormsRear  = new Int32[pageCount];

            Int16[] macroIdsFront = new Int16[pageCount];
            Int16[] macroIdsRear  = new Int16[pageCount];

            Single[] scaleFactors = new Single[pageCount];

            Int32 formCountFront = 0;
            Int32 formCountRear  = 0;

            //----------------------------------------------------------------//
            //                                                                //
            // Set up the scaling data for each sheet, relative to the A4     //
            // paper size dimensions.                                         //
            //                                                                //
            //----------------------------------------------------------------//

            Single A4LengthPort =
                (Single)PCLPaperSizes.getPaperLength(
                    (Int32)PCLPaperSizes.eIndex.ISO_A4,
                    _unitsPerInch,
                    PCLOrientations.eAspect.Portrait);

            for (Int32 i = 0; i < pageCount; i++)
            {
                scaleFactors[i] = (Single)
                                  (PCLPaperSizes.getPaperLength(
                                       indxPaperSize[i],
                                       _unitsPerInch,
                                       PCLOrientations.eAspect.Portrait) /
                                   A4LengthPort);
            }

            //----------------------------------------------------------------//
            //                                                                //
            // We'll also set the logical page offset value to be used on all //
            // pages (and all overlays) from the value for the front of the   //
            // first sheet.                                                   //
            // This may be inaccurate for subsequent sheets (but only if they //
            // use different page sizes and/or orientations), but the error   //
            // will be minimal (at most, about 30 'dots', or 0.05 inch).      //
            //                                                                //
            //----------------------------------------------------------------//

            _logPageOffset = PCLPaperSizes.getLogicalOffset(
                indxPaperSize[0],
                _unitsPerInch,
                PCLOrientations.getAspect(indxOrientFront[0]));

            //----------------------------------------------------------------//
            //                                                                //
            // Generate the print job.                                        //
            //                                                                //
            //----------------------------------------------------------------//

            generateJobHeader(prnWriter);


            if (formAsMacro)
            {
                generateOverlaySet(prnWriter,
                                   pageCount,
                                   indxPaperSize,
                                   indxPlexMode,
                                   scaleFactors,
                                   ref formCountFront,
                                   ref formCountRear,
                                   ref indxFormsFront,
                                   ref indxFormsRear,
                                   ref macroIdsFront,
                                   ref macroIdsRear);
            }

            generatePageSet(prnWriter,
                            pageCount,
                            indxPaperSize,
                            indxPaperType,
                            indxPaperTray,
                            indxPlexMode,
                            indxOrientFront,
                            indxOrientRear,
                            indxFormsFront,
                            indxFormsRear,
                            macroIdsFront,
                            macroIdsRear,
                            scaleFactors,
                            formAsMacro);

            if (formAsMacro)
            {
                generateOverlayDeletes(prnWriter,
                                       formCountFront, formCountRear,
                                       macroIdsFront, macroIdsRear);
            }

            generateJobTrailer(prnWriter);
        }
        //--------------------------------------------------------------------//
        //                                                        M e t h o d //
        // g e n e r a t e J o b                                              //
        //--------------------------------------------------------------------//
        //                                                                    //
        // Generate test data.                                                //
        //                                                                    //
        // Some sequences are built up as (Unicode) strings, then converted   //
        // to byte arrays before writing out - this works OK because all the  //
        // characters we're using are within the ASCII range (0x00-0x7f) and  //
        // are hence represented using a single byte in the UTF-8 encoding.   //
        //                                                                    //
        //--------------------------------------------------------------------//

        public static void generateJob(BinaryWriter prnWriter,
                                       Int32 indxPaperSize,
                                       Int32 indxPaperType,
                                       Int32 indxOrientation,
                                       Int16 logLeftOffset,
                                       Int16 logTopOffset,
                                       UInt16 logPageWidth,
                                       UInt16 logPageHeight,
                                       Boolean formAsMacro,
                                       Boolean incStdPage)
        {
            const PCLOrientations.eAspect aspectPort
                = PCLOrientations.eAspect.Portrait;

            PCLOrientations.eAspect aspect;

            UInt16 paperWidth,
                   paperLength,
                   paperLengthPort,
                   logXOffset;

            //----------------------------------------------------------------//

            aspect = PCLOrientations.getAspect(indxOrientation);

            paperLength = PCLPaperSizes.getPaperLength(indxPaperSize,
                                                       _unitsPerInch, aspect);

            paperWidth = PCLPaperSizes.getPaperWidth(indxPaperSize,
                                                     _unitsPerInch, aspect);

            logXOffset = PCLPaperSizes.getLogicalOffset(indxPaperSize,
                                                        _unitsPerInch, aspect);

            paperLengthPort = PCLPaperSizes.getPaperLength(indxPaperSize,
                                                           _unitsPerInch,
                                                           aspectPort);

            //----------------------------------------------------------------//

            aspect = PCLOrientations.getAspect(indxOrientation);

            logXOffset = PCLPaperSizes.getLogicalOffset(indxPaperSize,
                                                        _unitsPerInch, aspect);

            //----------------------------------------------------------------//

            generateJobHeader(prnWriter,
                              indxPaperSize,
                              indxPaperType,
                              indxOrientation,
                              formAsMacro,
                              paperWidth,
                              paperLength,
                              logXOffset);

            generatePageSet(prnWriter,
                            indxPaperSize,
                            indxPaperType,
                            indxOrientation,
                            formAsMacro,
                            incStdPage,
                            paperWidth,
                            paperLength,
                            logXOffset,
                            logLeftOffset,
                            logTopOffset,
                            logPageWidth,
                            logPageHeight);

            generateJobTrailer(prnWriter, formAsMacro);
        }
Example #5
0
        //--------------------------------------------------------------------//
        //                                                        M e t h o d //
        // g e n e r a t e J o b                                              //
        //--------------------------------------------------------------------//
        //                                                                    //
        // Generate test data.                                                //
        //                                                                    //
        // Some sequences are built up as (Unicode) strings, then converted   //
        // to byte arrays before writing out - this works OK because all the  //
        // characters we're using are within the ASCII range (0x00-0x7f) and  //
        // are hence represented using a single byte in the UTF-8 encoding.   //
        //                                                                    //
        //--------------------------------------------------------------------//

        public static void generateJob(BinaryWriter prnWriter,
                                       Int32 indxPaperSize,
                                       Int32 indxPaperType,
                                       Int32 indxOrientation,
                                       Int32 indxPlexMode,
                                       String pjlCommand,
                                       Boolean formAsMacro)
        {
            PCLOrientations.eAspect aspect;

            UInt16 paperWidth,
                   paperLength,
                   logXOffset;

            UInt16 A4Length,
                   A4Width;

            Single scaleText,
                   scaleTextLength,
                   scaleTextWidth;

            Boolean customPaperSize;

            //----------------------------------------------------------------//

            aspect = PCLOrientations.getAspect(indxOrientation);

            A4Length = PCLPaperSizes.getPaperLength(
                (Byte)PCLPaperSizes.eIndex.ISO_A4,
                _sessionUPI,
                aspect);

            A4Width = PCLPaperSizes.getPaperWidth(
                (Byte)PCLPaperSizes.eIndex.ISO_A4,
                _sessionUPI,
                aspect);

            if (PCLPaperSizes.isCustomSize(indxPaperSize))
            {
                customPaperSize = true;
            }
            //      else if (PCLPaperSizes.getIdPCL(indxPaperSize) == 0xff)
            //          customPaperSize = true;
            else
            {
                customPaperSize = false;
            }

            paperLength = PCLPaperSizes.getPaperLength(indxPaperSize,
                                                       _sessionUPI, aspect);

            paperWidth = PCLPaperSizes.getPaperWidth(indxPaperSize,
                                                     _sessionUPI, aspect);

            logXOffset = PCLPaperSizes.getLogicalOffset(indxPaperSize,
                                                        _sessionUPI, aspect);

            scaleTextLength = (Single)paperLength / A4Length;
            scaleTextWidth  = (Single)paperWidth / A4Width;

            if (scaleTextLength < scaleTextWidth)
            {
                scaleText = scaleTextLength;
            }
            else
            {
                scaleText = scaleTextWidth;
            }

            //----------------------------------------------------------------//

            generateJobHeader(prnWriter,
                              indxPaperSize,
                              indxPaperType,
                              indxOrientation,
                              indxPlexMode,
                              pjlCommand,
                              formAsMacro,
                              customPaperSize,
                              paperWidth,
                              paperLength,
                              logXOffset,
                              scaleText);

            generatePage(prnWriter,
                         indxPaperSize,
                         indxPaperType,
                         indxOrientation,
                         indxPlexMode,
                         pjlCommand,
                         formAsMacro,
                         customPaperSize,
                         false,
                         paperWidth,
                         paperLength,
                         logXOffset,
                         scaleText);

            if (PCLPlexModes.getPlexType(indxPlexMode) !=
                PCLPlexModes.ePlexType.Simplex)
            {
                generatePage(prnWriter,
                             indxPaperSize,
                             indxPaperType,
                             indxOrientation,
                             indxPlexMode,
                             pjlCommand,
                             formAsMacro,
                             customPaperSize,
                             true,
                             paperWidth,
                             paperLength,
                             logXOffset,
                             scaleText);
            }

            generateJobTrailer(prnWriter, formAsMacro);
        }