553 | | else : |
554 | | # Initialize table of tags |
555 | | self.tags = [ 0 ] * 256 |
556 | | |
557 | | # GhostScript's sources tell us that HP printers |
558 | | # only accept little endianness, but we can handle both. |
559 | | self.tags[0x28] = self.bigEndian # BigEndian |
560 | | self.tags[0x29] = self.littleEndian # LittleEndian |
561 | | |
562 | | self.tags[0x43] = self.beginPage # BeginPage |
563 | | self.tags[0x44] = self.endPage # EndPage |
564 | | |
565 | | self.tags[0xc0] = 1 # ubyte |
566 | | self.tags[0xc1] = 2 # uint16 |
567 | | self.tags[0xc2] = 4 # uint32 |
568 | | self.tags[0xc3] = 2 # sint16 |
569 | | self.tags[0xc4] = 4 # sint32 |
570 | | self.tags[0xc5] = 4 # real32 |
571 | | |
572 | | self.tags[0xc8] = self.array_8 # ubyte_array |
573 | | self.tags[0xc9] = self.array_16 # uint16_array |
574 | | self.tags[0xca] = self.array_32 # uint32_array |
575 | | self.tags[0xcb] = self.array_16 # sint16_array |
576 | | self.tags[0xcc] = self.array_32 # sint32_array |
577 | | self.tags[0xcd] = self.array_32 # real32_array |
578 | | |
579 | | self.tags[0xd0] = 2 # ubyte_xy |
580 | | self.tags[0xd1] = 4 # uint16_xy |
581 | | self.tags[0xd2] = 8 # uint32_xy |
582 | | self.tags[0xd3] = 4 # sint16_xy |
583 | | self.tags[0xd4] = 8 # sint32_xy |
584 | | self.tags[0xd5] = 8 # real32_xy |
585 | | |
586 | | self.tags[0xe0] = 4 # ubyte_box |
587 | | self.tags[0xe1] = 8 # uint16_box |
588 | | self.tags[0xe2] = 16 # uint32_box |
589 | | self.tags[0xe3] = 8 # sint16_box |
590 | | self.tags[0xe4] = 16 # sint32_box |
591 | | self.tags[0xe5] = 16 # real32_box |
592 | | |
593 | | self.tags[0xf8] = 1 # attr_ubyte |
594 | | self.tags[0xf9] = 2 # attr_uint16 |
595 | | |
596 | | self.tags[0xfa] = self.embeddedData # dataLength |
597 | | self.tags[0xfb] = self.embeddedDataSmall # dataLengthByte |
| 554 | |
| 555 | # Initialize table of tags |
| 556 | self.tags = [ 0 ] * 256 |
| 557 | |
| 558 | # GhostScript's sources tell us that HP printers |
| 559 | # only accept little endianness, but we can handle both. |
| 560 | self.tags[0x28] = self.bigEndian # BigEndian |
| 561 | self.tags[0x29] = self.littleEndian # LittleEndian |
| 562 | |
| 563 | self.tags[0x43] = self.beginPage # BeginPage |
| 564 | self.tags[0x44] = self.endPage # EndPage |
| 565 | |
| 566 | self.tags[0x6a] = self.setColorSpace # to detect color/b&w mode |
| 567 | |
| 568 | self.tags[0xc0] = 1 # ubyte |
| 569 | self.tags[0xc1] = 2 # uint16 |
| 570 | self.tags[0xc2] = 4 # uint32 |
| 571 | self.tags[0xc3] = 2 # sint16 |
| 572 | self.tags[0xc4] = 4 # sint32 |
| 573 | self.tags[0xc5] = 4 # real32 |
| 574 | |
| 575 | self.tags[0xc8] = self.array_8 # ubyte_array |
| 576 | self.tags[0xc9] = self.array_16 # uint16_array |
| 577 | self.tags[0xca] = self.array_32 # uint32_array |
| 578 | self.tags[0xcb] = self.array_16 # sint16_array |
| 579 | self.tags[0xcc] = self.array_32 # sint32_array |
| 580 | self.tags[0xcd] = self.array_32 # real32_array |
| 581 | |
| 582 | self.tags[0xd0] = 2 # ubyte_xy |
| 583 | self.tags[0xd1] = 4 # uint16_xy |
| 584 | self.tags[0xd2] = 8 # uint32_xy |
| 585 | self.tags[0xd3] = 4 # sint16_xy |
| 586 | self.tags[0xd4] = 8 # sint32_xy |
| 587 | self.tags[0xd5] = 8 # real32_xy |
| 588 | |
| 589 | self.tags[0xe0] = 4 # ubyte_box |
| 590 | self.tags[0xe1] = 8 # uint16_box |
| 591 | self.tags[0xe2] = 16 # uint32_box |
| 592 | self.tags[0xe3] = 8 # sint16_box |
| 593 | self.tags[0xe4] = 16 # sint32_box |
| 594 | self.tags[0xe5] = 16 # real32_box |
| 595 | |
| 596 | self.tags[0xf8] = 1 # attr_ubyte |
| 597 | self.tags[0xf9] = 2 # attr_uint16 |
| 598 | |
| 599 | self.tags[0xfa] = self.embeddedData # dataLength |
| 600 | self.tags[0xfb] = self.embeddedDataSmall # dataLengthByte |
| 601 | |
| 602 | # color spaces |
| 603 | self.BWColorSpace = "".join([chr(0x00), chr(0xf8), chr(0x03)]) |
| 604 | self.GrayColorSpace = "".join([chr(0x01), chr(0xf8), chr(0x03)]) |
| 605 | self.RGBColorSpace = "".join([chr(0x02), chr(0xf8), chr(0x03)]) |
| 606 | |
| 607 | # set number of copies |
| 608 | self.setNumberOfCopies = "".join([chr(0xf8), chr(0x31)]) |